]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Issue 0020613: EDF 1106 : Modify Node Marker in SMESH and VISU
authorouv <ouv@opencascade.com>
Thu, 25 Mar 2010 13:55:29 +0000 (13:55 +0000)
committerouv <ouv@opencascade.com>
Thu, 25 Mar 2010 13:55:29 +0000 (13:55 +0000)
20 files changed:
doc/salome/gui/SMESH/images/colors_size.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/custom_point_marker.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/point_marker_widget1.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/point_marker_widget2.png [new file with mode: 0755]
doc/salome/gui/SMESH/images/std_point_marker.png [new file with mode: 0755]
doc/salome/gui/SMESH/input/colors_size.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/point_marker.doc [new file with mode: 0644]
doc/salome/gui/SMESH/input/viewing_meshes_overview.doc
resources/SalomeApp.xml
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/OBJECT/SMESH_ActorDef.h
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_DeviceActor.h
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESH_msg_en.ts

diff --git a/doc/salome/gui/SMESH/images/colors_size.png b/doc/salome/gui/SMESH/images/colors_size.png
new file mode 100755 (executable)
index 0000000..58210c0
Binary files /dev/null and b/doc/salome/gui/SMESH/images/colors_size.png differ
diff --git a/doc/salome/gui/SMESH/images/custom_point_marker.png b/doc/salome/gui/SMESH/images/custom_point_marker.png
new file mode 100755 (executable)
index 0000000..a46e33e
Binary files /dev/null and b/doc/salome/gui/SMESH/images/custom_point_marker.png differ
diff --git a/doc/salome/gui/SMESH/images/point_marker_widget1.png b/doc/salome/gui/SMESH/images/point_marker_widget1.png
new file mode 100755 (executable)
index 0000000..13b8e6d
Binary files /dev/null and b/doc/salome/gui/SMESH/images/point_marker_widget1.png differ
diff --git a/doc/salome/gui/SMESH/images/point_marker_widget2.png b/doc/salome/gui/SMESH/images/point_marker_widget2.png
new file mode 100755 (executable)
index 0000000..dbb81b4
Binary files /dev/null and b/doc/salome/gui/SMESH/images/point_marker_widget2.png differ
diff --git a/doc/salome/gui/SMESH/images/std_point_marker.png b/doc/salome/gui/SMESH/images/std_point_marker.png
new file mode 100755 (executable)
index 0000000..2a62693
Binary files /dev/null and b/doc/salome/gui/SMESH/images/std_point_marker.png differ
diff --git a/doc/salome/gui/SMESH/input/colors_size.doc b/doc/salome/gui/SMESH/input/colors_size.doc
new file mode 100644 (file)
index 0000000..aa24457
--- /dev/null
@@ -0,0 +1,35 @@
+/*!
+
+\page colors_size_page Colors / Size
+
+\image html colors_size.png
+
+Using this dialog you can define the following set of mesh visualization
+parameters:
+<ul>
+<li><b>Elements</b></li>
+<ul>
+<li><b>Fill</b> - color of surface of elements (seen in Shading mode).</li>
+<li><b>Back Face</b> - color of interior surface of elements.</li>
+<li><b>Outline</b> - color of borders of elements.</li>
+<li><b>0D slements</b> - color of 0D elements.</li>
+<li><b>Size of 0D slements</b> - size of 0D elements.</li>
+<li><b>Width</b> - width of lines (edges and borders of elements).</li>
+<li><b>Shrink coef.</b> - relative space of elements compared to gaps between
+       them in shrink mode.</li>
+</ul>
+<li><b>Nodes</b></li>
+<ul>
+<li><b>Color</b> - color of nodes.</li>
+<li><b>Marker</b> - group of options allowing to change the representation of
+       points (see \subpage point_marker_page "Point Marker" page).</li>
+</ul>
+<li><b>Orientation of faces</b></li>
+<ul>
+<li><b>Color</b> - color of orientation vertors.</li>
+<li><b>Scale</b> - size of orientation vectors.</li>
+<li><b>3D vectors</b> - allows to choose between 2D planar and 3D vectors.</li>
+</ul>
+</ul>
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/point_marker.doc b/doc/salome/gui/SMESH/input/point_marker.doc
new file mode 100644 (file)
index 0000000..c298893
--- /dev/null
@@ -0,0 +1,53 @@
+/*!
+
+\page point_marker_page Point Marker
+
+\n You can change the representation of points in
+the 3D viewer either by selecting one of the predefined
+shapes or by loading a custom texture from an external file.
+
+- Standard point markers
+
+The Mesh module provides a set of predefined point marker shapes
+which can be used to display points in 3D viewer.
+Each standard point marker has two attributes: type (defines shape
+form) and scale factor (defines shape size).
+
+\image html point_marker_widget1.png
+
+<br>
+
+\image html std_point_marker.png "Mesh presentation with standard point markers"
+
+- Custom point markers
+
+It is also possible to load a point marker shape from an external file.
+This file should provide a description of the point texture as a set
+of lines; each line is represented as sequence of "0" and "1" symbols,
+where "1" symbol means an opaque pixel and "0" symbol means a
+transparent pixel. The width of the texture correspond to the length
+of the longest line in the file, expanded to the nearest byte-aligned
+value. The height of the texture is equal to the number of non-empty
+lines in the file. Note that missing symbols are replaced by "0".
+
+Here is a texture file sample:
+
+<pre>
+00111100
+00111100
+11111111
+11111111
+11111111
+11111111
+00111100
+00111100
+</pre>
+
+\image html point_marker_widget2.png
+
+<br>
+
+\image html custom_point_marker.png "Mesh presentation with custom point markers"
+
+*/
+
index 9039b9365c296c41b46b6b1914ff1afc2e05c73f..207c4dda5a160cc7cf260211cb3f5bf87874f20c 100644 (file)
@@ -40,7 +40,7 @@ of quadratic edges as broken <b>lines</b> or as <b>arcs</b></li>
 faces of the selected mesh. Vector is shown for each 2D mesh element 
 and for each free face of 3D mesh element. Vector direction is calculated by 
 the first three nodes of face as a cross product of vectors n1-n2 and n1-n3.</li> 
-<li><b>Colors / Size</b> - allows to select color and size of
+<li>\subpage colors_size_page "Colors / Size" - allows to select color and size of
 meshes.</li>
 <li>\subpage transparency_page "Transparency" - allows to change the
 transparency of mesh elements.</li>
index 5aa23f063562c127f10fd0c01164c2bde1cbaf39..6908958865f8af350220444e18719fd30e76b2c5 100644 (file)
@@ -33,7 +33,8 @@
     <parameter name="backface_color"               value="0, 0,   255"/>
     <parameter name="elem0d_color"                 value="0, 255,   0"/>
     <parameter name="highlight_color"              value="0, 255, 255"/>
-    <parameter name="node_size"                    value="3" />
+    <parameter name="type_of_marker"               value="1"  />
+    <parameter name="marker_scale"                 value="9"  />
     <parameter name="elem0d_size"                  value="5" />
     <parameter name="element_width"                value="1" />
     <parameter name="shrink_coeff"                 value="75"/>
index 16d71448f669a6831d419a478516cd8f938a56e3..cef45817b2e653f01fd86f848abde61917079a39 100644 (file)
@@ -86,7 +86,6 @@ static int MYDEBUG = 0;
 #endif
 
 static int aLineWidthInc = 2;
-static int aPointSizeInc = 2;
 
 
 SMESH_ActorDef* SMESH_ActorDef::New(){
@@ -129,7 +128,6 @@ SMESH_ActorDef::SMESH_ActorDef()
   if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
     myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
 
-  vtkFloatingPointType aPointSize  = SMESH::GetFloat("SMESH:node_size",3);
   vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
   vtkFloatingPointType aLineWidth  = SMESH::GetFloat("SMESH:element_width",1);
 
@@ -224,7 +222,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   my1DProp = vtkProperty::New();
   my1DProp->DeepCopy(myEdgeProp);
   my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
-  my1DProp->SetPointSize(aPointSize);
+  my1DProp->SetPointSize(aElem0DSize);
   
   my1DExtProp = vtkProperty::New();
   my1DExtProp->DeepCopy(myEdgeProp);
@@ -233,7 +231,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   anRGB[2] = 1 - anRGB[2];
   my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
   my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
-  my1DExtProp->SetPointSize(aPointSize + aPointSizeInc);
+  my1DExtProp->SetPointSize(aElem0DSize);
 
   my1DExtActor = SMESH_DeviceActor::New();
   my1DExtActor->SetUserMatrix(aMatrix);
@@ -294,7 +292,6 @@ SMESH_ActorDef::SMESH_ActorDef()
   myNodeProp = vtkProperty::New();
   SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
   myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  myNodeProp->SetPointSize(aPointSize);
 
   myNodeActor = SMESH_DeviceActor::New();
   myNodeActor->SetUserMatrix(aMatrix);
@@ -312,7 +309,6 @@ SMESH_ActorDef::SMESH_ActorDef()
   anRGB[1] = 1 - anRGB[1];
   anRGB[2] = 1 - anRGB[2];
   myNodeExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  myNodeExtProp->SetPointSize(aPointSize);
 
   myNodeExtActor = SMESH_DeviceActor::New();
   myNodeExtActor->SetUserMatrix(aMatrix);
@@ -342,8 +338,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myHighlightProp->SetSpecular(0.0);
   SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
   myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  //myHighlightProp->SetPointSize(aPointSize);
-  myHighlightProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
+  myHighlightProp->SetPointSize(aElem0DSize); // ??
   myHighlightProp->SetRepresentation(1);
 
   myPreselectProp = vtkProperty::New();
@@ -352,8 +347,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myPreselectProp->SetSpecular(0.0);
   SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
   myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  //myPreselectProp->SetPointSize(aPointSize);
-  myPreselectProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
+  myPreselectProp->SetPointSize(aElem0DSize); // ??
   myPreselectProp->SetRepresentation(1);
 
   myHighlitableActor = SMESH_DeviceActor::New();
@@ -1012,6 +1006,10 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   if( dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
     SetIsDisplayNameActor( true );
 
+  int aMarkerType = mgr->integerValue( "SMESH", "type_of_marker", 1 ); // dot
+  int aMarkerScale = mgr->integerValue( "SMESH", "marker_scale", 9 );  // 5 pixels
+  SetMarkerStd( (VTK::MarkerType)aMarkerType, (VTK::MarkerScale)aMarkerScale );
+
   myTimeStamp->Modified();
   Modified();
   return true;
@@ -1219,15 +1217,15 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
       my0DActor->VisibilityOn();
     }
 
-    if(myEntityMode & eEdges){
+    if(myEntityMode & eEdges && GetRepresentation() != ePoint){
       my1DActor->VisibilityOn();
     }
     
-    if(myEntityMode & eFaces){
+    if(myEntityMode & eFaces && GetRepresentation() != ePoint){
       my2DActor->VisibilityOn();
     }
     
-    if(myEntityMode & eVolumes){
+    if(myEntityMode & eVolumes && GetRepresentation() != ePoint){
       my3DActor->VisibilityOn();
     }
     
@@ -1508,6 +1506,12 @@ void SMESH_ActorDef::UpdateHighlight(){
         SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
       myHighlitableActor->SetVisibility(anIsVisible);
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+
+      VTK::MarkerType aMarkerType = GetMarkerType();
+      if(aMarkerType != VTK::MT_USER)
+        myHighlitableActor->SetMarkerStd(aMarkerType, GetMarkerScale());
+      else
+        myHighlitableActor->SetMarkerTexture(GetMarkerTexture(), myMarkerTexture);
     }
   }
 }
@@ -1712,35 +1716,8 @@ void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){
 }
 
 
-void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){
-  myNodeProp->SetPointSize(theVal);
-  myNodeExtProp->SetPointSize(theVal);
-
-  vtkFloatingPointType aPointSize = my0DProp->GetPointSize() > theVal ? my0DProp->GetPointSize() : theVal;
-  //myHighlightProp->SetPointSize(theVal);
-  myHighlightProp->SetPointSize(aPointSize); // ??
-  //myPreselectProp->SetPointSize(theVal);
-  myPreselectProp->SetPointSize(aPointSize); // ??
-
-  my1DProp->SetPointSize(theVal + aPointSizeInc);
-  my1DExtProp->SetPointSize(theVal + aPointSizeInc);
-
-  Modified();
-}
-
-vtkFloatingPointType SMESH_ActorDef::GetNodeSize(){
-  return myNodeProp->GetPointSize();
-}
-
 void SMESH_ActorDef::Set0DSize(vtkFloatingPointType theVal){
   my0DProp->SetPointSize(theVal);
-
-  vtkFloatingPointType aPointSize = myNodeProp->GetPointSize() > theVal ? myNodeProp->GetPointSize() : theVal;
-  //myHighlightProp->SetPointSize(theVal);
-  myHighlightProp->SetPointSize(aPointSize); // ??
-  //myPreselectProp->SetPointSize(theVal);
-  myPreselectProp->SetPointSize(aPointSize); // ??
-
   Modified();
 }
 
@@ -2049,3 +2026,18 @@ SMESH_Actor::EQuadratic2DRepresentation SMESH_ActorDef::GetQuadratic2DRepresenta
   else
     return SMESH_Actor::eLines;
 }
+
+void SMESH_ActorDef::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+  SALOME_Actor::SetMarkerStd( theMarkerType, theMarkerScale );
+  myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
+  myNodeExtActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+  SALOME_Actor::SetMarkerTexture( theMarkerId, theMarkerTexture );
+  myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+  myNodeExtActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+  myMarkerTexture = theMarkerTexture; // for deferred update of myHighlightActor
+}
index fee096c5756d5c919c49e7f7187293923310e5bc..6b724cc9edf1e75569d2a51485f269fab5065102 100644 (file)
@@ -72,9 +72,6 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
   virtual vtkFloatingPointType GetLineWidth() = 0;
   virtual void SetLineWidth(vtkFloatingPointType theVal) = 0;
 
-  virtual void SetNodeSize(vtkFloatingPointType size) = 0;
-  virtual vtkFloatingPointType GetNodeSize() = 0;
-
   virtual void Set0DSize(vtkFloatingPointType size) = 0;
   virtual vtkFloatingPointType Get0DSize() = 0;
 
index 559ffd630329d4858f386275ad03c63a9ff52c2f..186eee6d819d91763e861346fba4563628c6ea75 100644 (file)
@@ -127,9 +127,6 @@ class SMESH_ActorDef : public SMESH_Actor
   virtual vtkFloatingPointType GetLineWidth();
   virtual void SetLineWidth(vtkFloatingPointType theVal);
 
-  virtual void SetNodeSize(vtkFloatingPointType size) ;
-  virtual vtkFloatingPointType GetNodeSize() ;
-
   virtual void Set0DSize(vtkFloatingPointType size);
   virtual vtkFloatingPointType Get0DSize();
 
@@ -209,6 +206,9 @@ class SMESH_ActorDef : public SMESH_Actor
   virtual void SetQuadratic2DRepresentation(EQuadratic2DRepresentation);
   virtual EQuadratic2DRepresentation GetQuadratic2DRepresentation();
   
+  virtual void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+  virtual void SetMarkerTexture( int, VTK::MarkerTexture );
+
  protected:
   void SetControlMode(eControl theMode, bool theCheckEntityMode);
   void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
@@ -283,6 +283,8 @@ class SMESH_ActorDef : public SMESH_Actor
 
   bool myIsFacesOriented;
 
+  VTK::MarkerTexture myMarkerTexture;
+
   SMESH_ActorDef();
   ~SMESH_ActorDef();
 
index f7d455ddbec82de6c02903182bb91502b903f99f..4bbb7e6d5448aa0a42e457e467dc901789be0f5e 100644 (file)
@@ -31,6 +31,7 @@
 #include "SMESH_ActorUtils.h"
 #include "SMESH_FaceOrientationFilter.h"
 #include "VTKViewer_CellLocationsArray.h"
+#include "VTKViewer_PolyDataMapper.h"
 
 #include <VTKViewer_Transform.h>
 #include <VTKViewer_TransformFilter.h>
@@ -88,7 +89,7 @@ SMESH_DeviceActor
   myRepresentation = eSurface;
 
   myProperty = vtkProperty::New();
-  myMapper = vtkPolyDataMapper::New();
+  myMapper = VTKViewer_PolyDataMapper::New();
 
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
                                                                  myPolygonOffsetUnits);
@@ -703,6 +704,7 @@ SMESH_DeviceActor
     myGeomFilter->SetWireframeMode(false);
     GetProperty()->SetRepresentation(theMode);
   }
+  SetMarkerEnabled(theMode == ePoint);
   myRepresentation = theMode;
   UpdateFaceOrientation();
   GetProperty()->Modified();
@@ -901,3 +903,58 @@ void SMESH_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
 vtkFloatingPointType SMESH_DeviceActor::GetQuadraticArcAngle(){
   return myGeomFilter->GetQuadraticArcAngle();
 }
+
+/*!
+ * Set point marker enabled
+ * \param theMarkerEnabled flag to enable/disable point marker
+ */
+void SMESH_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
+{
+  myMapper->SetMarkerEnabled( theMarkerEnabled );
+}
+
+/*!
+ * Set standard point marker
+ * \param theMarkerType type of the marker
+ */
+void SMESH_DeviceActor::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+  myMapper->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ * Set custom point marker
+ * \param theMarkerId id of the marker texture
+ * \param theMarkerTexture marker texture
+ */
+void SMESH_DeviceActor::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+  myMapper->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ * Get type of the point marker
+ * \return type of the point marker
+ */
+VTK::MarkerType SMESH_DeviceActor::GetMarkerType()
+{
+  return myMapper->GetMarkerType();
+}
+
+/*!
+  Get scale of the point marker
+  \return scale of the point marker
+*/
+VTK::MarkerScale SMESH_DeviceActor::GetMarkerScale()
+{
+  return myMapper->GetMarkerScale();
+}
+
+/*!
+ * Get texture identifier of the point marker
+ * \return texture identifier of the point marker
+ */
+int SMESH_DeviceActor::GetMarkerTexture()
+{
+  return myMapper->GetMarkerTexture();
+}
index 8b2fd6bf7fad2b49cb21b56544cb8a1cb318c6e3..eb4c45b497f28330d13da888a01bd1e540159955 100644 (file)
@@ -29,6 +29,7 @@
 #define SMESH_DEVICE_ACTOR_H
 
 #include <VTKViewer_GeometryFilter.h>
+#include <VTKViewer_MarkerDef.h>
 #include "SMESH_Controls.hxx"
 #include "SMESH_Object.h"
 
@@ -39,7 +40,6 @@ class vtkCell;
 class vtkProperty;
 class vtkMergeFilter;
 class vtkShrinkFilter;
-class vtkPolyDataMapper;
 class vtkUnstructuredGrid;
 class vtkScalarBarActor;
 class vtkLookupTable;
@@ -49,6 +49,7 @@ class vtkPassThroughFilter;
 class VTKViewer_Transform;
 class VTKViewer_TransformFilter;
 class VTKViewer_ExtractUnstructuredGrid;
+class VTKViewer_PolyDataMapper;
 
 class SMESH_ExtractGeometry;
 class SMESH_FaceOrientationFilter;
@@ -133,11 +134,18 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
   void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
   bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
 
+  void SetMarkerEnabled( bool );
+  void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+  void SetMarkerTexture( int, VTK::MarkerTexture );
+  VTK::MarkerType GetMarkerType();
+  VTK::MarkerScale GetMarkerScale();
+  int GetMarkerTexture();
+
  protected:
   void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
   void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
 
-  vtkPolyDataMapper *myMapper;
+  VTKViewer_PolyDataMapper *myMapper;
   TVisualObjPtr myVisualObj;
 
   vtkProperty *myProperty;
index e8c832b838deed76cb349423d810b4aef0ac18f4..1ccc5cc650fe07d1b166aba92a4329ffd4fdf081 100644 (file)
 
   void ExportMeshToFile(int theCommandID);
 
-  void SetDisplayMode(int theCommandID);
+  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
 
   void SetDisplayEntity(int theCommandID);
 
     }
   }
 
-  void SetDisplayMode(int theCommandID){
+  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap){
     SALOME_ListIO selected;
     SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
     if( !app )
               int Edgewidth = (int)anActor->GetLineWidth();
               if(Edgewidth == 0)
                 Edgewidth = 1;
-              int intValue = int(anActor->GetNodeSize());
               vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
 
               vtkFloatingPointType faces_orientation_color[3];
               aDlg->SetColor(5, c0D);
               aDlg->SetColor(6, o);
               aDlg->SetIntValue(1, Edgewidth);
-              aDlg->SetIntValue(2, intValue);
-              aDlg->SetIntValue(3, int(Shrink*100.));
-              aDlg->SetIntValue(4, size0D);
+              aDlg->SetIntValue(2, int(Shrink*100.));
+              aDlg->SetIntValue(3, size0D);
               aDlg->SetDoubleValue(1, faces_orientation_scale);
               aDlg->SetBooleanValue(1, faces_orientation_3dvectors);
+
+              aDlg->setCustomMarkerMap( theMarkerMap[ aStudy->StudyId() ] );
+
+              VTK::MarkerType aMarkerTypeCurrent = anActor->GetMarkerType();
+              VTK::MarkerScale aMarkerScaleCurrent = anActor->GetMarkerScale();
+              int aMarkerTextureCurrent = anActor->GetMarkerTexture();
+              if( aMarkerTypeCurrent != VTK::MT_USER )
+                aDlg->setStandardMarker( aMarkerTypeCurrent, aMarkerScaleCurrent );
+              else
+                aDlg->setCustomMarker( aMarkerTextureCurrent );
+
               if(aDlg->exec()){
                 QColor color = aDlg->GetColor(1);
                 QColor edgecolor = aDlg->GetColor(2);
                                       vtkFloatingPointType (edgecolor.blue()) / 255.);
 
                 /* Shrink factor and size edges */
-                anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
+                anActor->SetShrinkFactor(aDlg->GetIntValue(2) / 100.);
                 anActor->SetLineWidth(aDlg->GetIntValue(1));
 
                 /* Nodes color and size */
                 anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
                                       vtkFloatingPointType (nodecolor.green()) / 255.,
                                       vtkFloatingPointType (nodecolor.blue()) / 255.);
-                anActor->SetNodeSize(aDlg->GetIntValue(2));
 
                 /* 0D elements */
                 anActor->Set0DColor(vtkFloatingPointType (color0D.red()) / 255.,
                                     vtkFloatingPointType (color0D.green()) / 255.,
                                     vtkFloatingPointType (color0D.blue()) / 255.);
-                anActor->Set0DSize(aDlg->GetIntValue(4));
+                anActor->Set0DSize(aDlg->GetIntValue(3));
 
                 /* Faces orientation */
                 vtkFloatingPointType c[3] = {vtkFloatingPointType(faces_orientation_color.redF()),
                 anActor->SetFacesOrientationScale(aDlg->GetDoubleValue(1));
                 anActor->SetFacesOrientation3DVectors(aDlg->GetBooleanValue(1));
 
+                /* Point marker */
+                theMarkerMap[ aStudy->StudyId() ] = aDlg->getCustomMarkerMap();
+
+                VTK::MarkerType aMarkerTypeNew = aDlg->getMarkerType();
+                VTK::MarkerScale aMarkerScaleNew = aDlg->getStandardMarkerScale();
+                int aMarkerTextureNew = aDlg->getCustomMarkerID();
+                if( aMarkerTypeNew != VTK::MT_USER )
+                  anActor->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
+                else {
+                  const VTK::MarkerMap& aMarkerMap = theMarkerMap[ aStudy->StudyId() ];
+                  VTK::MarkerMap::const_iterator anIter = aMarkerMap.find( aMarkerTextureNew );
+                  if( anIter != aMarkerMap.end() )
+                    anActor->SetMarkerTexture( aMarkerTextureNew, anIter->second.second );
+                }
+
                 SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
                 if( !aGroupObject->_is_nil() )
                 {
@@ -1618,13 +1641,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   case 213: // Nodes
   case 212: // Nodes
   case 211: // Nodes
-    ::SetDisplayMode(theCommandID);
+    ::SetDisplayMode(theCommandID, myMarkerMap);
   break;
 
   //2D quadratic representation
   case 231:
   case 232:
-    ::SetDisplayMode(theCommandID);
+    ::SetDisplayMode(theCommandID, myMarkerMap);
   break;
   
   // Display Entity
@@ -3797,13 +3820,34 @@ void SMESHGUI::createPreferences()
   // Mesh tab ------------------------------------------------------------------------
   int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
   int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
-  setPreferenceProperty( nodeGroup, "columns", 2 );
+  setPreferenceProperty( nodeGroup, "columns", 3 );
 
   addPreference( tr( "PREF_COLOR" ), nodeGroup, LightApp_Preferences::Color, "SMESH", "node_color" );
-  int nodeSz = addPreference( tr( "PREF_SIZE" ), nodeGroup, LightApp_Preferences::IntSpin, "SMESH", "node_size" );
 
-  setPreferenceProperty( nodeSz, "min", 1 );
-  setPreferenceProperty( nodeSz, "max", 5 );
+  int typeOfMarker = addPreference( tr( "PREF_TYPE_OF_MARKER" ), nodeGroup, LightApp_Preferences::Selector, "SMESH", "type_of_marker" );
+
+  SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
+  QList<QVariant> aMarkerTypeIndicesList;
+  QList<QVariant> aMarkerTypeIconsList;
+  for ( int i = VTK::MT_POINT; i < VTK::MT_USER; i++ ) {
+    QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+    QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
+    aMarkerTypeIndicesList << i;
+    aMarkerTypeIconsList << pixmap;
+  }
+  setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+  setPreferenceProperty( typeOfMarker, "icons",   aMarkerTypeIconsList );
+
+  int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), nodeGroup, LightApp_Preferences::Selector, "SMESH", "marker_scale" );
+
+  QList<QVariant> aMarkerScaleIndicesList;
+  QStringList     aMarkerScaleValuesList;
+  for ( int i = VTK::MS_10; i <= VTK::MS_70; i++ ) {
+    aMarkerScaleIndicesList << i;
+    aMarkerScaleValuesList  << QString::number( (i-(int)VTK::MS_10)*0.5 + 1.0 );
+  }
+  setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+  setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
 
   int elemGroup = addPreference( tr( "PREF_GROUP_ELEMENTS" ), meshTab );
   setPreferenceProperty( elemGroup, "columns", 2 );
@@ -4213,6 +4257,7 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QList<SALOMEDS::Color>& theReser
 
 const char gSeparator = '_'; // character used to separate parameter names
 const char gDigitsSep = ':'; // character used to separate numeric parameter values (color = r:g:b)
+const char gPathSep   = '|'; // character used to separate paths
 
 /*!
  * \brief Store visual parameters
@@ -4238,6 +4283,39 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                                                              savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
+  // store map of custom markers
+  const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+  if( !aMarkerMap.empty() )
+  {
+    VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
+    for( ; anIter != aMarkerMap.end(); anIter++ )
+    {
+      int anId = anIter->first;
+      VTK::MarkerData aMarkerData = anIter->second;
+      std::string aMarkerFileName = aMarkerData.first;
+      VTK::MarkerTexture aMarkerTexture = aMarkerData.second;
+      if( aMarkerTexture.size() < 3 )
+        continue; // should contain at least width, height and the first value
+
+      QString aPropertyName( "texture" );
+      aPropertyName += gSeparator;
+      aPropertyName += QString::number( anId );
+
+      QString aPropertyValue = aMarkerFileName.c_str();
+      aPropertyValue += gPathSep;
+
+      VTK::MarkerTexture::const_iterator aTextureIter = aMarkerTexture.begin();
+      ushort aWidth = *aTextureIter++;
+      ushort aHeight = *aTextureIter++;
+      aPropertyValue += QString::number( aWidth ); aPropertyValue += gDigitsSep;
+      aPropertyValue += QString::number( aHeight ); aPropertyValue += gDigitsSep;
+      for( ; aTextureIter != aMarkerTexture.end(); aTextureIter++ )
+        aPropertyValue += QString::number( *aTextureIter );
+
+      ip->setProperty( aPropertyName.toStdString(), aPropertyValue.toStdString() );
+    }
+  }
+
   // viewers counters are used for storing view_numbers in IParameters
   int vtkViewers = 0;
 
@@ -4345,14 +4423,32 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                   // Sizes of lines and points
                   QString sizeStr ("line");
                   sizeStr += gDigitsSep; sizeStr += QString::number((int)aSmeshActor->GetLineWidth());
-                  sizeStr += gDigitsSep; sizeStr += "node";
-                  sizeStr += gDigitsSep; sizeStr += QString::number((int)aSmeshActor->GetNodeSize());
                   sizeStr += gDigitsSep; sizeStr += "shrink";
                   sizeStr += gDigitsSep; sizeStr += QString::number(aSmeshActor->GetShrinkFactor());
 
                   param = vtkParam + "Sizes";
                   ip->setParameter(entry, param, sizeStr.toLatin1().data());
 
+                  // Point marker
+                  QString markerStr;
+
+                  VTK::MarkerType aMarkerType = aSmeshActor->GetMarkerType();
+                  if( aMarkerType == VTK::MT_USER ) {
+                    markerStr += "custom";
+                    markerStr += gDigitsSep;
+                    markerStr += QString::number( aSmeshActor->GetMarkerTexture() );
+                  }
+                  else {
+                    markerStr += "std";
+                    markerStr += gDigitsSep;
+                    markerStr += QString::number( (int)aMarkerType );
+                    markerStr += gDigitsSep;
+                    markerStr += QString::number( (int)aSmeshActor->GetMarkerScale() );
+                  }
+
+                  param = vtkParam + "PointMarker";
+                  ip->setParameter(entry, param, markerStr.toLatin1().data());
+
                   // Opacity
                   param = vtkParam + "Opacity";
                   ip->setParameter(entry, param,
@@ -4411,6 +4507,63 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                                                              savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
+  // restore map of custom markers
+  VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+
+  std::vector<std::string> properties = ip->getProperties();
+  for (std::vector<std::string>::iterator propIt = properties.begin(); propIt != properties.end(); ++propIt)
+  {
+    std::string property = *propIt;
+    QString aPropertyName( property.c_str() );
+    QString aPropertyValue( ip->getProperty( property ).c_str() );
+
+    QStringList aPropertyNameList = aPropertyName.split( gSeparator, QString::SkipEmptyParts );
+    if( aPropertyNameList.size() != 2 )
+      continue;
+
+    int anId = 0;
+    bool ok = false;
+    if( aPropertyNameList[0] == "texture" )
+      anId = aPropertyNameList[1].toInt( &ok );
+
+    if( !ok || anId < 1 )
+      continue;
+
+    QStringList aPropertyValueList = aPropertyValue.split( gPathSep, QString::SkipEmptyParts );
+    if( aPropertyValueList.size() != 2 )
+      continue;
+
+    std::string aMarkerFileName = aPropertyValueList[0].toStdString();
+    QString aMarkerTextureString = aPropertyValueList[1];
+    QStringList aMarkerTextureStringList = aMarkerTextureString.split( gDigitsSep, QString::SkipEmptyParts );
+    if( aMarkerTextureStringList.size() != 3 )
+      continue;
+
+    ok = false;
+    ushort aWidth = aMarkerTextureStringList[0].toUShort( &ok );
+    if( !ok )
+      continue;
+
+    ok = false;
+    ushort aHeight = aMarkerTextureStringList[1].toUShort( &ok );
+    if( !ok )
+      continue;
+
+    VTK::MarkerTexture aMarkerTexture;
+    aMarkerTexture.push_back( aWidth );
+    aMarkerTexture.push_back( aHeight );
+
+    QString aMarkerTextureData = aMarkerTextureStringList[2];
+    for( int i = 0, n = aMarkerTextureData.length(); i < n; i++ )
+    {
+      QChar aChar = aMarkerTextureData.at( i );
+      if( aChar.isDigit() )
+        aMarkerTexture.push_back( aChar.digitValue() );
+    }
+
+    aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
+  }
+
   std::vector<std::string> entries = ip->getEntries();
 
   for (std::vector<std::string>::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt)
@@ -4557,18 +4710,49 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
             // Sizes of lines and points
             else if (paramNameStr == "Sizes") {
               QStringList sizes = val.split(gDigitsSep, QString::SkipEmptyParts);
-              if (sizes.count() == 6) {
+              if (sizes.count() == 4) {
+                if (sizes[0] != "line" || sizes[2] != "shrink") {
+                  MESSAGE("Invalid order of data in Sizes, must be: "
+                          "line:int:shrink:float");
+                }
+                else {
+                  aSmeshActor->SetLineWidth(sizes[1].toInt());
+                  aSmeshActor->SetShrinkFactor(sizes[3].toFloat());
+                }
+              }
+              else if (sizes.count() == 6) { // just to support old format
                 if (sizes[0] != "line" || sizes[2]  != "node" || sizes[4] != "shrink") {
                   MESSAGE("Invalid order of data in Sizes, must be: "
                           "line:int:node:int:shrink:float");
                 }
                 else {
                   aSmeshActor->SetLineWidth(sizes[1].toInt());
-                  aSmeshActor->SetNodeSize(sizes[3].toInt());
+                  //aSmeshActor->SetNodeSize(sizes[3].toInt()); // made obsolete
                   aSmeshActor->SetShrinkFactor(sizes[5].toFloat());
                 }
               }
             }
+            // Point marker
+            else if (paramNameStr == "PointMarker") {
+              QStringList data = val.split(gDigitsSep, QString::SkipEmptyParts);
+              if( data.count() >= 2 ) {
+                bool ok = false;
+                int aParam1 = data[1].toInt( &ok );
+                if( ok ) {
+                  if( data[0] == "std" && data.count() == 3 ) {
+                    int aParam2 = data[2].toInt( &ok );
+                    aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
+                  }
+                  else if( data[0] == "custom" ) {
+                    VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
+                    if( markerIt != aMarkerMap.end() ) {
+                      VTK::MarkerData aMarkerData = markerIt->second;
+                      aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
+                    }
+                  }
+                }
+              }
+            }
             // Opacity
             else if (paramNameStr == "Opacity") {
               aSmeshActor->SetOpacity(val.toFloat());
index 66ac986ec50d2e3fb1a128b40bfe17a52257e7aa..6b9036e7231d840068d59502d414e2edd0affa7d 100644 (file)
@@ -31,6 +31,7 @@
 
 // SALOME GUI includes
 #include <SalomeApp_Module.h>
+#include <VTKViewer_MarkerDef.h>
 #include <SALOME_InteractiveObject.hxx>
 
 // IDL includes
@@ -52,6 +53,8 @@ class LightApp_SelectionMgr;
 
 class SMESHGUI_FilterLibraryDlg;
 
+typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
+
 //=================================================================================
 // class    : SMESHGUI
 // purpose  :
@@ -166,6 +169,8 @@ private :
   LightApp_Displayer*             myDisplayer;
 
   SMESHGUI_FilterLibraryDlg*      myFilterLibraryDlg;
+
+  SMESHGUI_StudyId2MarkerMap      myMarkerMap;
 };
 
 #endif // SMESHGUI_H
index 7e0981d630172e126eda82deb0451d4fec67eb09..3b86bb27e0ea590f4226f6018728b9c0b81e9b6f 100644 (file)
@@ -34,6 +34,7 @@
 #include <QtxColorButton.h>
 #include <QtxDoubleSpinBox.h>
 #include <QtxIntSpinBox.h>
+#include <VTKViewer_MarkerWidget.h>
 
 // Qt includes
 #include <QGroupBox>
@@ -124,24 +125,26 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
 
   // -------------------------------
   QGroupBox* ButtonGroup2 = new QGroupBox( tr( "Nodes" ), this );
-  QHBoxLayout* ButtonGroup2Layout = new QHBoxLayout( ButtonGroup2 );
+  QGridLayout* ButtonGroup2Layout = new QGridLayout( ButtonGroup2 );
   ButtonGroup2Layout->setSpacing( SPACING );
   ButtonGroup2Layout->setMargin( MARGIN );
 
   QLabel* TextLabel_Nodes_Color = new QLabel( tr( "Color" ), ButtonGroup2 );
   btnNodeColor = new QtxColorButton( ButtonGroup2 );
 
-  QLabel* TextLabel_Nodes_Size = new QLabel( tr( "Size" ), ButtonGroup2 );
-  SpinBox_Nodes_Size = new QSpinBox( ButtonGroup2 );
-  SpinBox_Nodes_Size->setRange( 0, 5 );
-  SpinBox_Nodes_Size->setSingleStep( 1 );
-  SpinBox_Nodes_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-  SpinBox_Nodes_Size->setButtonSymbols( QSpinBox::PlusMinus );
+  QGroupBox* MarkerGroup = new QGroupBox( tr( "Marker" ), ButtonGroup2 );
+  QVBoxLayout* MarkerGroupLayout = new QVBoxLayout( MarkerGroup );
+  MarkerGroupLayout->setSpacing( 0 );
+  MarkerGroupLayout->setMargin( 0 );
 
-  ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color );
-  ButtonGroup2Layout->addWidget( btnNodeColor );
-  ButtonGroup2Layout->addWidget( TextLabel_Nodes_Size );
-  ButtonGroup2Layout->addWidget( SpinBox_Nodes_Size );
+  MarkerWidget = new VTKViewer_MarkerWidget( MarkerGroup );
+
+  MarkerGroupLayout->addWidget( MarkerWidget );
+
+  ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color, 0, 0 );
+  ButtonGroup2Layout->addWidget( btnNodeColor,          0, 1 );
+  ButtonGroup2Layout->addWidget( MarkerGroup,           1, 0, 1, 3 );
+  ButtonGroup2Layout->setColumnStretch( 2, 1 );
 
   // -------------------------------
   QGroupBox* ButtonGroup3 = new QGroupBox( tr( "Orientation of faces" ), this );
@@ -304,9 +307,8 @@ void SMESHGUI_Preferences_ColorDlg::SetIntValue( int type, int value )
 {
   switch ( type ) {
   case 1 : SpinBox_Width->setValue( value );           break; // width
-  case 2 : SpinBox_Nodes_Size->setValue( value );      break; // nodes size = value; break;
-  case 3 : SpinBox_Shrink->setValue( value );          break; // shrink coeff
-  case 4 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
+  case 2 : SpinBox_Shrink->setValue( value );          break; // shrink coeff
+  case 3 : SpinBox_0DElements_Size->setValue( value ); break; // 0d elements
   default: break;
   }
 }
@@ -320,9 +322,8 @@ int SMESHGUI_Preferences_ColorDlg::GetIntValue( int type )
   int res = 0;
   switch ( type ) {
   case 1 : res = SpinBox_Width->value();           break; // width
-  case 2 : res = SpinBox_Nodes_Size->value();      break; // nodes size
-  case 3 : res = SpinBox_Shrink->value();          break; // shrink coeff
-  case 4 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
+  case 2 : res = SpinBox_Shrink->value();          break; // shrink coeff
+  case 3 : res = SpinBox_0DElements_Size->value(); break; // 0d elements
   default: break;
   }
   return res;
@@ -379,3 +380,67 @@ bool SMESHGUI_Preferences_ColorDlg::GetBooleanValue( int type )
   }
   return res;
 }
+
+//=================================================================================
+// function : setCustomMarkerMap()
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
+{
+  MarkerWidget->setCustomMarkerMap( theMarkerMap );
+}
+
+//=================================================================================
+// function : getCustomMarkerMap()
+// purpose  :
+//=================================================================================
+VTK::MarkerMap SMESHGUI_Preferences_ColorDlg::getCustomMarkerMap()
+{
+  return MarkerWidget->getCustomMarkerMap();
+}
+
+//=================================================================================
+// function : setStandardMarker()
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setStandardMarker( VTK::MarkerType theMarkerType,
+                                                       VTK::MarkerScale theMarkerScale )
+{
+  MarkerWidget->setStandardMarker( theMarkerType, theMarkerScale );
+}
+
+//=================================================================================
+// function : setCustomMarker()
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::setCustomMarker( int theId )
+{
+  MarkerWidget->setCustomMarker( theId );
+}
+
+//=================================================================================
+// function : getMarkerType()
+// purpose  :
+//=================================================================================
+VTK::MarkerType SMESHGUI_Preferences_ColorDlg::getMarkerType() const
+{
+  return MarkerWidget->getMarkerType();
+}
+
+//=================================================================================
+// function : getStandardMarkerScale()
+// purpose  :
+//=================================================================================
+VTK::MarkerScale SMESHGUI_Preferences_ColorDlg::getStandardMarkerScale() const
+{
+  return MarkerWidget->getStandardMarkerScale();
+}
+
+//=================================================================================
+// function : getCustomMarkerID()
+// purpose  :
+//=================================================================================
+int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const
+{
+  return MarkerWidget->getCustomMarkerID();
+}
index 5b23b4e6b9dbc996c3d2c04d5ab411030d15ebdd..cf899f3ad9e9d54ed2524aae9444704603c047e6 100644 (file)
@@ -29,6 +29,9 @@
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
 
+// SALOME GUI includes
+#include <VTKViewer_MarkerDef.h>
+
 // Qt includes
 #include <QDialog>
 
@@ -38,6 +41,7 @@ class SMESHGUI;
 class QtxDoubleSpinBox;
 class QtxIntSpinBox;
 class QtxColorButton;
+class VTKViewer_MarkerWidget;
 
 class SMESHGUI_EXPORT SMESHGUI_Preferences_ColorDlg : public QDialog
 { 
@@ -56,6 +60,15 @@ public:
   void                  SetBooleanValue( int, bool );
   bool                  GetBooleanValue( int );
 
+  void                  setCustomMarkerMap( VTK::MarkerMap );
+  VTK::MarkerMap        getCustomMarkerMap();
+
+  void                  setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
+  void                  setCustomMarker( int );
+  VTK::MarkerType       getMarkerType() const;
+  VTK::MarkerScale      getStandardMarkerScale() const;
+  int                   getCustomMarkerID() const;
+
 protected:
   void                  closeEvent( QCloseEvent* );
 
@@ -76,7 +89,7 @@ private:
   QSpinBox*             SpinBox_Width;
   QtxIntSpinBox*        SpinBox_Shrink;
   QtxColorButton*       btnNodeColor;
-  QSpinBox*             SpinBox_Nodes_Size;
+  VTKViewer_MarkerWidget* MarkerWidget;
   QtxColorButton*       btnOrientationColor;
   QtxDoubleSpinBox*     SpinBox_Orientation_Scale;
   QCheckBox*            CheckBox_Orientation_3DVectors;
index ba884ff79ec7d54310e3c92846e1478ba539a968..afcea77ca5ea5d26e63c0b80fd7daf9d4a0d6824 100644 (file)
@@ -822,10 +822,9 @@ namespace SMESH
         PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
 
     // adjust highlight_width to the width of mesh entities
-    int aPointSize  = mgr->integerValue("SMESH", "node_size", 3);
     int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
     int aLineWidth  = mgr->integerValue("SMESH", "element_width", 1);
-    int maxSize = aPointSize;
+    int maxSize = aElem0DSize;
     if (aElem0DSize > maxSize) maxSize = aElem0DSize;
     if (aLineWidth > maxSize) maxSize = aLineWidth;
     if (PW < maxSize + 2) PW = maxSize + 2;
index 5aa706b4b80f4a03a25d086b9c5617832b3c1d46..7d625361083fe9e0a9b9d3badd2e4850e73a64ed 100644 (file)
@@ -3278,6 +3278,10 @@ Please, create VTK viewer and try again</translation>
             <source>PREF_LABELS_COLOR</source>
             <translation>Labels color</translation>
         </message>
+        <message>
+            <source>PREF_MARKER_SCALE</source>
+            <translation>Scale of marker</translation>
+        </message>
         <message>
             <source>PREF_NODES</source>
             <translation>Nodes</translation>
@@ -3310,10 +3314,6 @@ Please, create VTK viewer and try again</translation>
             <source>PREF_SHRINK_COEFF</source>
             <translation>Shrink coef.</translation>
         </message>
-        <message>
-            <source>PREF_SIZE</source>
-            <translation>Size</translation>
-        </message>
         <message>
             <source>PREF_TAB_GENERAL</source>
             <translation>General</translation>
@@ -3330,6 +3330,10 @@ Please, create VTK viewer and try again</translation>
             <source>PREF_TITLE_COLOR</source>
             <translation>Title color</translation>
         </message>
+        <message>
+            <source>PREF_TYPE_OF_MARKER</source>
+            <translation>Type of marker</translation>
+        </message>
         <message>
             <source>PREF_COLOR_0D</source>
             <translation>0D elements</translation>