]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020012: EDF 831 GEOM : API for points representation in 3D viewer
authorvsr <vsr@opencascade.com>
Mon, 9 Nov 2009 12:52:44 +0000 (12:52 +0000)
committervsr <vsr@opencascade.com>
Mon, 9 Nov 2009 12:52:44 +0000 (12:52 +0000)
12 files changed:
doc/salome/gui/GEOM/images/custom_point_marker.png [new file with mode: 0755]
doc/salome/gui/GEOM/images/dialog.png
doc/salome/gui/GEOM/images/point_marker_dlg1.png [new file with mode: 0755]
doc/salome/gui/GEOM/images/point_marker_dlg2.png [new file with mode: 0755]
doc/salome/gui/GEOM/images/std_point_marker.png [new file with mode: 0755]
doc/salome/gui/GEOM/input/point_marker.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/tui_viewing_geom_objs.doc
doc/salome/gui/GEOM/input/viewing_geom_obj.doc
src/GEOM/GEOM_Engine.cxx
src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx
src/GEOM_SWIG/GEOM_example7.py [new file with mode: 0644]
src/GEOM_SWIG/Makefile.am

diff --git a/doc/salome/gui/GEOM/images/custom_point_marker.png b/doc/salome/gui/GEOM/images/custom_point_marker.png
new file mode 100755 (executable)
index 0000000..a71625e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/custom_point_marker.png differ
index 53a2f41b5fc8124813eeef6e430529af1efef9a8..19f374314eeb776b51856e877f6484c18123bdbc 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/dialog.png and b/doc/salome/gui/GEOM/images/dialog.png differ
diff --git a/doc/salome/gui/GEOM/images/point_marker_dlg1.png b/doc/salome/gui/GEOM/images/point_marker_dlg1.png
new file mode 100755 (executable)
index 0000000..25ca798
Binary files /dev/null and b/doc/salome/gui/GEOM/images/point_marker_dlg1.png differ
diff --git a/doc/salome/gui/GEOM/images/point_marker_dlg2.png b/doc/salome/gui/GEOM/images/point_marker_dlg2.png
new file mode 100755 (executable)
index 0000000..d0f7ace
Binary files /dev/null and b/doc/salome/gui/GEOM/images/point_marker_dlg2.png differ
diff --git a/doc/salome/gui/GEOM/images/std_point_marker.png b/doc/salome/gui/GEOM/images/std_point_marker.png
new file mode 100755 (executable)
index 0000000..ccf478b
Binary files /dev/null and b/doc/salome/gui/GEOM/images/std_point_marker.png differ
diff --git a/doc/salome/gui/GEOM/input/point_marker.doc b/doc/salome/gui/GEOM/input/point_marker.doc
new file mode 100644 (file)
index 0000000..9fdca7c
--- /dev/null
@@ -0,0 +1,58 @@
+/*!
+
+\page point_marker_page Point Marker
+
+\n You can change the representation of the geometrical vertex
+(vertices) in 3D viewer either by selecting one of the predefined
+shapes or by loading the custom texture from an external file.
+
+- Standard point marker
+
+Geometry module provides a set of predefined point marker shapes which
+can be used to display vertices in 3D viewer.
+Each standard point marker has two attributes: type (defines shape
+form) and scale factor (defines shape size).
+
+\image html point_marker_dlg1.png
+
+For the Python script a <b>TUI Command:</b> <em>go.SetMarkerStd(Type, Size)</em> 
+can be used.
+
+\image html std_point_marker.png
+
+- Custom point marker
+
+The user can also load the 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 an example of such texture file:
+
+<pre>
+00111100
+00111100
+11111111
+11111111
+11111111
+11111111
+00111100
+00111100
+</pre>
+
+\image html point_marker_dlg2.png
+
+For the Python script a <b>TUI Command:</b> <em>go.SetMarkerTexture(ID)</em> 
+can be used.
+
+\image html custom_point_marker.png
+
+Our <b>TUI Scripts</b> provide you with useful examples of 
+\ref tui_point_marker "Setting Point Marker".
+
+*/
+
index 743205b5755babc39fdbc99525257456f13cedaf..2573c0fa5d8ecfca7cccbbd6b7a9d01e5e3836c7 100644 (file)
@@ -61,4 +61,21 @@ gg.setColor(fuse_id,218,165,31)
 gg.setTransparency(fuse_id,0.5) 
 \endcode
 
-*/
\ No newline at end of file
+\anchor tui_point_marker
+<br><h2>Set Point Marker</h2>
+
+\code
+import salome
+import geompy
+
+texture = geompy.LoadTexture("/users/user/mytexture.dat")
+
+v1 = geompy.MakeVertex(0, 0, 0)
+v2 = geompy.MakeVertex(100, 0, 0)
+v3 = geompy.MakeVertex(0, 100, 0)
+
+v1.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25)
+v2.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40)
+v3.SetMarkerTexture(texture)
+\endcode
+*/
index 1c2a518d44dce2eca3b7663a4028e14fcb519f3b..8012d20925c45250c502b22390bfe0db9525b974 100644 (file)
@@ -27,6 +27,8 @@ the standard <b>Select Color</b> menu.</li>
 transparency of geometrical objects.</li>
 <li>\subpage isolines_page "Isos" - allows to change the number of
 isolines displayed within a shape.</li>
+<li>\subpage point_marker_page "Point Marker" - allows to change the
+representation of geometrical vertex (vertices).</li>
 <li><b>Auto color</b> / <b>Disable auto color</b> - activates the auto color
 mode. When the auto color mode is enabled, the groups created on the
 sub-shapes of the selected geometrical object are automatically
index 6911bf9329ef1e9c9eb691037e8f8ff453483d98..d4426ee6b0ac5cca04f50a6200126eda019fd8c6 100644 (file)
@@ -1384,7 +1384,7 @@ void AddObjectColors (int                                             theDocID,
       case 13: aCommand += "GEOM.MS_70";   break;
       default: aCommand += "GEOM.MS_NONE"; break;
       }
-      aCommand += ");";
+      aCommand += ")";
       theScript += aCommand.ToCString();
     }
     else if (aMarkerType == Aspect_TOM_USERDEFINED) {
@@ -1393,7 +1393,7 @@ void AddObjectColors (int                                             theDocID,
        TCollection_AsciiString aCommand( "\n\t" );
        aCommand += aName + ".SetMarkerTexture(texture_map[";
        aCommand += aMarkerTextureID;
-       aCommand += "]);";
+       aCommand += "])";
        theScript += aCommand.ToCString();
       }
     }
index e15d307f5c32d983f1e2cfda831c35b6b5c28952..719fd0a8e8aaaf7ca5b53c7f151af95c631c63a3 100644 (file)
@@ -358,6 +358,6 @@ void GEOMToolsGUI_MarkerDlg::help()
 {
   if ( getStudy() ) {
     SalomeApp_Application* app = qobject_cast<SalomeApp_Application*>( getStudy()->application() );
-    app->onHelpContextModule( "GEOM", "point_marker.html" );
+    app->onHelpContextModule( "GEOM", "point_marker_page.html" );
   }
 }
diff --git a/src/GEOM_SWIG/GEOM_example7.py b/src/GEOM_SWIG/GEOM_example7.py
new file mode 100644 (file)
index 0000000..6cce391
--- /dev/null
@@ -0,0 +1,53 @@
+#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+#  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
+#
+# ---
+#
+#  File   : GEOM_example7.py
+#  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+#
+# ---
+
+import salome
+import geompy
+import os
+import GEOM
+
+data_dir = os.getenv('DATA_DIR')
+if data_dir:
+    texture_1 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat"))
+    texture_2 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture2.dat"))
+    texture_3 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture3.dat"))
+    
+    Vertex_1 = geompy.MakeVertex(0, 0, 0)
+    Vertex_2 = geompy.MakeVertex(100, 0, 0)
+    Vertex_3 = geompy.MakeVertex(0, 100, 0)
+    Vertex_4 = geompy.MakeVertex(0, 0, 100)
+    Vertex_5 = geompy.MakeVertex(100, 0, 100)
+    Vertex_1.SetMarkerTexture(texture_1);
+    Vertex_2.SetMarkerTexture(texture_2);
+    Vertex_3.SetMarkerTexture(texture_3);
+    Vertex_4.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25);
+    Vertex_5.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40);
+    geompy.addToStudy( Vertex_1, "Vertex_1" )
+    geompy.addToStudy( Vertex_2, "Vertex_2" )
+    geompy.addToStudy( Vertex_3, "Vertex_3" )
+    geompy.addToStudy( Vertex_4, "Vertex_4" )
+    geompy.addToStudy( Vertex_5, "Vertex_5" )
+    pass
index 3b7c921fbd306688538101c754ca0c9202f6c4ae..11862eb9a71248d12f05113d90d0c6a5e03ed8b9 100644 (file)
@@ -48,6 +48,7 @@ dist_salomescript_DATA =              \
        GEOM_example4.py                \
        GEOM_example5.py                \
        GEOM_example6.py                \
+       GEOM_example7.py                \
        GEOM_moteur.py                  \
        GEOM_TestAll.py                 \
        GEOM_TestOthers.py              \