]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Merge from V5_1_3_BR branch (07/12/09)
authorvsr <vsr@opencascade.com>
Tue, 8 Dec 2009 12:05:55 +0000 (12:05 +0000)
committervsr <vsr@opencascade.com>
Tue, 8 Dec 2009 12:05:55 +0000 (12:05 +0000)
96 files changed:
adm_local/unix/config_files/check_qt.m4
doc/salome/gui/GEOM/doxyfile_py.in
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/image167.png
doc/salome/gui/GEOM/images/image168.png [new file with mode: 0644]
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/creating_point.doc
doc/salome/gui/GEOM/input/isolines.doc
doc/salome/gui/GEOM/input/modify_location_operation.doc
doc/salome/gui/GEOM/input/point_marker.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/remove_extra_edges_operation.doc
doc/salome/gui/GEOM/input/sewing_operation.doc
doc/salome/gui/GEOM/input/tui_viewing_geom_objs.doc
doc/salome/gui/GEOM/input/viewing_geom_obj.doc
idl/GEOM_Gen.idl
resources/Makefile.am
resources/marker_1.png [new file with mode: 0755]
resources/marker_10.png [new file with mode: 0755]
resources/marker_11.png [new file with mode: 0755]
resources/marker_12.png [new file with mode: 0755]
resources/marker_13.png [new file with mode: 0755]
resources/marker_2.png [new file with mode: 0755]
resources/marker_3.png [new file with mode: 0755]
resources/marker_4.png [new file with mode: 0755]
resources/marker_5.png [new file with mode: 0755]
resources/marker_6.png [new file with mode: 0755]
resources/marker_7.png [new file with mode: 0755]
resources/marker_8.png [new file with mode: 0755]
resources/marker_9.png [new file with mode: 0755]
src/DisplayGUI/DisplayGUI.cxx
src/GEOM/GEOM_Application.ixx
src/GEOM/GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx
src/GEOM/GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_0.cxx
src/GEOM/GEOM_Engine.cxx
src/GEOM/GEOM_Engine.hxx
src/GEOM/GEOM_Function.cxx
src/GEOM/GEOM_Object.cxx
src/GEOM/GEOM_Object.hxx
src/GEOM/GEOM_Solver.cxx
src/GEOM/GEOM_SubShapeDriver.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
src/GEOMBase/GEOMBase_Helper.cxx
src/GEOMGUI/GEOMGUI_Selection.cxx
src/GEOMGUI/GEOMGUI_Selection.h
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_images.ts
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h
src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx
src/GEOMImpl/GEOMImpl_IGroupOperations.cxx
src/GEOMImpl/GEOMImpl_IInsertOperations.cxx
src/GEOMImpl/GEOMImpl_IInsertOperations.hxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx
src/GEOMImpl/GEOMImpl_SketcherDriver.cxx
src/GEOMImpl/Makefile.am
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx [new file with mode: 0644]
src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.h [new file with mode: 0644]
src/GEOMToolsGUI/Makefile.am
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.hh
src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh
src/GEOM_SWIG/GEOM_TestOthers.py
src/GEOM_SWIG/GEOM_example7.py [new file with mode: 0644]
src/GEOM_SWIG/Makefile.am
src/GEOM_SWIG/geompy.py
src/GEOM_SWIG/geompyDC.py
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/IGESExport/IGESExport.cxx
src/IGESExport/Makefile.am
src/IGESImport/IGESImport.cxx
src/IGESImport/Makefile.am
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx
src/OBJECT/GEOM_VTKTrihedron.cxx
src/OBJECT/GEOM_VTKTrihedron.hxx
src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx
src/STEPExport/Makefile.am
src/STEPExport/STEPExport.cxx
src/STEPImport/Makefile.am
src/STEPImport/STEPImport.cxx
src/TransformationGUI/TransformationGUI_MirrorDlg.cxx
src/TransformationGUI/TransformationGUI_PositionDlg.cxx
src/TransformationGUI/TransformationGUI_RotationDlg.cxx
src/TransformationGUI/TransformationGUI_ScaleDlg.cxx
src/TransformationGUI/TransformationGUI_TranslationDlg.cxx

index d98fff260536b1ecdb23b1cfd7e455b0731ff292..0f28aef7d9255db367155e1b234aecd3db2e682c 100644 (file)
@@ -51,6 +51,8 @@ fi
 
 qt_ok=yes
 
+QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 
index efa355dfcdc6b2050fc15067f4748e8e71406e20..c3b0a156d7cae5c995af56440888fa7dd11e4c1a 100755 (executable)
@@ -29,7 +29,7 @@ CREATE_SUBDIRS               = NO
 OUTPUT_LANGUAGE        = English
 USE_WINDOWS_ENCODING   = NO
 BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = NO
+REPEAT_BRIEF           = YES
 ALWAYS_DETAILED_SEC    = YES
 INLINE_INHERITED_MEMB  = YES
 FULL_PATH_NAMES        = NO
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
index b975d996b8f4b61beb36ac71b3dc3a34fc536d97..87907ac6da02f5d71096e66c6d0f6a56d4ef17af 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/image167.png and b/doc/salome/gui/GEOM/images/image167.png differ
diff --git a/doc/salome/gui/GEOM/images/image168.png b/doc/salome/gui/GEOM/images/image168.png
new file mode 100644 (file)
index 0000000..2524ec2
Binary files /dev/null and b/doc/salome/gui/GEOM/images/image168.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
index b472e12c9190d870fb43a2faca39445f70307df9..fadededd8381ae5c714a3dc90bf4794318cc489e 100644 (file)
@@ -25,45 +25,43 @@ the position of this point regarding the reference one.
 
 \image html point2.png
 
-\n Thirdly, we can define a point by an \b Edge and a \b 
-[list]
-[*]Parameter
+\n Thirdly, we can define a point by an \b Edge and a \b Parameter
 indicating its position on the Edge, ranging from 0.0 to 1.0. For example, 0.5 means that the
 point is located in the middle of the edge.
 \n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em>
 \n <b>Arguments:</b> Name + 1 edge  + 1 Parameter defining the
 position of the point on the given edge.
 \image html point3.png
-[*]3D co-ordinate of point to project on the given edge
+
+Alternatively, it is possible to define 3D coordinates of the point
+projected on the given edge to produce the resulting point.
 \n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurveByCoord(Edge,X,Y,Z).</em>
-\n <b>Arguments:</b> Name + 1 edge  + 3 coordinate values
-to project point on the given edge.
+\n <b>Arguments:</b> Name + 1 edge  + 3 coordinate values of the
+projected point.
 \image html point3_2.png
-[/list]
-
 
 \n Fourthly, we can define a point by intersection of two \b  Lines.
 \n <b>TUI Command:</b> <em>geompy.MakePointOnLinesIntersection(myLine1,myLine2).</em>
 \n <b>Arguments:</b> Name + 2 lines
 
 \image html point4.png
-<b>Example:</b>
 
 \n Finally, we can define a point by a \b Face and
-[list]
-[*]Two <b> Parameters: U </b> and \b V
+Two <b> Parameters: U </b> and \b V
 indicating its position on the Face, ranging from 0.0 to 1.0. For example, (0.5; 0.5) means that the
 point is located in the middle of the face.
 \n <b>TUI Command:</b> <em>geompy.MakeVertexOnSurface(myFace,myUParameter,myVParameter).</em>
 \n <b>Arguments:</b> Name + 1 face + 2 Parameters defining the
 position of the point on the given face.
-[*] 3D co-ordinate of point to project on the given face.
+
 \image html point5.png
+
+Alternatively, it is possible to define 3D coordinates of the point projected on the given face.
 \n <b>TUI Command:</b> <em>geompy.MakeVertexOnSurface(myFace,X,Y,Z).</em>
 \n <b>Arguments:</b> Name + 1 face  + 3 coordinate values
 to project point on the given face.
+
 \image html point5_2.png
-[/list]
 
 <b>Example:</b>
 
index 10862f046b3121474454e1e244b1b4176c758ef5..4f503afdfdbc631fb86b2b5f805dd33b27f72f6c 100644 (file)
@@ -4,7 +4,7 @@
 
 \n In this menu you can change the number of isolines displayed within
 a shape.
-\n <b>Arguments:</b>2 values (number of isolines).
+\n <b>Arguments: </b>2 values (number of isolines).
 
 \image html neo-isos.png
 
@@ -14,4 +14,4 @@ a shape.
 
 \image html isos_u12_v12sn.png
 
-*/
\ No newline at end of file
+*/
index 8ad902a154dcfabd12d8140aa3420189a58c04d5..632842243778433190f24a5c794bf96cc80577be 100644 (file)
@@ -13,7 +13,7 @@ with the origin of the Local Coordinate System.
 will be removed.
 \n <b>Arguments:</b> Name + one or several objects + End Coordinate System.
 \n <b>Advanced option:</b>
-   \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
 
 \image html transformation5.png
 
@@ -34,7 +34,7 @@ otherwise it will be removed.
 \n <b>Arguments:</b> Name + one or several objects + Start Coordinate System + End
 Coordinate System.
 \n <b>Advanced option:</b>
-   \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
 
 \image html transformation6.png
 
@@ -64,8 +64,7 @@ the other objects.
 
 <b>Arguments:</b> Name + one or several objects + Translation path.
 \n <b>Advanced option:</b>
-   \ref restore_presentation_parameters_page "Set presentation
-   parameters and subshapes from arguments".
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
    
 \image html transformation13.png
 
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..ddc4a6b
--- /dev/null
@@ -0,0 +1,56 @@
+/*!
+
+\page point_marker_page Point Marker
+
+\n You can change the representation of the geometrical vertices 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 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
+
+<b>TUI Command:</b> <em>go.SetMarkerStd(Type, Size)</em>.
+
+\image html std_point_marker.png "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_dlg2.png
+
+<b>TUI Command:</b> <em>go.SetMarkerTexture(ID)</em>.
+
+\image html custom_point_marker.png "Custom point markers"
+
+Our <b>TUI Scripts</b> provide you with useful examples of 
+\ref tui_point_marker "Point Marker" setting.
+
+*/
+
index 4988009e622279b2f0727cb7329c446b95dea103..ef1b932bfdb19bcfb622744f7d003047dcf99eb6 100644 (file)
@@ -10,9 +10,9 @@ hexahedral solids and compounds of hexahedral solids.
 However, there is an option to unite all faces sharing one
 surface, which produces not only hexahedral solids.
 
-\n <b>TUI Command:</b> <em>geompy.RemoveExtraEdges(theShape,theOptimumNbFaces)</em>,
+\n <b>TUI Command:</b> <em>geompy.RemoveExtraEdges(theShape,doUnionFaces)</em>,
 where <em>theShape</em> is a compound or a single solid
-and <em>theOptimumNbFaces</em> is an integer parameter, that regulates,
+and <em>doUnionFaces</em> is a boolean parameter, that regulates,
 whether the faces, sharing a common surface, should be united.
 \n <b>Arguments:</b> Name + one shape + a flag.
 \n <b>Advanced option:</b>
index a32474bce47c658fbeeaf42469e7f2cdf6bb5543..9ee5eff67b5c5cac0fb7be2fdb59bf7c305fed1f 100644 (file)
@@ -4,7 +4,7 @@
 
 \n To produce a \b Sewing operation in the <b>Main Menu</b> select <b>Repair - > Sewing</b>.
 
-\n It is possible to sew only compounds or shells.
+\n It is possible to sew only compounds of faces or shells.
 
 \n The \b Result will be a \b GEOM_Object. 
 
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..6a485015e666b8a7d46e12e77ba60844cf985970 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 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 a04fcb4c6bcea7ce4c4212246e47ff17da60e764..978cde0d2256233d1177829ae3ad715bc9dbcbab 100644 (file)
@@ -40,6 +40,17 @@ module GEOM
   enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL,
                     FACE, WIRE, EDGE, VERTEX, SHAPE };
 
+  /*!
+   * Marker type
+   */
+  enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_O, MT_X, MT_O_POINT, MT_O_PLUS,
+                    MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER };
+
+  /*!
+   * Marker size
+   */
+  enum marker_size { MS_NONE, MS_10, MS_15, MS_20, MS_25, MS_30, MS_35,
+                    MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 };
 
   /*!
    *  State of shape relatively geometrical surface like plane, sphere or cylinder.
@@ -172,6 +183,38 @@ module GEOM
      */
     boolean GetAutoColor();
 
+    /*!
+     * Set standard point marker for the object
+     * \param theType standard marker type
+     * \param theSize marker relative size
+     */
+    void SetMarkerStd(in marker_type theType, in marker_size theSize );
+
+    /*!
+     * Set custom point marker for the object. The texture can be added
+     * by LoadTexture() or AddTexture() functions.
+     * \param theTextureId texture ID
+     */
+    void SetMarkerTexture(in long theTextureId);
+
+    /*!
+     * Get type of the point marker assigned to the object
+     * \return current marker type (MT_NONE if no marker is set)
+     */
+    marker_type GetMarkerType();
+
+    /*!
+     * Get size of the point marker assigned to the object
+     * \return current marker relative size (MS_NONE if no marker is set)
+     */
+    marker_size GetMarkerSize();
+
+    /*!
+     * Get texture idenifier of the point marker assigned to the object
+     * \return marker texture ID (0 if no marker set)
+     */
+    long GetMarkerTexture();
+
     /*!
      *  Set a Study entry where this object was published.
      */
@@ -240,7 +283,7 @@ module GEOM
      *         used for object creation
      */
     void SetParameters (in string theParameters);
-                           
+
     /*!
      *  Return list of notebook variables used for object creation separated by ":" symbol
      */
@@ -462,7 +505,7 @@ module GEOM
      */
     GEOM_Object MakePlaneFace (in GEOM_Object theFace,
                               in double theTrimSize);
-                              
+
     /*!
      *  Create a plane, by two vectors.
      *  \param theVec1 Vector1, the plane has to pass through first point of this vector.
@@ -473,7 +516,7 @@ module GEOM
     GEOM_Object MakePlane2Vec (in GEOM_Object theVec1,
                               in GEOM_Object theVec2,
                               in double theTrimSize);
-                              
+
     /*!
      *  Create a plane, defined by local coordinate system.
      *  \param theLCS Referenced LCS(Marker).
@@ -922,7 +965,7 @@ module GEOM
      *  vertical (H) and horisontal (W).
      *  \param theVec defines plane.
      *  \param theH vertical size (height).
-     *  \param theW horisontal size (width). 
+     *  \param theW horisontal size (width).
      *  \return New GEOM_Object, containing the created face.
      */
     GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW);
@@ -944,7 +987,7 @@ module GEOM
     GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1,
                                  in GEOM_Object thePnt2,
                                  in GEOM_Object thePnt3);
-                                 
+
     /*!
      *  Create a disk specified dimensions along OX-OY coordinate axes,
      *  Center of the disk at point (0, 0, 0).
@@ -953,7 +996,7 @@ module GEOM
      *  \return New GEOM_Object, containing the created disk.
      */
     GEOM_Object MakeDiskR (in double theR, in short theOrientation);
-    
+
     /*!
      *  Create a cylinder with given radius and height at
      *  the origin of coordinate system. Axis of the cylinder
@@ -1075,7 +1118,7 @@ module GEOM
     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
                                      in GEOM_Object thePoint1,
                                      in GEOM_Object thePoint2);
-                                   
+
     /*!
      *  Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
      *  \param theBase Base shape to be extruded.
@@ -1144,7 +1187,7 @@ module GEOM
       /*!
      *  Create a shape by extrusion of the profile shape along
      *  the path shape. The path shape can be a wire or an edge.
-     *  the several profiles can be specified in the several locations of path.        
+     *  the several profiles can be specified in the several locations of path.
      *  \param theSeqBases - list of  Bases shape to be extruded.
      *  \param theLocations - list of locations on the path corresponding
      *                        specified list of the Bases shapes. Number of locations
@@ -1165,7 +1208,7 @@ module GEOM
     /*!
      *  Create a shape by extrusion of the profile shape along
      *  the path shape. The path shape can be a shell or a face.
-     *  the several profiles can be specified in the several locations of path.        
+     *  the several profiles can be specified in the several locations of path.
      *  \param theSeqBases - list of  Bases shape to be extruded.
      *  \param theSeqSubBases - list of corresponding subshapes of section shapes.
      *  \param theLocations - list of locations on the path corresponding
@@ -1196,7 +1239,7 @@ module GEOM
 
     /*!
      *  Create a shape by extrusion of the base shape along
-     *  the path shape with constant bi-normal direction along the given vector. 
+     *  the path shape with constant bi-normal direction along the given vector.
      *  The path shape can be a wire or an edge.
      *  \param theBase Base shape to be extruded.
      *  \param thePath Path shape to extrude the base shape along it.
@@ -1205,8 +1248,8 @@ module GEOM
      *                along the sweep surface.
      *  \return New GEOM_Object, containing the created pipe.
      */
-    GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase, 
-                                            in GEOM_Object thePath, 
+    GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase,
+                                            in GEOM_Object thePath,
                                             in GEOM_Object theVec);
 
   };
@@ -2206,7 +2249,7 @@ module GEOM
                                in GEOM_Object thePnt1,
                                in GEOM_Object thePnt2,
                                in boolean theSense);
-                              
+
     /*!
      *  Create an arc of ellipse of center C and two points P1 P2.
      *  \param theCenter Center point of the arc.
@@ -2277,7 +2320,7 @@ module GEOM
      *  \return New GEOM_Object, containing the created wire.
      */
     GEOM_Object MakeSketcher (in string theCommand, in ListOfDouble theWorkingPlane);
-    
+
     /*!
      *  Create a 3D sketcher, following the numerical description,
      *  passed through points created by \a theCoordinates argument. \n
@@ -2285,7 +2328,7 @@ module GEOM
      *
      *  "Make3DSketcher[x1, y1, z1, x2, y2, z2, ..., xN, yN, zN]"
      */
-    
+
     GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
 
       /*!
@@ -2343,12 +2386,12 @@ module GEOM
     GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
                                 in double      theR,
                                 in ListOfLong  theFaces);
-                                
+
     GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape,
                                     in double      theR1,
                                     in double      theR2,
                                     in ListOfLong  theFaces);
-                                    
+
     /*!
      *  Perform a fillet on face of the specified vertexes of the given shape.
      *  \param theShape Shape, to perform fillet on.
@@ -2651,6 +2694,37 @@ module GEOM
      */
     void ExportTranslators (out string_array theFormats,
                            out string_array thePatterns);
+
+    /*!
+     * Load texture from file
+     * \param theTextureFile texture file name
+     * \return unique texture identifier
+     */
+    long LoadTexture(in string theTextureFile);
+
+    /*!
+     * Add texture to the study
+     * \param theWidth texture width in pixels
+     * \param theHeight texture height in pixels
+     * \param theTexture texture byte array
+     * \return unique texture identifier
+     */
+    long AddTexture(in long theWidth, in long theHeight, in SALOMEDS::TMPFile theTexture);
+
+    /*!
+     * Get previously loaded texture data
+     * \param theID texture identifier
+     * \param theWidth texture width in pixels
+     * \param theHeight texture height in pixels
+     * \return texture byte array
+     */
+    SALOMEDS::TMPFile GetTexture(in long theID, out long theWidth, out long theHeight);
+
+    /*!
+     * Get list of all avaiable texture IDs
+     * \return list of all texture IDs avaiable for the current study
+     */
+    ListOfLong GetAllTextures();
   };
 
   /*!
index 7e74345c421aae1d18d743d4d8daebdd3f41965e..30478317fd9e149fdff75f4b7903e6d32f566f44 100644 (file)
@@ -186,6 +186,19 @@ suppressintwires.png               \
 marker.png                     \
 marker2.png                    \
 marker3.png                    \
+marker_1.png                   \
+marker_2.png                   \
+marker_3.png                   \
+marker_4.png                   \
+marker_5.png                   \
+marker_6.png                   \
+marker_7.png                   \
+marker_8.png                   \
+marker_9.png                   \
+marker_10.png                  \
+marker_11.png                  \
+marker_12.png                  \
+marker_13.png                  \
 position.png                   \
 position2.png                  \
 position3.png                   \
diff --git a/resources/marker_1.png b/resources/marker_1.png
new file mode 100755 (executable)
index 0000000..8bbaa85
Binary files /dev/null and b/resources/marker_1.png differ
diff --git a/resources/marker_10.png b/resources/marker_10.png
new file mode 100755 (executable)
index 0000000..aa7d857
Binary files /dev/null and b/resources/marker_10.png differ
diff --git a/resources/marker_11.png b/resources/marker_11.png
new file mode 100755 (executable)
index 0000000..ed1935a
Binary files /dev/null and b/resources/marker_11.png differ
diff --git a/resources/marker_12.png b/resources/marker_12.png
new file mode 100755 (executable)
index 0000000..b6c0996
Binary files /dev/null and b/resources/marker_12.png differ
diff --git a/resources/marker_13.png b/resources/marker_13.png
new file mode 100755 (executable)
index 0000000..16162a7
Binary files /dev/null and b/resources/marker_13.png differ
diff --git a/resources/marker_2.png b/resources/marker_2.png
new file mode 100755 (executable)
index 0000000..f0d2109
Binary files /dev/null and b/resources/marker_2.png differ
diff --git a/resources/marker_3.png b/resources/marker_3.png
new file mode 100755 (executable)
index 0000000..e37d613
Binary files /dev/null and b/resources/marker_3.png differ
diff --git a/resources/marker_4.png b/resources/marker_4.png
new file mode 100755 (executable)
index 0000000..78c8055
Binary files /dev/null and b/resources/marker_4.png differ
diff --git a/resources/marker_5.png b/resources/marker_5.png
new file mode 100755 (executable)
index 0000000..a994c11
Binary files /dev/null and b/resources/marker_5.png differ
diff --git a/resources/marker_6.png b/resources/marker_6.png
new file mode 100755 (executable)
index 0000000..967b93e
Binary files /dev/null and b/resources/marker_6.png differ
diff --git a/resources/marker_7.png b/resources/marker_7.png
new file mode 100755 (executable)
index 0000000..7a3eb90
Binary files /dev/null and b/resources/marker_7.png differ
diff --git a/resources/marker_8.png b/resources/marker_8.png
new file mode 100755 (executable)
index 0000000..3b3ccc4
Binary files /dev/null and b/resources/marker_8.png differ
diff --git a/resources/marker_9.png b/resources/marker_9.png
new file mode 100755 (executable)
index 0000000..0d76036
Binary files /dev/null and b/resources/marker_9.png differ
index 952007b0ad8c442f71c8e5682867af45eef2d3f3..44a14839c10d3371d9f31d662ed6484b8cbc8658 100644 (file)
@@ -511,18 +511,18 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
       SVTK_Prs* vtkPrs =
         stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
       if ( vtkPrs && !vtkPrs->IsNull() ) {
-       if ( mode == 0 )
-         aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
-       else if ( mode == 1 )
-         aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
-       else if ( mode == 2 ) {
-         vtkActorCollection* anActors = vtkPrs->GetObjects();
-         anActors->InitTraversal();
-         while (vtkActor* anAct = anActors->GetNextActor()) {
-           GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
-           aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
-         }
-       }
+        if ( mode == 0 )
+          aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
+        else if ( mode == 1 )
+          aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
+        else if ( mode == 2 ) {
+          vtkActorCollection* anActors = vtkPrs->GetObjects();
+          anActors->InitTraversal();
+          while (vtkActor* anAct = anActors->GetNextActor()) {
+            GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(anAct);
+            aGeomActor->SetVectorMode(!aGeomActor->GetVectorMode());
+          }
+        }
       }
     }
     aView->Repaint();
@@ -538,19 +538,21 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
       SOCC_Viewer* soccViewer = (SOCC_Viewer*)(viewWindow->getViewManager()->getViewModel());
       SOCC_Prs* occPrs = dynamic_cast<SOCC_Prs*>( soccViewer->CreatePrs( It.Value()->getEntry() ) );
       if ( occPrs && !occPrs->IsNull() ) {
-       AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
-       AIS_ListIteratorOfListOfInteractive interIter( shapes );
-       for ( ; interIter.More(); interIter.Next() ) {
-         if ( mode == 0 )
-           ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
-         else if ( mode == 1 )
-           ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
-         if (mode == 2 ) {
-           Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
-           aSh->SetDisplayVectors(!aSh->isShowVectors());
-           ic->RecomputePrsOnly(interIter.Value());
-         }
-       }
+        AIS_ListOfInteractive shapes; occPrs->GetObjects( shapes );
+        AIS_ListIteratorOfListOfInteractive interIter( shapes );
+        for ( ; interIter.More(); interIter.Next() ) {
+          if ( mode == 0 )
+            ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
+          else if ( mode == 1 )
+            ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
+          if (mode == 2 ) {
+            Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
+            if ( !aSh.IsNull() ) {
+              aSh->SetDisplayVectors(!aSh->isShowVectors());
+              ic->RecomputePrsOnly(interIter.Value());
+            }
+          }
+        }
       }
     }
     ic->UpdateCurrentViewer();
index 8a2c33ff7a40395d33a022455302e8fcddf4f461..3fbbfcaf15adafe54437cd9b28dd4f0b8906db9f 100644 (file)
@@ -47,10 +47,10 @@ Standard_EXPORT Handle_Standard_Type& GEOM_Application_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOM_Application",
-                                                        sizeof(GEOM_Application),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOM_Application),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index f63d23b3b7b13d462813836f8930570bc5c71753..c91aa48234ab7ddea43f8fc5feb1f4ac923d75af 100644 (file)
@@ -77,7 +77,7 @@ Standard_EXPORT ~GEOM_DataMapNodeOfDataMapOfAsciiStringTransient();
  //
  Standard_EXPORT friend Handle_Standard_Type& GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_();
  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean             IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
 
 protected:
 
index 7dbb47f54df715bbbd126010bb3fdf68590e7546..cf99e71de92413c1a3b684f550f0d0732eab1756 100644 (file)
@@ -54,10 +54,10 @@ Standard_EXPORT Handle_Standard_Type& GEOM_DataMapNodeOfDataMapOfAsciiStringTran
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOM_DataMapNodeOfDataMapOfAsciiStringTransient",
-                                                        sizeof(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 7a572ba1fca7ce2de164d043bb8f22452041c04f..e6da3ad15bddf34d4343ea906390ab0e6e7891a6 100644 (file)
 #include <TDataStd_ChildNodeIterator.hxx>
 #include <TFunction_Driver.hxx>
 #include <TFunction_DriverTable.hxx>
+#include <TDataStd_HArray1OfByte.hxx>
+#include <TDataStd_ByteArray.hxx>
+#include <TDataStd_UAttribute.hxx>
+#include <TDF_ChildIterator.hxx>
+#include <TDataStd_Comment.hxx>
 
 #include <TopExp.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
@@ -106,7 +111,7 @@ bool ProcessFunction(Handle(GEOM_Function)&   theFunction,
                      TCollection_AsciiString& theScript,
                      TCollection_AsciiString& theAfterScript,
                      const TVariablesList&    theVariables,
-                    const bool               theIsPublished,
+                     const bool               theIsPublished,
                      TDF_LabelMap&            theProcessed,
                      std::set<std::string>&   theIgnoreObjs,
                      bool&                    theIsDumpCollected);
@@ -117,23 +122,35 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
 Handle(TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString& theString);
 
 void ReplaceEntriesByNames (TCollection_AsciiString&                  theScript,
-                           Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
-                           const bool                                theIsPublished,
-                           Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
+                            Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                            const bool                                theIsPublished,
+                            Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
                             TColStd_SequenceOfAsciiString&            theObjListToPublish);
 
-void AddObjectColors (const Handle(TDocStd_Document)&                 theDoc,
-                     TCollection_AsciiString&                        theScript,
-                     const Resource_DataMapOfAsciiStringAsciiString& theObjectNames);
+void AddObjectColors (int                                             theDocID,
+                      TCollection_AsciiString&                        theScript,
+                      const Resource_DataMapOfAsciiStringAsciiString& theObjectNames);
+
+void AddTextures (int theDocID, TCollection_AsciiString& theScript);
 
 void PublishObject (const TCollection_AsciiString&                  theEntry,
-                   const TCollection_AsciiString&                  theName,
-                   const Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
-                   const Resource_DataMapOfAsciiStringAsciiString& theEntry2StEntry,
-                   const Resource_DataMapOfAsciiStringAsciiString& theStEntry2Entry,
-                   const Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
-                   std::map< int, std::string >&                   theEntryToCommandMap,
-                   std::set<std::string>&                          theMapOfPublished);
+                    const TCollection_AsciiString&                  theName,
+                    const Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                    const Resource_DataMapOfAsciiStringAsciiString& theEntry2StEntry,
+                    const Resource_DataMapOfAsciiStringAsciiString& theStEntry2Entry,
+                    const Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
+                    std::map< int, std::string >&                   theEntryToCommandMap,
+                    std::set<std::string>&                          theMapOfPublished);
+
+//=======================================================================
+//function : GetTextureGUID
+//purpose  :
+//=======================================================================
+const Standard_GUID& GEOM_Engine::GetTextureGUID()
+{
+  static Standard_GUID anID("FF1BBB01-5D14-4df2-980B-3A668264EA17");
+  return anID;
+}
 
 //=============================================================================
 /*!
@@ -186,17 +203,19 @@ GEOM_Engine::~GEOM_Engine()
  *  GetDocument
  */
 //=============================================================================
-Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID)
+Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force)
 {
   Handle(TDocStd_Document) aDoc;
-  if(!_mapIDDocument.IsBound(theDocID)) {
+  if(_mapIDDocument.IsBound(theDocID)) {
+    aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+  }
+  else if (force) {
     _OCAFApp->NewDocument("SALOME_GEOM", aDoc);
     aDoc->SetUndoLimit(_UndoLimit);
     _mapIDDocument.Bind(theDocID, aDoc);
     TDataStd_Integer::Set(aDoc->Main(), theDocID);
   }
-
-  return Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+  return aDoc;
 }
 
 //=============================================================================
@@ -219,17 +238,24 @@ int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument)
  *  GetObject
  */
 //=============================================================================
-Handle(GEOM_Object) GEOM_Engine::GetObject(int theDocID, char* theEntry)
+Handle(GEOM_Object) GEOM_Engine::GetObject(int theDocID, char* theEntry, bool force)
 {
-  TCollection_AsciiString anID = BuildID(theDocID, theEntry);
-  if(_objects.IsBound(anID)) return Handle(GEOM_Object)::DownCast(_objects(anID));
+  Handle(GEOM_Object) anObject;
 
-  TDF_Label aLabel;
-  Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
-  TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True);
-  Handle(GEOM_Object) anObject = new GEOM_Object(aLabel);
+  TCollection_AsciiString anID = BuildID(theDocID, theEntry);
 
-  _objects.Bind(anID, anObject);
+  if (_objects.IsBound(anID)) {
+    anObject = Handle(GEOM_Object)::DownCast(_objects(anID));
+  }
+  else if (force) {
+    Handle(TDocStd_Document) aDoc = GetDocument(theDocID, force);
+    if ( !aDoc.IsNull()) {
+      TDF_Label aLabel;
+      TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True);
+      anObject = new GEOM_Object(aLabel);
+      _objects.Bind(anID, anObject);
+    }
+  }
 
   return anObject;
 }
@@ -370,10 +396,12 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape,
 //=============================================================================
 bool GEOM_Engine::RemoveObject(Handle(GEOM_Object) theObject)
 {
-  if (!theObject) return false;
+  if (theObject.IsNull()) return false;
 
   int aDocID = theObject->GetDocID();
-
+  if(!_mapIDDocument.IsBound(aDocID))
+    return false;  // document is closed...
+  
   //Remove an object from the map of available objects
   TCollection_AsciiString anID = BuildIDFromObject(theObject);
   if (_objects.IsBound(anID)) _objects.UnBind(anID);
@@ -503,11 +531,14 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
 
   if (aDoc.IsNull()) return TCollection_AsciiString("def RebuildData(theStudy): pass\n");
 
-  aScript  = "import geompy\n";
+  aScript  = "import GEOM\n";
+  aScript += "import geompy\n";
   aScript += "import math\n";
   aScript += "import SALOMEDS\n\n";
   aScript += "def RebuildData(theStudy):";
-  aScript += "\n\tgeompy.init_geom(theStudy)";
+  aScript += "\n\tgeompy.init_geom(theStudy)\n";
+
+  AddTextures(theDocID, aScript);
 
   Standard_Integer posToInsertGlobalVars = aScript.Length() + 1;
 
@@ -556,32 +587,32 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
       bool isDumpCollected = false;
       TCollection_AsciiString aCurScript, anAfterScript;
       if (!ProcessFunction(aFunction, aCurScript, anAfterScript, theVariables,
-                          isPublished, aCheckedFuncMap, anIgnoreObjMap,
-                          isDumpCollected ))
+                           isPublished, aCheckedFuncMap, anIgnoreObjMap,
+                           isDumpCollected ))
         continue;
       // add function description before dump
       if (!aCurScript.IsEmpty())
         aFuncScript += aCurScript;
       if (isDumpCollected ) {
-       // Replace entries by the names
+        // Replace entries by the names
         ReplaceEntriesByNames( aFuncScript, theObjectNames,
                                isPublished, anEntryToBadName, aObjListToPublish );
-       
-       // publish collected objects
-       std::map< int, std::string > anEntryToCommandMap; // sort publishing commands by object entry
+        
+        // publish collected objects
+        std::map< int, std::string > anEntryToCommandMap; // sort publishing commands by object entry
         int i = 1, n = aObjListToPublish.Length();
-       for ( ; i <= n; i++ )
+        for ( ; i <= n; i++ )
         {
           const TCollection_AsciiString& aEntry = aObjListToPublish.Value(i);
-         if (!theObjectNames.IsBound( aEntry ))
+          if (!theObjectNames.IsBound( aEntry ))
             continue;
-         PublishObject( aEntry, theObjectNames.Find(aEntry),
-                       theObjectNames, aEntry2StEntry, aStEntry2Entry,
-                       anEntryToBadName, anEntryToCommandMap, anIgnoreObjMap );
+          PublishObject( aEntry, theObjectNames.Find(aEntry),
+                        theObjectNames, aEntry2StEntry, aStEntry2Entry,
+                        anEntryToBadName, anEntryToCommandMap, anIgnoreObjMap );
         }
-       // add publishing commands to the script
-       std::map< int, std::string >::iterator anEntryToCommand = anEntryToCommandMap.begin();
-       for ( ; anEntryToCommand != anEntryToCommandMap.end(); ++anEntryToCommand )
+        // add publishing commands to the script
+        std::map< int, std::string >::iterator anEntryToCommand = anEntryToCommandMap.begin();
+        for ( ; anEntryToCommand != anEntryToCommandMap.end(); ++anEntryToCommand )
           aFuncScript += (char*)anEntryToCommand->second.c_str();
         
         // PTv, 0020001 add result objects from RestoreSubShapes into ignore list,
@@ -599,9 +630,9 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
           }
         }
 
-       aObjListToPublish.Clear();
-       aScript += aFuncScript;
-       aFuncScript.Clear();
+        aObjListToPublish.Clear();
+        aScript += aFuncScript;
+        aFuncScript.Clear();
       }
       aFuncScript += anAfterScript;
     }
@@ -615,7 +646,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
   aScript += aFuncScript;
 
   // ouv : NPAL12872
-  AddObjectColors( aDoc, aScript, theObjectNames );
+  AddObjectColors( theDocID, aScript, theObjectNames );
 
   // Make script to publish in study
   if ( isPublished )
@@ -630,8 +661,8 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
         continue; // should not be dumped
       const TCollection_AsciiString& aName = anEntryToNameIt.Value();
       PublishObject( aEntry, aName, theObjectNames,
-                   aEntry2StEntry, aStEntry2Entry,
-                   anEntryToBadName, anEntryToCommandMap, anIgnoreObjMap );
+                    aEntry2StEntry, aStEntry2Entry,
+                    anEntryToBadName, anEntryToCommandMap, anIgnoreObjMap );
     }
     // add publishing commands to the script
     std::map< int, std::string >::iterator anEntryToCommand = anEntryToCommandMap.begin();
@@ -695,6 +726,117 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const
   return aRetSeq;
 }
 
+#define TEXTURE_LABEL_ID       1
+#define TEXTURE_LABEL_FILE     2
+#define TEXTURE_LABEL_WIDTH    3
+#define TEXTURE_LABEL_HEIGHT   4
+#define TEXTURE_LABEL_DATA     5
+
+int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, 
+                            const Handle(TDataStd_HArray1OfByte)& theTexture,
+                            const TCollection_AsciiString& theFileName)
+{
+  Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+  Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
+
+  // NPAL18604: use existing label to decrease memory usage,
+  //            if this label has been freed (object deleted)
+  bool useExisting = false;
+  TDF_Label aChild;
+  if (_freeLabels.find(theDocID) != _freeLabels.end()) {
+    std::list<TDF_Label>& aFreeLabels = _freeLabels[theDocID];
+    if (!aFreeLabels.empty()) {
+      useExisting = true;
+      aChild = aFreeLabels.front();
+      aFreeLabels.pop_front();
+    }
+  }
+  if (!useExisting) {
+    // create new label
+    aChild = TDF_TagSource::NewChild(aDoc->Main());
+  }
+
+  aChild.ForgetAllAttributes(Standard_True);
+  Handle(TDataStd_TreeNode) node;
+  if ( !aChild.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), node ) )
+    node = TDataStd_TreeNode::Set(aChild);
+  TDataStd_UAttribute::Set(aChild, GetTextureGUID());
+
+  static int aTextureID = 0;
+
+  TDataStd_Integer::Set(aChild.FindChild(TEXTURE_LABEL_ID),     ++aTextureID);
+  TDataStd_Comment::Set(aChild.FindChild(TEXTURE_LABEL_FILE),   theFileName);
+  TDataStd_Integer::Set(aChild.FindChild(TEXTURE_LABEL_WIDTH),  theWidth);
+  TDataStd_Integer::Set(aChild.FindChild(TEXTURE_LABEL_HEIGHT), theHeight);
+
+  Handle(TDataStd_ByteArray) anAttr =
+    TDataStd_ByteArray::Set(aChild.FindChild(TEXTURE_LABEL_DATA), 
+                            theTexture.IsNull() ? 0 : theTexture->Lower(),
+                            theTexture.IsNull() ? 0 : theTexture->Upper());
+  anAttr->ChangeArray(theTexture);
+
+  return aTextureID;
+}
+
+Handle(TDataStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID,
+                                                       int& theWidth, int& theHeight,
+                                                       TCollection_AsciiString& theFileName)
+{
+  Handle(TDataStd_HArray1OfByte) anArray;
+  theWidth = theHeight = 0;
+
+  Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+
+  TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
+  bool found = false;
+  for (; anIterator.More() && !found; anIterator.Next()) {
+    TDF_Label aTextureLabel = anIterator.Value();
+    if (aTextureLabel.IsAttribute( GetTextureGUID())) {
+      TDF_Label anIDLabel = aTextureLabel.FindChild(TEXTURE_LABEL_ID, Standard_False);
+      Handle(TDataStd_Integer) anIdAttr;
+      if(!anIDLabel.IsNull() && anIDLabel.FindAttribute(TDataStd_Integer::GetID(), anIdAttr) && 
+         anIdAttr->Get() == theTextureID) {
+        TDF_Label aFileLabel   = aTextureLabel.FindChild(TEXTURE_LABEL_FILE,    Standard_False);
+        TDF_Label aWidthLabel  = aTextureLabel.FindChild(TEXTURE_LABEL_WIDTH,   Standard_False);
+        TDF_Label aHeightLabel = aTextureLabel.FindChild(TEXTURE_LABEL_HEIGHT,  Standard_False);
+        TDF_Label aDataLabel   = aTextureLabel.FindChild(TEXTURE_LABEL_DATA,    Standard_False);
+        Handle(TDataStd_Integer) aWidthAttr, aHeightAttr;
+        Handle(TDataStd_ByteArray) aTextureAttr;
+        Handle(TDataStd_Comment) aFileAttr;
+        if (!aWidthLabel.IsNull()  && aWidthLabel.FindAttribute(TDataStd_Integer::GetID(),  aWidthAttr) &&
+            !aHeightLabel.IsNull() && aHeightLabel.FindAttribute(TDataStd_Integer::GetID(), aHeightAttr) &&
+            !aDataLabel.IsNull()   && aDataLabel.FindAttribute(TDataStd_ByteArray::GetID(), aTextureAttr)) {
+          theWidth = aWidthAttr->Get();
+          theHeight = aHeightAttr->Get();
+          anArray = aTextureAttr->InternalArray();
+        }
+        if (!aFileLabel.IsNull() && aFileLabel.FindAttribute(TDataStd_Comment::GetID(), aFileAttr))
+          theFileName = aFileAttr->Get();
+        found = true;
+      }
+    }
+  }
+  return anArray;
+}
+
+std::list<int> GEOM_Engine::getAllTextures(int theDocID)
+{
+  std::list<int> id_list;
+
+  Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+
+  TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
+  for (; anIterator.More(); anIterator.Next()) {
+    TDF_Label aTextureLabel = anIterator.Value();
+    if (aTextureLabel.IsAttribute( GetTextureGUID())) {
+      TDF_Label anIDLabel = aTextureLabel.FindChild(TEXTURE_LABEL_ID, Standard_False);
+      Handle(TDataStd_Integer) anIdAttr;
+      if(!anIDLabel.IsNull() && anIDLabel.FindAttribute(TDataStd_Integer::GetID(), anIdAttr))
+        id_list.push_back((int)anIdAttr->Get());
+    }
+  }
+  return id_list;
+}
 
 //===========================================================================
 //                     Internal functions
@@ -709,7 +851,7 @@ bool ProcessFunction(Handle(GEOM_Function)&     theFunction,
                      TCollection_AsciiString&   theScript,
                      TCollection_AsciiString&   theAfterScript,
                      const TVariablesList&      theVariables,
-                    const bool                 theIsPublished,
+                     const bool                 theIsPublished,
                      TDF_LabelMap&              theProcessed,
                      std::set<std::string>&     theIgnoreObjs,
                      bool&                      theIsDumpCollected)
@@ -887,14 +1029,14 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
     int aNbEntries = 1;
     if( anEntry.Value( 1 ) == O_SQR_BRACKET && anEntry.Value( anEntry.Length() ) == C_SQR_BRACKET ) {
       while(anEntry.Location(aNbEntries,COMMA,1,anEntry.Length()))
-       aNbEntries++;
+        aNbEntries++;
       TCollection_AsciiString aSeparator(COMMA);
       anEntry = anEntry.Token(aSeparator.ToCString(),1);
       anEntry.Remove( 1, 1 );
       anEntry.RightAdjust();
       anEntry.LeftAdjust();
       if(MYDEBUG)
-       cout<<"Sub-entry : '" <<anEntry<<"'"<<endl;
+        cout<<"Sub-entry : '" <<anEntry<<"'"<<endl;
     }
     
     //Find variables used for object construction
@@ -905,7 +1047,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
 
     if(!aStates) {
       if(MYDEBUG)
-       cout<<"Valiables list empty!!!"<<endl;
+        cout<<"Valiables list empty!!!"<<endl;
       aCommandIndex++;
       continue;
     }
@@ -915,7 +1057,7 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
     if(MYDEBUG) {
       cout<<"Variables from SObject:"<<endl;
       for (int i = 0; i < aVariables.size();i++)
-       cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<endl;
+        cout<<"\t Variable["<<i<<"] = "<<aVariables[i].myVariable<<endl;
     }
 
     //Calculate total number of parameters
@@ -937,136 +1079,136 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
       //Replace first parameter (bettwen '(' character and first ',' character)
       if(i == aFirstParam)
       {
-       aStartPos = aCommand.Location(O_BRACKET, 1, aCommand.Length()) + 1;
-       if(aTotalNbParams - aNbEntries > 0 )
-         aEndPos = aCommand.Location(aFirstParam, COMMA, 1, aCommand.Length());
-       else
-         aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length()); 
+        aStartPos = aCommand.Location(O_BRACKET, 1, aCommand.Length()) + 1;
+        if(aTotalNbParams - aNbEntries > 0 )
+          aEndPos = aCommand.Location(aFirstParam, COMMA, 1, aCommand.Length());
+        else
+          aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length()); 
       }
       //Replace last parameter (bettwen ',' character and ')' character)
       else if(i == aTotalNbParams)
       {
-       aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
-       aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length());
+        aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
+        aEndPos = aCommand.Location(C_BRACKET, 1, aCommand.Length());
       }
       //Replace other parameters (bettwen two ',' characters)
       else if(i != aFirstParam && i != aTotalNbParams )
       {
-       aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
-       aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
+        aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
+        aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
       }
 
       if( aCommand.Value( aStartPos ) == O_SQR_BRACKET )
-       aStartPos++;
+        aStartPos++;
       if( aCommand.Value( aEndPos-1 ) == C_SQR_BRACKET )
-       aEndPos--;
+        aEndPos--;
       if ( aStartPos == aEndPos )
         continue; // PAL20889: for "[]"
 
       if(MYDEBUG) 
-       cout<<"aStartPos = "<<aStartPos<<", aEndPos = "<<aEndPos<<endl;
+        cout<<"aStartPos = "<<aStartPos<<", aEndPos = "<<aEndPos<<endl;
 
       aVar = aCommand.SubString(aStartPos, aEndPos-1);
       aVar.RightAdjust();
       aVar.LeftAdjust();
     
       if(MYDEBUG) 
-       cout<<"Variable: '"<< aVar <<"'"<<endl;
+        cout<<"Variable: '"<< aVar <<"'"<<endl;
 
       // specific case for sketcher
       if(aVar.Location( TCollection_AsciiString("Sketcher:"), 1, aVar.Length() ) != 0) {
-       Standard_Integer aNbSections = 1;
-       while( aVar.Location( aNbSections, ':', 1, aVar.Length() ) )
-         aNbSections++;
-       aNbSections--;
-
-       int aStartSectionPos = 0, aEndSectionPos = 0;
-       TCollection_AsciiString aSection, aReplacedSection;
-       for(Standard_Integer aSectionIndex = 1; aSectionIndex <= aNbSections; aSectionIndex++) {
-         aStartSectionPos = aVar.Location( aSectionIndex, ':', 1, aVar.Length() ) + 1;
-         if( aSectionIndex != aNbSections )
-           aEndSectionPos = aVar.Location( aSectionIndex + 1, ':', 1, aVar.Length() );
-         else
-           aEndSectionPos = aVar.Length();
-
-         aSection = aVar.SubString(aStartSectionPos, aEndSectionPos-1);
-         if(MYDEBUG) 
-           cout<<"aSection: "<<aSection<<endl;
-
-         Standard_Integer aNbParams = 1;
-         while( aSection.Location( aNbParams, ' ', 1, aSection.Length() ) )
-           aNbParams++;
-         aNbParams--;
-
-         int aStartParamPos = 0, aEndParamPos = 0;
-         TCollection_AsciiString aParameter, aReplacedParameter;
-         for(Standard_Integer aParamIndex = 1; aParamIndex <= aNbParams; aParamIndex++) {
-           aStartParamPos = aSection.Location( aParamIndex, ' ', 1, aSection.Length() ) + 1;
-           if( aParamIndex != aNbParams )
-             aEndParamPos = aSection.Location( aParamIndex + 1, ' ', 1, aSection.Length() );
-           else
-             aEndParamPos = aSection.Length() + 1;
-
-           aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1);
-           if(MYDEBUG) 
-             cout<<"aParameter: "<<aParameter<<endl;
-
-           if(iVar >= aVariables.size())
-             continue;
-
-           aReplacedParameter = aVariables[iVar].myVariable;
-           if(aReplacedParameter.IsEmpty()) {
-             iVar++;
-             continue;
-           }
-
-           if(aVariables[iVar].isVariable) {
-             aReplacedParameter.InsertBefore(1,"'");
-             aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'");
-           }
-
-           if(MYDEBUG) 
-             cout<<"aSection before : "<<aSection<<endl;
-           aSection.Remove(aStartParamPos, aEndParamPos - aStartParamPos);
-           aSection.Insert(aStartParamPos, aReplacedParameter);
-           if(MYDEBUG) 
-             cout<<"aSection after  : "<<aSection<<endl<<endl;
-           iVar++;
-         }
-         if(MYDEBUG) 
-           cout<<"aVar before : "<<aVar<<endl;
-         aVar.Remove(aStartSectionPos, aEndSectionPos - aStartSectionPos);
-         aVar.Insert(aStartSectionPos, aSection);
-         if(MYDEBUG) 
-           cout<<"aVar after  : "<<aVar<<endl<<endl;
-       }
-
-       if(MYDEBUG) 
-         cout<<"aCommand before : "<<aCommand<<endl;
-       aCommand.Remove(aStartPos, aEndPos - aStartPos);
-       aCommand.Insert(aStartPos, aVar);
-       if(MYDEBUG) 
-         cout<<"aCommand after  : "<<aCommand<<endl;
-
-       break;
+        Standard_Integer aNbSections = 1;
+        while( aVar.Location( aNbSections, ':', 1, aVar.Length() ) )
+          aNbSections++;
+        aNbSections--;
+
+        int aStartSectionPos = 0, aEndSectionPos = 0;
+        TCollection_AsciiString aSection, aReplacedSection;
+        for(Standard_Integer aSectionIndex = 1; aSectionIndex <= aNbSections; aSectionIndex++) {
+          aStartSectionPos = aVar.Location( aSectionIndex, ':', 1, aVar.Length() ) + 1;
+          if( aSectionIndex != aNbSections )
+            aEndSectionPos = aVar.Location( aSectionIndex + 1, ':', 1, aVar.Length() );
+          else
+            aEndSectionPos = aVar.Length();
+
+          aSection = aVar.SubString(aStartSectionPos, aEndSectionPos-1);
+          if(MYDEBUG) 
+            cout<<"aSection: "<<aSection<<endl;
+
+          Standard_Integer aNbParams = 1;
+          while( aSection.Location( aNbParams, ' ', 1, aSection.Length() ) )
+            aNbParams++;
+          aNbParams--;
+
+          int aStartParamPos = 0, aEndParamPos = 0;
+          TCollection_AsciiString aParameter, aReplacedParameter;
+          for(Standard_Integer aParamIndex = 1; aParamIndex <= aNbParams; aParamIndex++) {
+            aStartParamPos = aSection.Location( aParamIndex, ' ', 1, aSection.Length() ) + 1;
+            if( aParamIndex != aNbParams )
+              aEndParamPos = aSection.Location( aParamIndex + 1, ' ', 1, aSection.Length() );
+            else
+              aEndParamPos = aSection.Length() + 1;
+
+            aParameter = aSection.SubString(aStartParamPos, aEndParamPos-1);
+            if(MYDEBUG) 
+              cout<<"aParameter: "<<aParameter<<endl;
+
+            if(iVar >= aVariables.size())
+              continue;
+
+            aReplacedParameter = aVariables[iVar].myVariable;
+            if(aReplacedParameter.IsEmpty()) {
+              iVar++;
+              continue;
+            }
+
+            if(aVariables[iVar].isVariable) {
+              aReplacedParameter.InsertBefore(1,"'");
+              aReplacedParameter.InsertAfter(aReplacedParameter.Length(),"'");
+            }
+
+            if(MYDEBUG) 
+              cout<<"aSection before : "<<aSection<<endl;
+            aSection.Remove(aStartParamPos, aEndParamPos - aStartParamPos);
+            aSection.Insert(aStartParamPos, aReplacedParameter);
+            if(MYDEBUG) 
+              cout<<"aSection after  : "<<aSection<<endl<<endl;
+            iVar++;
+          }
+          if(MYDEBUG) 
+            cout<<"aVar before : "<<aVar<<endl;
+          aVar.Remove(aStartSectionPos, aEndSectionPos - aStartSectionPos);
+          aVar.Insert(aStartSectionPos, aSection);
+          if(MYDEBUG) 
+            cout<<"aVar after  : "<<aVar<<endl<<endl;
+        }
+
+        if(MYDEBUG) 
+          cout<<"aCommand before : "<<aCommand<<endl;
+        aCommand.Remove(aStartPos, aEndPos - aStartPos);
+        aCommand.Insert(aStartPos, aVar);
+        if(MYDEBUG) 
+          cout<<"aCommand after  : "<<aCommand<<endl;
+
+        break;
       } // end of specific case for sketcher
 
       //If parameter is entry or 'None', skip it
       if(theVariables.find(aVar) != theVariables.end() || aVar.Search(":") != -1 || aVar == PY_NULL)
-       continue;
+        continue;
 
       if(iVar >= aVariables.size())
-       continue;
+        continue;
 
       aReplacedVar = aVariables[iVar].myVariable;
       if(aReplacedVar.IsEmpty()) {
-       iVar++;
-       continue;
+        iVar++;
+        continue;
       }
 
       if(aVariables[iVar].isVariable) {
-       aReplacedVar.InsertBefore(1,"\"");
-       aReplacedVar.InsertAfter(aReplacedVar.Length(),"\"");
+        aReplacedVar.InsertBefore(1,"\"");
+        aReplacedVar.InsertAfter(aReplacedVar.Length(),"\"");
       }
 
       aCommand.Remove(aStartPos, aEndPos - aStartPos);
@@ -1092,9 +1234,9 @@ void ReplaceVariables(TCollection_AsciiString& theCommand,
  */
 //=============================================================================
 void ReplaceEntriesByNames (TCollection_AsciiString&                  theScript,
-                           Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
-                           const bool                                theIsPublished,
-                           Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
+                            Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                            const bool                                theIsPublished,
+                            Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
                             TColStd_SequenceOfAsciiString&            theObjListToPublish)
 {
   Handle(TColStd_HSequenceOfInteger) aSeq = FindEntries(theScript);
@@ -1164,10 +1306,13 @@ void ReplaceEntriesByNames (TCollection_AsciiString&                  theScript,
  *  AddObjectColors: Add color to objects
  */
 //=============================================================================
-void AddObjectColors (const Handle(TDocStd_Document)&                 theDoc,
-                     TCollection_AsciiString&                        theScript,
-                     const Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
+void AddObjectColors (int                                             theDocID,
+                      TCollection_AsciiString&                        theScript,
+                      const Resource_DataMapOfAsciiStringAsciiString& theObjectNames)
 {
+  GEOM_Engine* engine = GEOM_Engine::GetEngine();
+  Handle(TDocStd_Document) aDoc = engine->GetDocument(theDocID);
+
   Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString anEntryToNameIt;
   for (anEntryToNameIt.Initialize( theObjectNames );
        anEntryToNameIt.More();
@@ -1177,7 +1322,7 @@ void AddObjectColors (const Handle(TDocStd_Document)&                 theDoc,
     const TCollection_AsciiString& aName = anEntryToNameIt.Value();
 
     TDF_Label L;
-    TDF_Tool::Label( theDoc->GetData(), aEntry, L );
+    TDF_Tool::Label( aDoc->GetData(), aEntry, L );
     if ( L.IsNull() )
       continue;
 
@@ -1200,6 +1345,108 @@ void AddObjectColors (const Handle(TDocStd_Document)&                 theDoc,
       aCommand += aName + ".SetColor(SALOMEDS.Color(" + aColor.R + "," + aColor.G + "," + aColor.B + "))";
       theScript += aCommand.ToCString();
     }
+    
+    Aspect_TypeOfMarker aMarkerType = obj->GetMarkerType();
+    if (aMarkerType >= Aspect_TOM_POINT && aMarkerType < Aspect_TOM_USERDEFINED) {
+      TCollection_AsciiString aCommand( "\n\t" );
+      aCommand += aName + ".SetMarkerStd(";
+      switch (aMarkerType) {
+      case Aspect_TOM_POINT:   aCommand += "GEOM.MT_POINT";   break;
+      case Aspect_TOM_PLUS:    aCommand += "GEOM.MT_PLUS";    break;
+      case Aspect_TOM_STAR:    aCommand += "GEOM.MT_STAR";    break;
+      case Aspect_TOM_O:       aCommand += "GEOM.MT_O";       break;
+      case Aspect_TOM_X:       aCommand += "GEOM.MT_X";       break;
+      case Aspect_TOM_O_POINT: aCommand += "GEOM.MT_O_POINT"; break;
+      case Aspect_TOM_O_PLUS:  aCommand += "GEOM.MT_O_PLUS";  break;
+      case Aspect_TOM_O_STAR:  aCommand += "GEOM.MT_O_STAR";  break;
+      case Aspect_TOM_O_X:     aCommand += "GEOM.MT_O_X";     break;
+      case Aspect_TOM_BALL:    aCommand += "GEOM.MT_BALL";    break;
+      case Aspect_TOM_RING1:   aCommand += "GEOM.MT_RING1";   break;
+      case Aspect_TOM_RING2:   aCommand += "GEOM.MT_RING2";   break;
+      case Aspect_TOM_RING3:   aCommand += "GEOM.MT_RING3";   break;
+      default:                 aCommand += "GEOM.MT_NONE";    break; // just for completeness, should not get here
+      }
+      aCommand += ", ";
+      int aSize = (int)( obj->GetMarkerSize()/0.5 ) - 1;
+      switch (aSize) {
+      case  1: aCommand += "GEOM.MS_10";   break;
+      case  2: aCommand += "GEOM.MS_15";   break;
+      case  3: aCommand += "GEOM.MS_20";   break;
+      case  4: aCommand += "GEOM.MS_25";   break;
+      case  5: aCommand += "GEOM.MS_30";   break;
+      case  6: aCommand += "GEOM.MS_35";   break;
+      case  7: aCommand += "GEOM.MS_40";   break;
+      case  8: aCommand += "GEOM.MS_45";   break;
+      case  9: aCommand += "GEOM.MS_50";   break;
+      case 10: aCommand += "GEOM.MS_55";   break;
+      case 11: aCommand += "GEOM.MS_60";   break;
+      case 12: aCommand += "GEOM.MS_65";   break;
+      case 13: aCommand += "GEOM.MS_70";   break;
+      default: aCommand += "GEOM.MS_NONE"; break;
+      }
+      aCommand += ")";
+      theScript += aCommand.ToCString();
+    }
+    else if (aMarkerType == Aspect_TOM_USERDEFINED) {
+      int aMarkerTextureID = obj->GetMarkerTexture();
+      if (aMarkerTextureID >= 0) {
+        TCollection_AsciiString aCommand( "\n\t" );
+        aCommand += aName + ".SetMarkerTexture(texture_map[";
+        aCommand += aMarkerTextureID;
+        aCommand += "])";
+        theScript += aCommand.ToCString();
+      }
+    }
+  }
+}
+
+static TCollection_AsciiString pack_data(const Handle(TDataStd_HArray1OfByte)& aData )
+{
+  TCollection_AsciiString stream;
+  if (!aData.IsNull()) {
+    for (Standard_Integer i = aData->Lower(); i <= aData->Upper(); i++) {
+      Standard_Byte byte = aData->Value(i);
+      TCollection_AsciiString strByte = "";
+      for (int j = 0; j < 8; j++)
+        strByte.Prepend((byte & (1<<j)) ? "1" : "0");
+      stream += strByte;
+    }
+  }
+  return stream;
+}
+
+void AddTextures (int theDocID, TCollection_AsciiString& theScript)
+{
+  GEOM_Engine* engine = GEOM_Engine::GetEngine();
+  std::list<int> allTextures = engine->getAllTextures(theDocID);
+  std::list<int>::const_iterator it;
+
+  if (allTextures.size() > 0) {
+    theScript += "\n\ttexture_map = {}\n";
+    
+    for (it = allTextures.begin(); it != allTextures.end(); ++it) {
+      if (*it <= 0) continue;
+      Standard_Integer aWidth, aHeight;
+      TCollection_AsciiString aFileName;
+      Handle(TDataStd_HArray1OfByte) aTexture = engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName);
+      if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) {
+        TCollection_AsciiString aCommand = "\n\t";
+        aCommand += "texture_map["; aCommand += *it; aCommand += "] = ";
+        if (aFileName != "" ) {
+          aCommand += "geompy.LoadTexture(\"";
+          aCommand += aFileName.ToCString();
+          aCommand += "\")";
+        }
+        else {
+          aCommand += "geompy.AddTexture(";
+          aCommand += aWidth; aCommand += ", "; aCommand += aHeight; aCommand += ", \"";
+          aCommand += pack_data(aTexture);
+          aCommand += "\")";
+        }
+        theScript += aCommand;
+      }
+    }
+    theScript += "\n";
   }
 }
 
@@ -1209,13 +1456,13 @@ void AddObjectColors (const Handle(TDocStd_Document)&                 theDoc,
  */
 //=============================================================================
 void PublishObject (const TCollection_AsciiString&                  theEntry,
-                   const TCollection_AsciiString&                  theName,
-                   const Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
-                   const Resource_DataMapOfAsciiStringAsciiString& theEntry2StEntry,
-                   const Resource_DataMapOfAsciiStringAsciiString& theStEntry2Entry,
-                   const Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
-                   std::map< int, std::string >&                   theEntryToCommandMap,
-                   std::set<std::string>&                          theMapOfPublished)
+                    const TCollection_AsciiString&                  theName,
+                    const Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                    const Resource_DataMapOfAsciiStringAsciiString& theEntry2StEntry,
+                    const Resource_DataMapOfAsciiStringAsciiString& theStEntry2Entry,
+                    const Resource_DataMapOfAsciiStringAsciiString& theEntryToBadName,
+                    std::map< int, std::string >&                   theEntryToCommandMap,
+                    std::set<std::string>&                          theMapOfPublished)
 {
   if ( !theEntry2StEntry.IsBound( theEntry ))
     return; // was not published
index c901123b604ff4923451d08bdde802b31c9f3804..25b661d1554ee8a2388409e4510267a01fa374b5 100644 (file)
@@ -37,6 +37,8 @@
 #include <list>
 #include <vector>
 
+class Handle_TDataStd_HArray1OfByte;
+
 struct TVariable{
   TCollection_AsciiString myVariable;
   bool isVariable;
@@ -80,7 +82,7 @@ class GEOM_Engine
   Standard_EXPORT static GEOM_Engine* GetEngine();   
 
   //Returns the OCAF document by its ID, if document doesn't exists it will be created
-  Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID);
+  Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID, bool force=true);
 
   //Returns the ID of the given OCAF document
   Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument);
@@ -89,7 +91,7 @@ class GEOM_Engine
   Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; }
 
   //Returns a pointer to GEOM_Object defined by a document and the entry
-  Standard_EXPORT Handle(GEOM_Object) GetObject(int theDocID, char* theEntry);
+  Standard_EXPORT Handle(GEOM_Object) GetObject(int theDocID, char* theEntry, bool force=true);
   
   //Adds a new object of the type theType in the OCAF document
   Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType);
@@ -117,19 +119,31 @@ class GEOM_Engine
 
   //Adds a new sub shape object of the MainShape object
   Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape, 
-                                 Handle(TColStd_HArray1OfInteger) theIndices,
-                                 bool isStandaloneOperation = false);
+                                  Handle(TColStd_HArray1OfInteger) theIndices,
+                                  bool isStandaloneOperation = false);
 
   Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID, 
-                                    Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+                                     Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
                                      TVariablesList theVariables,
-                                    bool isPublished, 
-                                    bool& aValidScript);
+                                     bool isPublished, 
+                                     bool& aValidScript);
 
   Standard_EXPORT const char* GetDumpName (const char* theStudyEntry) const;
 
   Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
 
+  Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight,
+                                 const Handle(TDataStd_HArray1OfByte)& theTexture,
+                                 const TCollection_AsciiString& theFileName = "");
+
+  Standard_EXPORT Handle(TDataStd_HArray1OfByte) getTexture(int theDocID, int theTextureID,
+                                                            int& theWidth, int& theHeight,
+                                                            TCollection_AsciiString& theFileName);
+
+  Standard_EXPORT std::list<int> getAllTextures(int theDocID);
+
+  static const Standard_GUID& GetTextureGUID();
+
  protected:
   Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);       
   
index d10bd9daf3f5b817f017d3b82e13fd54fcc90127..d9d1c321e45ab97b46f4f35912c8855fec5e3989 100644 (file)
@@ -727,10 +727,10 @@ Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function",
-                                                        sizeof(GEOM_Function),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOM_Function),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index b2ca175f4d84ac9307826130cd1811bff54c4cb2..fc2170a8612e7ca8c488741c3a90da6023f3ada3 100644 (file)
 #include <TDocStd_Owner.hxx>
 #include <TDocStd_Document.hxx>
 #include <TDataStd_Integer.hxx>
+#include <TDataStd_Real.hxx>
 #include <TDataStd_ChildNodeIterator.hxx>
 #include <TDataStd_UAttribute.hxx>
 #include <TDataStd_Name.hxx>
 #include <TDataStd_Comment.hxx>
 #include <TDataStd_RealArray.hxx>
+#include <TDataStd_ByteArray.hxx>
 #include <TColStd_HArray1OfReal.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <TopExp.hxx>
 
 #define FUNCTION_LABEL(theNb) (_label.FindChild(1).FindChild((theNb)))
-#define TYPE_LABEL 2
-#define FREE_LABEL 3
-#define TIC_LABEL  4
+#define TYPE_LABEL       2
+#define FREE_LABEL       3
+#define TIC_LABEL        4
 #define COLOR_LABEL      5
 #define AUTO_COLOR_LABEL 6
+#define MARKER_LABEL     7
+
+#define MARKER_LABEL_TYPE 1
+#define MARKER_LABEL_SIZE 2
+#define MARKER_LABEL_ID   3
 
 //=======================================================================
 //function : GetObjectID
@@ -140,8 +147,14 @@ Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
  */
 //=============================================================================
 GEOM_Object::GEOM_Object(TDF_Label& theEntry)
-: _label(theEntry), _ior("")
+  : _label(theEntry), _ior(""), _docID(-1)
 {
+  Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
+  if(!aDoc.IsNull()) {
+    Handle(TDataStd_Integer) anID;
+    if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
+  }
+
   if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
     _root = TDataStd_TreeNode::Set(theEntry);
 }
@@ -152,8 +165,14 @@ GEOM_Object::GEOM_Object(TDF_Label& theEntry)
  */
 //=============================================================================
 GEOM_Object::GEOM_Object(TDF_Label& theEntry, int theType)
-: _label(theEntry), _ior("")
+: _label(theEntry), _ior(""), _docID(-1)
 {
+  Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
+  if(!aDoc.IsNull()) {
+    Handle(TDataStd_Integer) anID;
+    if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
+  }
+
   theEntry.ForgetAllAttributes(Standard_True);
 
   if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
@@ -255,13 +274,7 @@ void GEOM_Object::IncrementTic()
 //=============================================================================
 int GEOM_Object::GetDocID()
 {
-  Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
-  if(aDoc.IsNull()) return -1;
-
-  Handle(TDataStd_Integer) anID;
-  if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return -1;
-
-  return anID->Get();
+  return _docID;
 }
 
 
@@ -368,6 +381,96 @@ CORBA::Boolean GEOM_Object::GetAutoColor()
   return anAutoColor->Get();
 }
 
+//=============================================================================
+/*!
+ *  SetMarkerStd
+ */
+//=============================================================================
+void GEOM_Object::SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize)
+{
+  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL);
+  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_TYPE), (int)theType);
+  TDataStd_Real::Set(aMarkerLabel.FindChild(MARKER_LABEL_SIZE), theSize);
+}
+  
+//=============================================================================
+/*!
+ *  SetMarkerTexture
+ */
+//=============================================================================
+void GEOM_Object::SetMarkerTexture(int theTextureId)
+{
+  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL);
+  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_TYPE), (int)Aspect_TOM_USERDEFINED);
+  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_ID),   theTextureId);
+}
+
+//=============================================================================
+/*!
+ *  GetMarkerType
+ */
+//=============================================================================
+Aspect_TypeOfMarker GEOM_Object::GetMarkerType()
+{
+  Standard_Integer aType = -1;
+  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
+  if(!aMarkerLabel.IsNull()) {
+    TDF_Label aTypeLabel = aMarkerLabel.FindChild(MARKER_LABEL_TYPE, Standard_False);
+    Handle(TDataStd_Integer) aTypeAttr;
+    if (!aTypeLabel.IsNull() && aTypeLabel.FindAttribute(TDataStd_Integer::GetID(), aTypeAttr))
+      aType = aTypeAttr->Get();
+  }
+  return (Aspect_TypeOfMarker)aType;
+}
+
+//=============================================================================
+/*!
+ *  GetMarkerSize
+ */
+//=============================================================================
+double GEOM_Object::GetMarkerSize()
+{
+  Standard_Real aSize = 0.;
+  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
+  if(!aMarkerLabel.IsNull()) {
+    TDF_Label aSizeLabel = aMarkerLabel.FindChild(MARKER_LABEL_SIZE, Standard_False);
+    Handle(TDataStd_Real) aSizeAttr;
+    if (!aSizeLabel.IsNull() && aSizeLabel.FindAttribute(TDataStd_Real::GetID(), aSizeAttr))
+      aSize = aSizeAttr->Get();
+  }
+  return aSize;
+}
+
+//=============================================================================
+/*!
+ *  GetMarkerTexture
+ */
+//=============================================================================
+int GEOM_Object::GetMarkerTexture()
+{
+  Standard_Integer anId = 0;
+  if ( GetMarkerType() == Aspect_TOM_USERDEFINED) {
+    TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
+    if(!aMarkerLabel.IsNull()) {
+      TDF_Label aTypeLabel = aMarkerLabel.FindChild(MARKER_LABEL_ID, Standard_False);
+      Handle(TDataStd_Integer) anIdAttr;
+      if (!aTypeLabel.IsNull() && aTypeLabel.FindAttribute(TDataStd_Integer::GetID(), anIdAttr))
+        anId = anIdAttr->Get();
+    }
+  }
+  return anId;
+}
+
+//=============================================================================
+/*!
+ *  SetAuxData
+ */
+//=============================================================================
+void GEOM_Object::UnsetMarker()
+{
+  SetMarkerStd((Aspect_TypeOfMarker)-1, 0.);
+}
+
 //=============================================================================
 /*!
  *  SetAuxData
@@ -568,10 +671,10 @@ Standard_EXPORT Handle_Standard_Type& GEOM_Object_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOM_Object",
-                                                        sizeof(GEOM_Object),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOM_Object),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
   return _aType;
 }
 
index dd2f73ea2d2e66b3a34e5b7f46a100c3351783e2..c79f827e1de78bc5459d5da8e37182acd793ebfd 100644 (file)
@@ -55,6 +55,9 @@
 #ifndef _TCollection_AsciiString_HeaderFile
 #include <TCollection_AsciiString.hxx>
 #endif
+#ifndef _Aspect_TypeOfMarker_HeaderFile
+#include <Aspect_TypeOfMarker.hxx>
+#endif
 
 #include "SALOMEconfig.h"
 #include CORBA_SERVER_HEADER(SALOMEDS)
@@ -215,6 +218,24 @@ class GEOM_Object : public MMgt_TShared
   //Returns a flag of auto color mode of this GEOM_Object
   Standard_EXPORT CORBA::Boolean GetAutoColor();
 
+  //Sets predefined point marker texture
+  Standard_EXPORT void SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize);
+  
+  //Sets custom point marker texture
+  Standard_EXPORT void SetMarkerTexture(int theTextureId);
+
+  //Gets point marker type
+  Standard_EXPORT Aspect_TypeOfMarker GetMarkerType();
+
+  //Gets point marker scale factor / size
+  Standard_EXPORT double GetMarkerSize();
+
+  //Gets custom marker texture ID
+  Standard_EXPORT int GetMarkerTexture();
+
+  //Unsets point marker
+  Standard_EXPORT void UnsetMarker();
+
   //Sets an auxiliary data
   Standard_EXPORT void SetAuxData(const char* theData);
 
@@ -279,6 +300,7 @@ class GEOM_Object : public MMgt_TShared
   TDF_Label                 _label;
   TCollection_AsciiString   _ior;
   TCollection_AsciiString   _parameters;
+  int                       _docID;
 };
 
 #endif
index 4967c088b67db1b19c77c65d9b9111bd019069c5..f38f1e622dccf65a09a9f40f19efcb52b9c87fd4 100644 (file)
@@ -60,11 +60,11 @@ bool GEOM_Solver::ComputeFunction(Handle(GEOM_Function) theFunction)
       
   Handle(TFunction_Driver) aDriver;
   if(!TFunction_DriverTable::Get()->FindDriver(aGUID, aDriver)) return false;
-         
+          
   aDriver->Init(theFunction->GetEntry());
-           
+            
   TFunction_Logbook aLog;
   if(aDriver->Execute(aLog) == 0) return false;
-               
+                
   return true;     
 }
index 12d62e5a1cf5e0e25f0e33d2c58e3b69eb0fbe18..39aa38208ba24a06de8066fcac33b49b7b90c496 100644 (file)
@@ -101,11 +101,11 @@ Standard_Integer GEOM_SubShapeDriver::Execute(TFunction_Logbook& log) const
       B.MakeCompound(aCompound);
 
       for (int i = anIndices->Lower(); i<= anIndices->Upper(); i++) {
-       if (aMapOfShapes.Extent() < anIndices->Value(i))
-         Standard_NullObject::Raise("GEOM_SubShapeDriver::Execute: Index is out of range");
-       TopoDS_Shape aSubShape = aMapOfShapes.FindKey(anIndices->Value(i));
-       if (aSubShape.IsNull()) continue;
-       B.Add(aCompound,aSubShape);
+        if (aMapOfShapes.Extent() < anIndices->Value(i))
+          Standard_NullObject::Raise("GEOM_SubShapeDriver::Execute: Index is out of range");
+        TopoDS_Shape aSubShape = aMapOfShapes.FindKey(anIndices->Value(i));
+        if (aSubShape.IsNull()) continue;
+        B.Add(aCompound,aSubShape);
       }
 
       aShape = aCompound;
@@ -145,10 +145,10 @@ Standard_EXPORT Handle_Standard_Type& GEOM_SubShapeDriver_Type_()
 
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOM_SubShapeDriver",
-                                                        sizeof(GEOM_SubShapeDriver),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOM_SubShapeDriver),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
index 34b284b559bed7396a0a004b899653e27065f1eb..f7d150c6c94f0c1e5d9b29e32c023fd8a4b4f288 100755 (executable)
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       GEOMAlgo_Splitter.cxx
-// Created:    
-// Author:     Peter KURNEV
-//             <pkv@irinox>
-//
+//  File:   GEOMAlgo_Splitter.cxx
+//  Author: Peter KURNEV
+
 #include <GEOMAlgo_Splitter.ixx>
 
 #include <TopAbs_ShapeEnum.hxx>
 #include <BOP_CorrectTolerances.hxx>
 
 
-static 
-  void TreatCompound(const TopoDS_Shape& aC, 
-                    TopTools_ListOfShape& aLSX);
+static
+  void TreatCompound(const TopoDS_Shape& aC,
+                     TopTools_ListOfShape& aLSX);
 
 //=======================================================================
-//function : 
-//purpose  : 
+//function :
+//purpose  :
 //=======================================================================
   GEOMAlgo_Splitter::GEOMAlgo_Splitter()
 :
@@ -62,14 +60,14 @@ static
 }
 //=======================================================================
 //function : ~
-//purpose  : 
+//purpose  :
 //=======================================================================
   GEOMAlgo_Splitter::~GEOMAlgo_Splitter()
 {
 }
 //=======================================================================
 //function : AddToolCompound
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::AddToolCompound(const TopoDS_Shape& theShape)
 {
@@ -83,7 +81,7 @@ static
 }
 //=======================================================================
 //function : AddTool
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::AddTool(const TopoDS_Shape& theShape)
 {
@@ -95,7 +93,7 @@ static
 }
 //=======================================================================
 //function : Tools
-//purpose  : 
+//purpose  :
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_Splitter::Tools()const
 {
@@ -103,15 +101,15 @@ static
 }
 //=======================================================================
 //function : SetLimit
-//purpose  : 
+//purpose  :
 //=======================================================================
-  void GEOMAlgo_Splitter::SetLimit(const TopAbs_ShapeEnum aLimit) 
+  void GEOMAlgo_Splitter::SetLimit(const TopAbs_ShapeEnum aLimit)
 {
   myLimit=aLimit;
 }
 //=======================================================================
 //function : Limit
-//purpose  : 
+//purpose  :
 //=======================================================================
   TopAbs_ShapeEnum GEOMAlgo_Splitter::Limit()const
 {
@@ -119,7 +117,7 @@ static
 }
 //=======================================================================
 //function : SetLimitMode
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode)
 {
@@ -127,7 +125,7 @@ static
 }
 //=======================================================================
 //function : LimitMode
-//purpose  : 
+//purpose  :
 //=======================================================================
   Standard_Integer GEOMAlgo_Splitter::LimitMode()const
 {
@@ -135,7 +133,7 @@ static
 }
 //=======================================================================
 //function : Clear
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::Clear()
 {
@@ -146,7 +144,7 @@ static
 }
 //=======================================================================
 //function : BuildResult
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
 {
@@ -163,26 +161,26 @@ static
     aType=aS.ShapeType();
     if (aType==theType && !myMapTools.Contains(aS)) {
       if (myImages.HasImage(aS)) {
-       const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
-       aItIm.Initialize(aLSIm);
-       for (; aItIm.More(); aItIm.Next()) {
-         const TopoDS_Shape& aSIm=aItIm.Value();
-         if (aM.Add(aSIm)) {
-           aBB.Add(myShape, aSIm);
-         }
-       }
+        const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+        aItIm.Initialize(aLSIm);
+        for (; aItIm.More(); aItIm.Next()) {
+          const TopoDS_Shape& aSIm=aItIm.Value();
+          if (aM.Add(aSIm)) {
+            aBB.Add(myShape, aSIm);
+          }
+        }
       }
       else {
-       if (aM.Add(aS)) {
-         aBB.Add(myShape, aS);
-       }
+        if (aM.Add(aS)) {
+          aBB.Add(myShape, aS);
+        }
       }
     }
   }
 }
 //=======================================================================
 //function : PostTreat
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_Splitter::PostTreat()
 {
@@ -200,7 +198,7 @@ static
       const TopoDS_Shape& aS=aMx(i);
       aBB.Add(aC, aS);
     }
-    //modified by NIZNHY-PKV Thu Feb 15 17:09:32 2007f
+    //
     if (myLimitMode) {
       Standard_Integer iType, iLimit, iTypeX;
       TopAbs_ShapeEnum aType, aTypeX;
@@ -208,63 +206,77 @@ static
       TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;
       TopTools_MapOfShape  aM;
       //
-      iLimit=(Standard_Integer)myLimit; 
+      iLimit=(Standard_Integer)myLimit;
       //
       // 1. Collect the shapes to process aLSP
       aIt.Initialize(myShapes);
       for (; aIt.More(); aIt.Next()) {
-       const TopoDS_Shape& aS=aIt.Value();
-       if (myMapTools.Contains(aS)) {
-         continue;
-       }
-       //
-       aType=aS.ShapeType();
-       iType=(Standard_Integer)aType;
-       //
-       if (iType>iLimit) {
-         aLSP.Append(aS);
-       }
-       //
-       else if (aType==TopAbs_COMPOUND) {
-         aLSX.Clear();
-         //
-         TreatCompound(aS, aLSX);
-         //
-         aItX.Initialize(aLSX);
-         for (; aItX.More(); aItX.Next()) {
-           const TopoDS_Shape& aSX=aItX.Value();
-           aTypeX=aSX.ShapeType();
-           iTypeX=(Standard_Integer)aTypeX;
-           //
-           if (iTypeX>iLimit) {
-             aLSP.Append(aSX);
-           }
-         }
-       }
+        const TopoDS_Shape& aS=aIt.Value();
+        if (myMapTools.Contains(aS)) {
+          continue;
+        }
+        //
+        aType=aS.ShapeType();
+        iType=(Standard_Integer)aType;
+        //
+        if (iType>iLimit) {
+          aLSP.Append(aS);
+        }
+        //
+        else if (aType==TopAbs_COMPOUND) {
+          aLSX.Clear();
+          //
+          TreatCompound(aS, aLSX);
+          //
+          aItX.Initialize(aLSX);
+          for (; aItX.More(); aItX.Next()) {
+            const TopoDS_Shape& aSX=aItX.Value();
+            aTypeX=aSX.ShapeType();
+            iTypeX=(Standard_Integer)aTypeX;
+            //
+            if (iTypeX>iLimit) {
+              aLSP.Append(aSX);
+            }
+          }
+        }
       }// for (; aIt.More(); aIt.Next()) {
       //
+      //modified by NIZNHY-PKV Fri Oct 30 11:07:08 2009 f
+      aMx.Clear();
+      TopExp::MapShapes(aC, aMx);
+      //modified by NIZNHY-PKV Fri Oct 30 11:12:30 2009t
+      //
       // 2. Add them to aC
       aIt.Initialize(aLSP);
       for (; aIt.More(); aIt.Next()) {
-       const TopoDS_Shape& aS=aIt.Value();
-       if (myImages.HasImage(aS)) {
-         const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
-         aItIm.Initialize(aLSIm);
-         for (; aItIm.More(); aItIm.Next()) {
-           const TopoDS_Shape& aSIm=aItIm.Value();
-           if (aM.Add(aSIm)) {
-             aBB.Add(aC, aSIm);
-           }
-         }
-       }
-       else {
-         if (aM.Add(aS)) {
-           aBB.Add(aC, aS);
-         }
-       }
+        const TopoDS_Shape& aS=aIt.Value();
+        if (myImages.HasImage(aS)) {
+          const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+          aItIm.Initialize(aLSIm);
+          for (; aItIm.More(); aItIm.Next()) {
+            const TopoDS_Shape& aSIm=aItIm.Value();
+            if (aM.Add(aSIm)) {
+              //modified by NIZNHY-PKV Fri Oct 30 11:09:57 2009f
+              if (!aMx.Contains(aSIm)) {
+                aBB.Add(aC, aSIm);
+              }
+              //aBB.Add(aC, aSIm);
+              //modified by NIZNHY-PKV Fri Oct 30 11:10:02 2009
+            }
+          }
+        }
+        else {
+          if (aM.Add(aS)) {
+            //modified by NIZNHY-PKV Fri Oct 30 11:10:46 2009f
+            if (!aMx.Contains(aS)) {
+              aBB.Add(aC, aS);
+            }
+            //aBB.Add(aC, aS);
+            //modified by NIZNHY-PKV Fri Oct 30 11:11:00 2009t
+          }
+        }
       }
     }// if (myLimitMode) {
-    //modified by NIZNHY-PKV Thu Feb 15 17:09:34 2007t
     myShape=aC;
   }//if (myLimit!=TopAbs_SHAPE) {
   //
@@ -272,10 +284,10 @@ static
 }
 //=======================================================================
 //function : TreatCompound
-//purpose  : 
+//purpose  :
 //=======================================================================
-void TreatCompound(const TopoDS_Shape& aC1, 
-                  TopTools_ListOfShape& aLSX)
+void TreatCompound(const TopoDS_Shape& aC1,
+                   TopTools_ListOfShape& aLSX)
 {
   Standard_Integer aNbC1;
   TopAbs_ShapeEnum aType;
@@ -292,14 +304,14 @@ void TreatCompound(const TopoDS_Shape& aC1,
       //
       aItC.Initialize(aC);
       for (; aItC.More(); aItC.Next()) {
-       const TopoDS_Shape& aS=aItC.Value();
-       aType=aS.ShapeType();
-       if (aType==TopAbs_COMPOUND) {
-         aLC1.Append(aS);
-       }
-       else {
-         aLSX.Append(aS);
-       }
+        const TopoDS_Shape& aS=aItC.Value();
+        aType=aS.ShapeType();
+        if (aType==TopAbs_COMPOUND) {
+          aLC1.Append(aS);
+        }
+        else {
+          aLSX.Append(aS);
+        }
       }
     }
     //
@@ -318,7 +330,7 @@ void TreatCompound(const TopoDS_Shape& aC1,
 }
 //
 // myErrorStatus
-// 
+//
 // 0  - Ok
 // 1  - The object is just initialized
 // 2  - PaveFiller is failed
index 1bb44f33e9c84c0abf2519c32059519734eebcfc..70c5ebd6def54e10bb42cb80d263fe8c152b2c19 100755 (executable)
 #include <TColStd_MapOfInteger.hxx>
 #include <TCollection_AsciiString.hxx>
 
+//To disable automatic genericobj management, the following line should be commented.
+//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
+//#define WITHGENERICOBJ
+
 //================================================================
 // Function : getActiveView
 // Purpose  : Get active view window, returns 0 if no open study frame
@@ -833,10 +837,12 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
            addInStudy( obj, aName.toLatin1().constData() );
             // updateView=false
            display( obj, false );
+#ifdef WITHGENERICOBJ
            // obj has been published in study. Its refcount has been incremented.
            // It is safe to decrement its refcount
            // so that it will be destroyed when the entry in study will be removed
            obj->Destroy();
+#endif
          }
          else {
             // asv : fix of PAL6454. If publish==false, then the original shape
@@ -1078,23 +1084,23 @@ void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>
 
   GEOM::GEOM_IGroupOperations_var anOp = getGeomEngine()->GetIGroupOperations( getStudyId() );
  
-  for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ )
-    {
-      if ( !anOp->_is_nil() ) {
-       GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() );
-       if ( !aFatherObj->_is_nil() ) { 
-       GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() );
-      
-       //Add Object to study if its not exist
-       if ( aFindedObject == GEOM::GEOM_Object::_nil() )
-         GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
-                                               it.value(), it.key().toLatin1().data(), aFatherObj );
-       }
-      }
-      else {
-       //cout << " anOperations is NULL! " << endl;
+  for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ ) {
+    if ( !anOp->_is_nil() ) {
+      GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() );
+      if ( !aFatherObj->_is_nil() ) {
+        std::string aFatherEntry = getEntry( aFatherObj );      
+        if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191
+          GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() );
+          //Add Object to study if its not exist
+          if ( aFindedObject == GEOM::GEOM_Object::_nil() )
+            GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
+                                                  it.value(), it.key().toLatin1().data(), aFatherObj );
+        }
       }
+    } else {
+      //cout << " anOperations is NULL! " << endl;
     }
-}  
+  }
+}
 
   
index 593d80550a2df004769b386ea02693748e394b04..a3e9d133b849598d95f10c653bb678c06271221c 100644 (file)
@@ -83,6 +83,8 @@ QVariant GEOMGUI_Selection::parameter( const int ind, const QString& p ) const
 //  else
   if( p == "type" )
     return QVariant( typeName( ind ) );
+  if( p == "typeid" )
+    return QVariant( typeId( ind ) );
   else if ( p == "displaymode" )
     return QVariant( displayMode( ind ) );
   else if ( p == "isAutoColor" )
@@ -112,6 +114,15 @@ QString GEOMGUI_Selection::typeName( const int index ) const
   return "Unknown";
 }
 
+int GEOMGUI_Selection::typeId( const int index ) const
+{
+  int aType = -1;
+  GEOM::GEOM_Object_var anObj = getObject( index );
+  if ( !CORBA::is_nil( anObj ) )
+    aType = anObj->GetType();
+  return aType;
+}
+
 bool GEOMGUI_Selection::isVisible( const int index ) const
 {
   GEOM::GEOM_Object_var obj = getObject( index );
@@ -195,28 +206,29 @@ bool GEOMGUI_Selection::isVectorsMode( const int index ) const
     SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
     if ( prs ) {
       if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
-       SOCC_Prs* occPrs = (SOCC_Prs*) prs;
-       AIS_ListOfInteractive lst;
-       occPrs->GetObjects( lst );
-       if ( lst.Extent() ) {
-         Handle(AIS_InteractiveObject) io = lst.First();
-         if ( !io.IsNull() ) {
-           Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
-           ret = aSh->isShowVectors();
-         }
-       }
+        SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+        AIS_ListOfInteractive lst;
+        occPrs->GetObjects( lst );
+        if ( lst.Extent() ) {
+          Handle(AIS_InteractiveObject) io = lst.First();
+          if ( !io.IsNull() ) {
+            Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
+            if ( !aSh.IsNull() )
+              ret = aSh->isShowVectors();
+          }
+        }
       } else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
-       SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
-       vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
-       if ( lst ) {
-         lst->InitTraversal();
-         vtkActor* actor = lst->GetNextActor();
-         if ( actor ) {
-           GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
-           if ( aGeomActor )
-             ret = aGeomActor->GetVectorMode();
-         }
-       }
+        SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+        vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+        if ( lst ) {
+          lst->InitTraversal();
+          vtkActor* actor = lst->GetNextActor();
+          if ( actor ) {
+            GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
+            if ( aGeomActor )
+              ret = aGeomActor->GetVectorMode();
+          }
+        }
       }
     }
   }
index d6b4dabf0cecce501220fa341067c953fa2d9c7e..bb8d0aaab7fef938d2fb16fe8e78c38fd6ae7267 100644 (file)
@@ -48,6 +48,7 @@ private:
   bool                  isVisible( const int ) const;
   bool                  isAutoColor( const int ) const;
   QString               typeName( const int ) const;  
+  int                   typeId( const int ) const;  
   QString               displayMode( const int ) const;
   QString               selectionMode() const;
   bool                  isVectorsMode( const int ) const;
index 7f778b23e966187ef38ca1bc48325e3b0fa21b6a..7cbc862c3dfd4ff64ca1d9e9b597f355554f1ce8 100644 (file)
@@ -79,6 +79,7 @@
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 #include <TopoDS_Iterator.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
 
 // VTK Includes
 #include <vtkActorCollection.h>
@@ -88,6 +89,7 @@
 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
 
 #include <GEOMImpl_Types.hxx>
+#include <Graphic3d_HArray1OfBytes.hxx>
 
 using namespace std;
 
@@ -256,13 +258,10 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
   myShadingColor = SalomeApp_Tools::color( col );
 
   myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0);
-  myTypeOfMarker = (Aspect_TypeOfMarker)resMgr->integerValue("Geometry", "type_of_marker", Aspect_TOM_PLUS);
-  myScaleOfMarker = resMgr->doubleValue("Geometry", "marker_scale", 1.);
-  if(myScaleOfMarker < 1.0)
-    myScaleOfMarker = 1.0;
-  if(myScaleOfMarker > 7.)
-    myScaleOfMarker = 7.;
-
+  int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
+  myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
+  myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
+  myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
 
   myColor = -1;
   // This color is used for shape displaying. If it is equal -1 then
@@ -588,54 +587,54 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
           }
         }
        else
+       {
+         if ( myShape.ShapeType() == TopAbs_VERTEX )
          {
-           if ( myShape.ShapeType() == TopAbs_VERTEX )
-             {
-               col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-
-               Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
-               anAspect->SetColor( aColor );
-                anAspect->SetScale( myScaleOfMarker );
-                anAspect->SetTypeOfMarker( myTypeOfMarker );
-                AISShape->Attributes()->SetPointAspect( anAspect );
-             }
-           else
-             {
-               // Set line aspect
-               col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-
-               Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
-               anAspect->SetColor( aColor );
-               AISShape->Attributes()->SetLineAspect( anAspect );
-
-               // Set unfree boundaries aspect
-               anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
-               anAspect->SetColor( aColor );
-               AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
-
-               // Set free boundaries aspect
-               col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-
-               anAspect = AISShape->Attributes()->FreeBoundaryAspect();
-               anAspect->SetColor( aColor );
-               AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
-
-               // Set wire aspect
-               col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-
-               anAspect = AISShape->Attributes()->WireAspect();
-               anAspect->SetColor( aColor );
-               AISShape->Attributes()->SetWireAspect( anAspect );
-
-                // bug [SALOME platform 0019868]
-                // Set deviation angle. Default one is 12 degrees (Prs3d_Drawer.cxx:18)
-                AISShape->SetOwnDeviationAngle( 10*PI/180 );
-             }
+           col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
+           aColor = SalomeApp_Tools::color( col );
+           
+           Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+           anAspect->SetColor( aColor );
+           anAspect->SetScale( myScaleOfMarker );
+           anAspect->SetTypeOfMarker( myTypeOfMarker );
+           AISShape->Attributes()->SetPointAspect( anAspect );
          }
+         else
+         {
+           // Set line aspect
+           col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
+           aColor = SalomeApp_Tools::color( col );
+           
+           Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
+           anAspect->SetColor( aColor );
+           AISShape->Attributes()->SetLineAspect( anAspect );
+           
+           // Set unfree boundaries aspect
+           anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
+           anAspect->SetColor( aColor );
+           AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
+           
+           // Set free boundaries aspect
+           col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
+           aColor = SalomeApp_Tools::color( col );
+           
+           anAspect = AISShape->Attributes()->FreeBoundaryAspect();
+           anAspect->SetColor( aColor );
+           AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
+           
+           // Set wire aspect
+           col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
+           aColor = SalomeApp_Tools::color( col );
+           
+           anAspect = AISShape->Attributes()->WireAspect();
+           anAspect->SetColor( aColor );
+           AISShape->Attributes()->SetWireAspect( anAspect );
+           
+           // bug [SALOME platform 0019868]
+           // Set deviation angle. Default one is 12 degrees (Prs3d_Drawer.cxx:18)
+           AISShape->SetOwnDeviationAngle( 10*PI/180 );
+         }
+       }
 
         if ( HasWidth() )
           AISShape->SetWidth( GetWidth() );
@@ -657,7 +656,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
           AISShape->SetOwner( anObj );
         }
 
-       // Get color from GEOM_Object
+       // Get color and other properties from GEOM_Object
        SUIT_Session* session = SUIT_Session::session();
        SUIT_Application* app = session->activeApplication();
        if ( app )
@@ -731,6 +730,36 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
                         AISShape->Attributes()->SetPointAspect( anAspect );
                       }
                    }
+                   // ... marker type
+                   GEOM::marker_type aType = aGeomObject->GetMarkerType();
+                   GEOM::marker_size aSize = aGeomObject->GetMarkerSize();
+                   if ( aType > GEOM::MT_NONE && aType < GEOM::MT_USER && aSize > GEOM::MS_NONE && aSize <= GEOM::MS_70 ) {
+                     Aspect_TypeOfMarker aMType = (Aspect_TypeOfMarker)( (int)aType-1 );
+                     double aMSize = ((int)aSize+1)*0.5;
+                     Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+                     anAspect->SetScale( aMSize );
+                     anAspect->SetTypeOfMarker( aMType );
+                     Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
+                     if ( hasColor )
+                       aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
+                     anAspect->SetColor( aQuanColor );
+                     AISShape->Attributes()->SetPointAspect( anAspect );
+                   }
+                   else if ( aType == GEOM::MT_USER ) {
+                     int aTextureId = aGeomObject->GetMarkerTexture();
+                     Quantity_Color aQuanColor = SalomeApp_Tools::color( aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ) );
+                     if ( hasColor ) aQuanColor = Quantity_Color( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB );
+                     Standard_Integer aWidth, aHeight;
+                     Handle(Graphic3d_HArray1OfBytes) aTexture = GeometryGUI::getTexture( getStudy(), aTextureId, aWidth, aHeight );
+                     if ( !aTexture.IsNull() ) {
+                       static int TextureId = 0;
+                       Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect(aQuanColor,
+                                                                                        ++TextureId,
+                                                                                        aWidth, aHeight,
+                                                                                        aTexture );
+                       AISShape->Attributes()->SetPointAspect( aTextureAspect );
+                     }
+                   }
                  }
                }
              }
@@ -793,7 +822,7 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs )
 
   if ( myType == GEOM_MARKER && myShape.ShapeType() == TopAbs_FACE )
   {
-    myToActivate = false;
+    //myToActivate = false; // ouv: commented to make the trihedron pickable (see IPAL18657)
     GEOM_VTKTrihedron* aTrh = GEOM_VTKTrihedron::New();
 
     if ( HasColor() )
@@ -820,9 +849,7 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs )
   }
   else
   {
-    bool isVector = false;
-    if (myType == GEOM_VECTOR) isVector = true;
-    theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True, isVector );
+    theActors = GEOM_AssemblyBuilder::BuildActors( myShape, 0, 0, Standard_True, myType == GEOM_VECTOR );
   }
 
   theActors->InitTraversal();
index 2e25def67092ac9a5dd7c636df9eb51202bb70ff..94257fbd4c9034fbc647a3e8c6dd97e2d544ada8 100644 (file)
             <source>ICON_SELECT</source>
             <translation>select1.png</translation>
         </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_1</source>
+            <translation>marker_1.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_2</source>
+            <translation>marker_2.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_3</source>
+            <translation>marker_3.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_4</source>
+            <translation>marker_4.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_5</source>
+            <translation>marker_5.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_6</source>
+            <translation>marker_6.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_7</source>
+            <translation>marker_7.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_8</source>
+            <translation>marker_8.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_9</source>
+            <translation>marker_9.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_10</source>
+            <translation>marker_10.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_11</source>
+            <translation>marker_11.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_12</source>
+            <translation>marker_12.png</translation>
+        </message>
+       <message>
+            <source>ICON_VERTEX_MARKER_13</source>
+            <translation>marker_13.png</translation>
+        </message>
         <message>
             <source>ICO_ARC</source>
             <translation>arc.png</translation>
index ed1f7a99e881eed3b574cd94c355bb92104508b7..399dd04a49c784e8885b7834dde9bc54e90a3ba6 100644 (file)
@@ -335,6 +335,10 @@ Please, select face, shell or solid and try again</translation>
             <source>GEOM_CHECK_BLOCKS_COMPOUND</source>
             <translation>Check and Improve Blocks Compound</translation>
         </message>
+        <message>
+            <source>GEOM_CHECK_BLOCKS_COMPOUND_FAILED</source>
+            <translation>Check failed</translation>
+        </message>
         <message>
             <source>GEOM_CHECK_BLOCKS_COMPOUND_ERRORS</source>
             <translation>Errors</translation>
@@ -2551,6 +2555,10 @@ Please, select face, shell or solid and try again</translation>
             <source>MEN_WORK_PLANE</source>
             <translation>Working Plane</translation>
         </message>
+        <message>
+            <source>MEN_POP_POINT_MARKER</source>
+            <translation>Point Marker</translation>
+        </message>
         <message>
             <source>NAME_LBL</source>
             <translation>Name: </translation>
@@ -3051,6 +3059,10 @@ Please, select face, shell or solid and try again</translation>
             <source>STB_WORK_PLANE</source>
             <translation>Create a working plane</translation>
         </message>
+        <message>
+            <source>STB_POP_POINT_MARKER</source>
+            <translation>Set Point Marker</translation>
+        </message>
         <message>
             <source>SUPPRESS_RESULT</source>
             <translation>Suppress Result</translation>
@@ -3511,6 +3523,10 @@ Please, select face, shell or solid and try again</translation>
             <source>TOP_WORK_PLANE</source>
             <translation>Create a working plane</translation>
         </message>
+        <message>
+            <source>TOP_POP_POINT_MARKER</source>
+            <translation>Point Marker</translation>
+        </message>
         <message>
             <source>WRN_NOT_IMPLEMENTED</source>
             <translation>Sorry, this functionality is not yet implemented</translation>
@@ -4265,4 +4281,51 @@ Would you like to continue?</translation>
             <translation>Delete objects</translation>
         </message>
     </context>
+    <context>
+        <name>GEOMToolsGUI_MarkerDlg</name>
+        <message>
+            <source>SET_MARKER_TLT</source>
+            <translation>Set Point Marker</translation>
+        </message>
+        <message>
+            <source>STANDARD_MARKER</source>
+            <translation>Standard</translation>
+        </message>
+        <message>
+            <source>CUSTOM_MARKER</source>
+            <translation>Custom</translation>
+        </message>
+        <message>
+            <source>TYPE</source>
+            <translation>Type:</translation>
+        </message>
+        <message>
+            <source>SCALE</source>
+            <translation>Scale:</translation>
+        </message>
+        <message>
+            <source>CUSTOM</source>
+            <translation>Texture:</translation>
+        </message>
+        <message>
+            <source>BROWSE</source>
+            <translation>Browse...</translation>
+        </message>
+        <message>
+            <source>OK_BTN</source>
+            <translation>&amp;OK</translation>
+        </message>
+        <message>
+            <source>CANCEL_BTN</source>
+            <translation>&amp;Cancel</translation>
+        </message>
+        <message>
+            <source>HELP_BTN</source>
+            <translation>&amp;Help</translation>
+        </message>
+        <message>
+            <source>LOAD_TEXTURE_TLT</source>
+            <translation>Load Texture</translation>
+        </message>
+    </context>
 </TS>
index 81efb22a1ccb30a92be7de5d61cd6c271bfd0858..611022451cb9072b7b39494c5530c69f4fc8b4ca 100644 (file)
@@ -80,6 +80,7 @@
 #include <Aspect_TypeOfMarker.hxx>
 #include <OSD_SharedLibrary.hxx>
 #include <NCollection_DataMap.hxx>
+#include <Graphic3d_HArray1OfBytes.hxx>
 
 #include <utilities.h>
 
@@ -96,7 +97,7 @@ extern "C" {
   }
 }
 
-
+GeometryGUI::StudyTextureMap GeometryGUI::myTextureMap;
 
 GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil();
 
@@ -343,7 +344,7 @@ void GeometryGUI::OnGUIEvent( int id )
   bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
   // if current viewframe is not of OCC and not of VTK type - return immediately
   // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
-  bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 );
+  bool NotViewerDependentCommand = ( id == 901 || id == 216 || id == 213 || id == 33 || id == 8037 || id == 8038 || id == 8039 );
   if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommand )
       return;
 
@@ -381,6 +382,7 @@ void GeometryGUI::OnGUIEvent( int id )
       id == 8036 ||  // POPUP VIEWER - DISABLE AUTO COLOR
       id == 8037 ||  // POPUP VIEWER - SHOW CHILDREN
       id == 8038 ||  // POPUP VIEWER - HIDE CHILDREN
+      id == 8039 ||  // POPUP VIEWER - POINT MARKER
       id == 804  ||  // POPUP VIEWER - ADD IN STUDY
       id == 901  ||  // OBJECT BROWSER - RENAME
       id == 9024 ) { // OBJECT BROWSER - OPEN
@@ -903,6 +905,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( 8001, "POP_CREATE_GROUP" );
   createGeomAction( 8037, "POP_SHOW_CHILDREN" );
   createGeomAction( 8038, "POP_HIDE_CHILDREN" );
+  createGeomAction( 8039, "POP_POINT_MARKER" );
 
   // make wireframe-shading items to be exclusive (only one at a time is selected)
   //QActionGroup* dispModeGr = new QActionGroup( this, "", true );
@@ -1170,6 +1173,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->setRule( action( 8033 ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
   mgr->insert( action(  8034 ), -1, -1 ); // isos
   mgr->setRule( action( 8034 ), clientOCCorVTK_AndSomeVisible + " and selcount>0 and isVisible", QtxPopupMgr::VisibleRule );
+  mgr->insert( action(  8039 ), -1, -1 ); // point marker
+  mgr->setRule( action( 8039 ), QString( "selcount>0 and $typeid in {%1}" ).arg( GEOM_POINT ), QtxPopupMgr::VisibleRule );
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  8035 ), -1, -1 ); // auto color
   mgr->setRule( action( 8035 ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule );
@@ -1462,6 +1467,32 @@ QString GeometryGUI::engineIOR() const
   return "";
 }
 
+Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture( SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight )
+{
+  theWidth = theHeight = 0;
+  Handle(Graphic3d_HArray1OfBytes) aTexture;
+  if ( theStudy ) {
+    TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ];
+    aTexture = aTextureMap[ theId ];
+    if ( aTexture.IsNull() ) {
+      GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations( theStudy->studyDS()->StudyId() );
+      if ( !aInsOp->_is_nil() ) {
+       CORBA::Long aWidth, aHeight;
+       SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
+       if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
+         theWidth  = aWidth;
+         theHeight = aHeight;
+         aTexture  = new Graphic3d_HArray1OfBytes( 1, aStream->length() );
+         for ( int i = 0; i < aStream->length(); i++ )
+           aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
+         aTextureMap[ theId ] = aTexture;
+       }
+      }
+    }
+  }
+  return aTexture;
+}
+
 LightApp_Selection* GeometryGUI::createSelection() const
 {
   return new GEOMGUI_Selection();
@@ -1542,7 +1573,7 @@ void GeometryGUI::createPreferences()
                                     LightApp_Preferences::Selector, "Geometry", "type_of_marker" );
 
   int markerScale = addPreference( tr( "PREF_MARKER_SCALE" ), VertexGroup,
-                                   LightApp_Preferences::DblSpin, "Geometry", "marker_scale" );
+                                   LightApp_Preferences::Selector, "Geometry", "marker_scale" );
 
   // Set property for default display mode
   QStringList aModesList;
@@ -1561,47 +1592,32 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( step, "max", 10000 );
   setPreferenceProperty( step, "precision", 3 );
 
-  // Set property for type of vertex marker
-  QStringList aTypeOfMarkerList;
-  QList<QVariant> anTypeOfMarkerIndexesList;
-
-  aTypeOfMarkerList.append( tr("TOM_PLUS") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_PLUS);
-
-  aTypeOfMarkerList.append( tr("TOM_POINT") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_POINT);
+  // Set property vertex marker type
+  QList<QVariant> aMarkerTypeIndicesList;
+  QList<QVariant> aMarkerTypeIconsList;
 
-  aTypeOfMarkerList.append( tr("TOM_STAR") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_STAR);
-
-  aTypeOfMarkerList.append( tr("TOM_O") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_O);
-
-  aTypeOfMarkerList.append( tr("TOM_X") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_X);
-
-  aTypeOfMarkerList.append( tr("TOM_O_POINT") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_O_POINT);
-
-  aTypeOfMarkerList.append( tr("TOM_O_PLUS") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_O_PLUS);
-
-  aTypeOfMarkerList.append( tr("TOM_O_STAR") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_O_STAR);
-
-  aTypeOfMarkerList.append( tr("TOM_O_X") );
-  anTypeOfMarkerIndexesList.append(Aspect_TOM_O_X);
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
+    QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+    QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
+    aMarkerTypeIndicesList << (i-1);
+    aMarkerTypeIconsList << pixmap;
+  }
 
+  setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+  setPreferenceProperty( typeOfMarker, "icons",   aMarkerTypeIconsList );
 
-  setPreferenceProperty( typeOfMarker, "strings", aTypeOfMarkerList );
-  setPreferenceProperty( typeOfMarker, "indexes", anTypeOfMarkerIndexesList );
+  // Set property for vertex marker scale
+  QList<QVariant> aMarkerScaleIndicesList;
+  QStringList     aMarkerScaleValuesList;
 
-  // Set property for Vertex Marker scale
-  setPreferenceProperty( markerScale, "min", 1. );
-  setPreferenceProperty( markerScale, "max", 7. );
-  setPreferenceProperty( markerScale, "precision", 0.01 );
-  setPreferenceProperty( markerScale, "step", 0.5 );
+  for ( int i = GEOM::MS_10; i <= GEOM::MS_70; i++ ) {
+    aMarkerScaleIndicesList << i;
+    aMarkerScaleValuesList  << QString::number( (i-(int)GEOM::MS_10)*0.5 + 1.0 );
+  }
 
+  setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+  setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
 }
 
 void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
index a82efcb25bf99c14dadee59c352c46c4360f9158..2cbd9d1dd4da1c1c461239c4cfd807ee982a26c9 100644 (file)
@@ -41,6 +41,7 @@
 
 // OCCT Includes
 #include <gp_Ax3.hxx>
+#include <Graphic3d_HArray1OfBytes.hxx>
 
 // IDL headers
 #include "SALOMEconfig.h"
@@ -54,6 +55,7 @@ class GEOMGUI_OCCSelector;
 class LightApp_VTKSelector;
 class LightApp_Selection;
 class SUIT_ViewManager;
+class SalomeApp_Study;
 
 //=================================================================================
 // class    : GeometryGUI
@@ -74,6 +76,8 @@ public:
   virtual void                initialize( CAM_Application* );
   virtual QString             engineIOR() const;
 
+  static Handle(Graphic3d_HArray1OfBytes) getTexture( SalomeApp_Study*, int, int&, int& );
+
   static bool                 InitGeomGen();   //BugID IPAL9186: SRN: To be called by Python scripts
 
   static  GEOM::GEOM_Gen_var  GetGeomGen();//        { return GeometryGUI::myComponentGeom; }
@@ -159,7 +163,12 @@ private:
 
 public:
   static GEOM::GEOM_Gen_var   myComponentGeom;   // GEOM engine!!!
+
 private:  
+
+  typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap;
+  typedef QMap<long, TextureMap> StudyTextureMap;
+  
   GUIMap                      myGUIMap;          // GUI libraries map
   QDialog*                    myActiveDialogBox; // active dialog box
   GEOM_Client                 myShapeReader;     // geom shape reader
@@ -167,6 +176,7 @@ private:
   int                         myState;           // identify a method
   gp_Ax3                      myWorkingPlane;
   QMap<int,QString>           myRules;           // popup rules
+  static StudyTextureMap      myTextureMap;      // texture map
 
   QList<GEOMGUI_OCCSelector*>  myOCCSelectors;
   QList<LightApp_VTKSelector*> myVTKSelectors;
@@ -174,7 +184,7 @@ private:
   LightApp_Displayer*         myDisplayer;
   int                         myLocalSelectionMode; //Select Only
 
-friend class DisplayGUI;
+  friend class DisplayGUI;
 };
 
 #endif
index 0a2c4d6e0a151b074a54a84a76df7181d4905372..5869679663c339c221f1e6a245483099c51a3214 100644 (file)
@@ -2350,9 +2350,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aCopy
-                               << " = geompy.RemoveExtraEdges(" << theObject
-                               << ", " << theOptimumNbFaces << ")";
+  std::string doUnionFaces = (theOptimumNbFaces < 0) ? "False" : "True";
+  GEOM::TPythonDump(aFunction) << aCopy << " = geompy.RemoveExtraEdges("
+                               << theObject << ", " << doUnionFaces.data() << ")";
 
   SetErrorCode(OK);
   return aCopy;
index b9734d9c4c14c90770c285bcc62edc4bc1d5fd65..ab894fcbcc875bf487443f4d88184379457962f8 100644 (file)
@@ -567,13 +567,17 @@ void GEOMImpl_IGroupOperations::UnionIDs (Handle(GEOM_Object) theGroup,
   TopTools_IndexedMapOfShape mapIndices;
   TopExp::MapShapes(aMainShape, mapIndices);
 
+  // Get group type
+  TopAbs_ShapeEnum aType = GetType(theGroup);
+
   // Get IDs of sub-shapes to add
   Standard_Integer i, new_id;
   for (i = 1; i <= aLen; i++) {
     new_id = theSubShapes->Value(i);
 
     if (0 < new_id && new_id <= mapIndices.Extent()) {
-      if (mapIDs.Add(new_id)) {
+      //if (mapIDs.Add(new_id)) { IPAL21297. Why we ignore invalid ids silently?
+      if (mapIDs.Add(new_id) && mapIndices(new_id).ShapeType()==aType ) {
         aNewIDs.Append(new_id);
       }
     }
index 102ebba74e2438d4f4918c9c73a8746c06a1b7e6..80f4a296265b4f3d26cdcbd0884fd7be34811772 100644 (file)
@@ -48,6 +48,7 @@
 #include <TopoDS_Vertex.hxx>
 #include <BRep_Tool.hxx>
 #include <gp_Pnt.hxx>
+#include <TDataStd_HArray1OfByte.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@@ -240,8 +241,10 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::Import
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << result << " = geompy.Import(\""
-    << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
+  if( theFormatName != "IGES_UNIT" ) {
+    GEOM::TPythonDump(aFunction) << result << " = geompy.Import(\""
+      << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
+  }
 
   SetErrorCode(OK);
 
@@ -541,3 +544,98 @@ Standard_Boolean GEOMImpl_IInsertOperations::InitResMgr()
   return ( myResMgr->Find("Import") || myResMgr->Find("Export") ||
           myResMgrUser->Find("Import") || myResMgrUser->Find("Export"));
 }
+
+int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTextureFile)
+{
+  SetErrorCode(KO);
+
+  if (theTextureFile.IsEmpty()) return 0;
+
+  Handle(TDataStd_HArray1OfByte) aTexture;
+
+  FILE* fp = fopen(theTextureFile.ToCString(), "r");
+  if (!fp) return 0;
+
+  std::list<std::string> lines;
+  char buffer[4096];
+  int maxlen = 0;
+  while (!feof(fp)) {
+    if ((fgets(buffer, 4096, fp)) == NULL) break;
+    int aLen = strlen(buffer);
+    if (buffer[aLen-1] == '\n') buffer[aLen-1] = '\0';
+    lines.push_back(buffer);
+    maxlen = std::max(maxlen, (int)strlen(buffer));
+  }
+
+  fclose(fp);
+
+  int lenbytes = maxlen/8;
+  if (maxlen%8) lenbytes++;
+
+  if (lenbytes == 0 || lines.empty())
+    return 0;
+
+  std::list<unsigned char> bytedata;
+  std::list<std::string>::const_iterator it;
+  for (it = lines.begin(); it != lines.end(); ++it) {
+    std::string line = *it;
+    int lenline = (line.size()/8 + (line.size()%8 ? 1 : 0)) * 8;
+    for (int i = 0; i < lenline/8; i++) {
+      unsigned char byte = 0;
+      for (int j = 0; j < 8; j++)
+       byte = (byte << 1) + ( i*8+j < line.size() && line[i*8+j] != '0' ? 1 : 0 );
+      bytedata.push_back(byte);
+    }
+    for (int i = lenline/8; i < lenbytes; i++)
+      bytedata.push_back((unsigned char)0);
+  }
+
+  if (bytedata.empty() || bytedata.size() != lines.size()*lenbytes)
+    return 0;
+
+  aTexture = new TDataStd_HArray1OfByte(1, lines.size()*lenbytes);
+  std::list<unsigned char>::iterator bdit;
+  int i;
+  for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i)
+    aTexture->SetValue(i, (Standard_Byte)(*bdit));
+
+  int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile);
+  if (aTextureId > 0) SetErrorCode(OK);
+  return aTextureId;
+}
+  
+int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight, 
+                                          const Handle(TDataStd_HArray1OfByte)& theTexture)
+{
+  SetErrorCode(KO);
+  int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
+  if (aTextureId > 0) SetErrorCode(OK);
+  return aTextureId;
+}
+
+Handle(TDataStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theTextureId,
+                                                                     int& theWidth, int& theHeight)
+{
+  SetErrorCode(KO);
+  
+  Handle(TDataStd_HArray1OfByte) aTexture;
+  theWidth = theHeight = 0;
+  TCollection_AsciiString aFileName;
+
+  if (theTextureId <= 0)
+    return aTexture;
+
+  aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName);
+
+  if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK);
+
+  return aTexture;
+}
+
+std::list<int> GEOMImpl_IInsertOperations::GetAllTextures()
+{
+  SetErrorCode(KO);
+  std::list<int> id_list = GetEngine()->getAllTextures(GetDocID());
+  SetErrorCode(OK);
+  return id_list;
+}
index aba0c227f6e57d602c9f5dc1315e042c787232f3..51d2ed350bf8cb60cd0f926cb7a49eb068d838f7 100644 (file)
@@ -30,6 +30,9 @@
 #include <TColStd_HSequenceOfAsciiString.hxx>
 #include <TCollection_HAsciiString.hxx>
 #include <Resource_Manager.hxx>
+#include <list>
+
+class Handle_TDataStd_HArray1OfByte;
 
 class GEOMImpl_IInsertOperations : public GEOM_IOperations {
  public:
@@ -56,6 +59,16 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations {
                                                 const TCollection_AsciiString& theFormat,
                                                 Handle(TCollection_HAsciiString)& theLibName);
 
+  Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile);
+  
+  Standard_EXPORT int AddTexture(int theWidth, int theHeight, 
+                                const Handle(TDataStd_HArray1OfByte)& theTexture);
+
+  Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId, 
+                                                           int& theWidth, int& theHeight);
+
+  Standard_EXPORT std::list<int> GetAllTextures();
+  
  private:
   Standard_Boolean InitResMgr ();
 
index cb173b0c40cc46bb2984dbae25224f6764764b41..0eff72be42edf32abe30c13291f1afba82afe87e 100644 (file)
@@ -941,7 +941,7 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs
   } else {
     TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType));
     for (; exp.More(); exp.Next())
-      if (!exp.Current().IsSame(aShape) && mapShape.Add(exp.Current()))
+      if (mapShape.Add(exp.Current()))
        listShape.Append(exp.Current());
   }
 
index 40d68aa88ae85a41808f911b5798cf52135f5f39..7f54d9abfbd73f7e732096207bff7bd0367baae4 100644 (file)
@@ -261,6 +261,15 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
   aShape = PS.Shape();
   if (aShape.IsNull()) return 0;
 
+  //Alternative case to check not valid partition IPAL21418
+  TopoDS_Iterator It (aShape, Standard_True, Standard_True);
+  int nbSubshapes=0;
+  for (; It.More(); It.Next())
+    nbSubshapes++;
+  if (!nbSubshapes)
+    Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
+  //end of IPAL21418
+
   if (!BRepAlgo::IsValid(aShape)) {
     // 08.07.2008 added by skl during fixing bug 19761 from Mantis
     ShapeFix_ShapeTolerance aSFT;
index 212575e3a7f70e6e3d263bfa7bddafe1c43b5ac5..e35a5119c56c5c5099c8ae8c6dc27c05fd23256c 100644 (file)
@@ -94,7 +94,6 @@
 
 #include "utilities.h"
 
-
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -105,7 +104,6 @@ const Standard_GUID& GEOMImpl_PipeDriver::GetID()
   return aPipeDriver;
 }
 
-
 //=======================================================================
 //function : GEOMImpl_PipeDriver
 //purpose  :
@@ -114,15 +112,14 @@ GEOMImpl_PipeDriver::GEOMImpl_PipeDriver()
 {
 }
 
-
 //=======================================================================
 //function : FillForOtherEdges
 //purpose  : auxilary for CreatePipeForShellSections()
 //=======================================================================
 static bool FillForOtherEdges(const TopoDS_Shape& F1,
-                             const TopoDS_Shape& E1,
-                             const TopoDS_Shape& V1,
-                             TopTools_IndexedDataMapOfShapeShape& FF)
+                              const TopoDS_Shape& E1,
+                              const TopoDS_Shape& V1,
+                              TopTools_IndexedDataMapOfShapeShape& FF)
 {
   //cout<<"FillForOtherEdges"<<endl;
   // find other pairs for vertexes and edges
@@ -191,17 +188,16 @@ static bool FillForOtherEdges(const TopoDS_Shape& F1,
   return true;
 }
 
-
 //=======================================================================
 //function : FillCorrespondingEdges
 //purpose  : auxilary for CreatePipeForShellSections()
 //=======================================================================
 static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
-                                  const TopoDS_Shape& FS2,
-                                  const TopoDS_Vertex& aLoc1,
-                                  const TopoDS_Vertex& aLoc2,
-                                  const TopoDS_Wire& aWirePath,
-                                  TopTools_IndexedDataMapOfShapeShape& FF)
+                                   const TopoDS_Shape& FS2,
+                                   const TopoDS_Vertex& aLoc1,
+                                   const TopoDS_Vertex& aLoc2,
+                                   const TopoDS_Wire& aWirePath,
+                                   TopTools_IndexedDataMapOfShapeShape& FF)
 {
   //cout<<"FillCorrespondingEdges"<<endl;
   // find corresponding edges
@@ -229,7 +225,7 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
   */
   ShapeAnalysis_Edge sae;
   double tol = Max( BRep_Tool::Tolerance(TopoDS::Face(FS1)),
-                   BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
+                    BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
   TopTools_MapOfShape Vs1,Vs2;
   TopExp_Explorer exp;
   exp.Init( FS1, TopAbs_EDGE );
@@ -263,23 +259,23 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
       TopoDS_Vertex VF = sae.FirstVertex(E);
       TopoDS_Vertex VL = sae.LastVertex(E);
       if( (VF.IsSame(VN11) && VL.IsSame(VN21)) || (VF.IsSame(VN21) && VL.IsSame(VN11)) ) {
-       IsFind = true;
-       break;
+        IsFind = true;
+        break;
       }
     }
     if(IsFind) {
       for( expe.Init( F, TopAbs_EDGE ); expe.More(); expe.Next() ) {
-       TopoDS_Edge E = TopoDS::Edge(expe.Current());
-       TopoDS_Vertex VF = sae.FirstVertex(E);
-       TopoDS_Vertex VL = sae.LastVertex(E);
-       if( VF.IsSame(VN11) && !VL.IsSame(VN21) )
-         VN12 = VL;
-       if( VL.IsSame(VN11) && !VF.IsSame(VN21) )
-         VN12 = VF;
-       if( VF.IsSame(VN21) && !VL.IsSame(VN11) )
-         VN22 = VL;
-       if( VL.IsSame(VN21) && !VF.IsSame(VN11) )
-         VN22 = VF;
+        TopoDS_Edge E = TopoDS::Edge(expe.Current());
+        TopoDS_Vertex VF = sae.FirstVertex(E);
+        TopoDS_Vertex VL = sae.LastVertex(E);
+        if( VF.IsSame(VN11) && !VL.IsSame(VN21) )
+          VN12 = VL;
+        if( VL.IsSame(VN11) && !VF.IsSame(VN21) )
+          VN12 = VF;
+        if( VF.IsSame(VN21) && !VL.IsSame(VN11) )
+          VN22 = VL;
+        if( VL.IsSame(VN21) && !VF.IsSame(VN11) )
+          VN22 = VF;
       }
       break;
     }
@@ -324,16 +320,15 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
   //return true;
 }
 
-
 //=======================================================================
 //function : FillCorrespondingEdges
 //purpose  : auxilary for CreatePipeShellsWithoutPath()
 //=======================================================================
 static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
-                                  const TopoDS_Shape& FS2,
-                                  const TopoDS_Vertex& aLoc1,
-                                  const TopoDS_Vertex& aLoc2,
-                                  TopTools_IndexedDataMapOfShapeShape& FF)
+                                   const TopoDS_Shape& FS2,
+                                   const TopoDS_Vertex& aLoc1,
+                                   const TopoDS_Vertex& aLoc2,
+                                   TopTools_IndexedDataMapOfShapeShape& FF)
 {
   //cout<<"FillCorrespondingEdges"<<endl;
 
@@ -343,7 +338,7 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
 
   ShapeAnalysis_Edge sae;
   double tol = Max( BRep_Tool::Tolerance(TopoDS::Face(FS1)),
-                   BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
+                    BRep_Tool::Tolerance(TopoDS::Face(FS2)) );
   TopTools_MapOfShape Vs1,Vs2;
 
   TopoDS_Vertex V11=aLoc1, V12=aLoc2, V21, V22;
@@ -379,26 +374,26 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
     gp_Pnt Ptmp2 = BRep_Tool::Pnt(V2);
     if(P2.Distance(Ptmp1)<tol) {
       if(nbe==0) {
-       E21 = E;
-       VE21 = V2;
-       nbe++;
+        E21 = E;
+        VE21 = V2;
+        nbe++;
       }
       else if(nbe==1) {
-       E22 = E;
-       VE22 = V2;
-       nbe++;
+        E22 = E;
+        VE22 = V2;
+        nbe++;
       }
     }
     if(P2.Distance(Ptmp2)<tol) {
       if(nbe==0) {
-       E21 = E;
-       VE21 = V1;
-       nbe++;
+        E21 = E;
+        VE21 = V1;
+        nbe++;
       }
       else if(nbe==1) {
-       E22 = E;
-       VE22 = V1;
-       nbe++;
+        E22 = E;
+        VE22 = V1;
+        nbe++;
       }
     }
   }
@@ -427,16 +422,15 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
   return FillForOtherEdges(FS1,E1,V21,FF);
 }
 
-
 //=======================================================================
 //function : FindNextPairOfFaces
 //purpose  : auxilary for CreatePipeForShellSections()
 //=======================================================================
 static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
-                               TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces1,
-                               TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces2,
-                               TopTools_IndexedDataMapOfShapeShape& FF,
-                               GEOMImpl_IPipe* aCI)
+                                TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces1,
+                                TopTools_IndexedDataMapOfShapeListOfShape& aMapEdgeFaces2,
+                                TopTools_IndexedDataMapOfShapeShape& FF,
+                                GEOMImpl_IPipe* aCI)
 {
   //cout<<"FindNextPairOfFaces"<<endl;
   TopExp_Explorer anExp;
@@ -498,14 +492,13 @@ static void FindNextPairOfFaces(const TopoDS_Shape& aCurFace,
   }
 }
 
-
 //=======================================================================
 //function : FindFirstPairFaces
 //purpose  : auxilary for Execute()
 //=======================================================================
 static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
-                              TopoDS_Vertex& V1, TopoDS_Vertex& V2,
-                              TopoDS_Shape& FS1, TopoDS_Shape& FS2)
+                               TopoDS_Vertex& V1, TopoDS_Vertex& V2,
+                               TopoDS_Shape& FS1, TopoDS_Shape& FS2)
 {
   //cout<<"FindFirstPairFaces"<<endl;
 
@@ -619,13 +612,12 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
   FS2 = Fs(numface);
 }
 
-
 //=======================================================================
 //function : CreatePipeForShellSections
 //purpose  : auxilary for Execute()
 //=======================================================================
 static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
-                                              GEOMImpl_IPipe* aCI)
+                                               GEOMImpl_IPipe* aCI)
 {
   //cout<<"CreatePipeForShellSections"<<endl;
   //TopoDS_Shape res;
@@ -696,17 +688,17 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       gp_Pnt P1 = BRep_Tool::Pnt(V1);
       gp_Pnt P2 = BRep_Tool::Pnt(V2);
       if( P1.Distance(PLocs.First()) < tol ) {
-       Num1 = i;
+        Num1 = i;
       }
       if( P2.Distance(PLocs.Last()) < tol ) {
-       Num2 = i;
+        Num2 = i;
       }
     }
     if( Num1>0 && Num2>0 ) {
       TopoDS_Wire W;
       B.MakeWire(W);
       for(i=Num1; i<=Num2; i++) {
-       B.Add(W,Edges.Value(i));
+        B.Add(W,Edges.Value(i));
       }
       Wires.Append(W);
     }
@@ -727,7 +719,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     if( PF.Distance(PLocs.First()) > tol ) {
       if(aCI) delete aCI;
       Standard_ConstructionError::Raise
-       ("First location shapes is not coincided with first vertex of aWirePath");
+        ("First location shapes is not coincided with first vertex of aWirePath");
     }
     VLocs.ChangeValue(1) = VF;
     edge = TopoDS::Edge(Edges.Last());
@@ -737,7 +729,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     if( PL.Distance(PLocs.Last()) > tol ) {
       if(aCI) delete aCI;
       Standard_ConstructionError::Raise
-       ("Last location shapes is not coincided with last vertex of aWirePath");
+        ("Last location shapes is not coincided with last vertex of aWirePath");
     }
     VLocs.ChangeValue(nbLocs) = VL;
     int jcurr = 2;
@@ -750,73 +742,73 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       gp_Pnt P1 = BRep_Tool::Pnt(V1);
       gp_Pnt P2 = BRep_Tool::Pnt(V2);
       if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
-       // make wire from current edge and add created
-       // wire to Wires
-       TopoDS_Wire W;
-       B.MakeWire(W);
-       for(j=1; j<=tmpEdges.Length(); j++)
-         B.Add(W,tmpEdges.Value(j));
-       B.Add(W,E);
-       Wires.Append(W);
-       VLocs.ChangeValue(jcurr) = V2;
-       jcurr++;
-       tmpEdges.Clear();
+        // make wire from current edge and add created
+        // wire to Wires
+        TopoDS_Wire W;
+        B.MakeWire(W);
+        for(j=1; j<=tmpEdges.Length(); j++)
+          B.Add(W,tmpEdges.Value(j));
+        B.Add(W,E);
+        Wires.Append(W);
+        VLocs.ChangeValue(jcurr) = V2;
+        jcurr++;
+        tmpEdges.Clear();
       }
       else {
-       // find distance between E and aLocs(jcurr)
-       double fp,lp;
-       Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
-       GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
-       if( PPC.NbPoints()>0 &&
-           PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
-         double param = PPC.Parameter(1);
-         gp_Pnt PC1;
-         C->D0(param,PC1);
-         // split current edge
-         Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
-         Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
-         TopoDS_Edge E1,E2;
-         gp_Pnt Pfp;
-         C->D0(fp,Pfp);
-         if(Pfp.Distance(P1)<tol) {
-           B.MakeEdge(E1,tc1,tol);
-           B.Add(E1,V1);
-           TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
-           B.Add(E1,TopoDS::Vertex(tmpV));
-           tmpEdges.Append(E1);
-           B.MakeEdge(E2,tc2,tol);
-           tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
-           B.Add(E2,TopoDS::Vertex(tmpV));
-           B.Add(E2,V2);
-         }
-         else {
-           B.MakeEdge(E1,tc2,tol);
-           TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
-           B.Add(E1,TopoDS::Vertex(tmpV));
-           B.Add(E1,V1);
-           E1.Reverse();
-           tmpEdges.Append(E1);
-           B.MakeEdge(E2,tc1,tol);
-           B.Add(E2,V2);
-           tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
-           B.Add(E2,TopoDS::Vertex(tmpV));
-           E2.Reverse();
-         }
-         // create wire from tmpEdges
-         TopoDS_Wire W;
-         B.MakeWire(W);
-         for(j=1; j<=tmpEdges.Length(); j++)
-           B.Add(W,tmpEdges.Value(j));
-         Wires.Append(W);
-         jcurr++;
-         tmpEdges.Clear();
-         Edges.Remove(i);
-         Edges.InsertAfter(i-1,E1);
-         Edges.InsertAfter(i,E2);
-       }
-       else {
-         tmpEdges.Append(E);
-       }
+        // find distance between E and aLocs(jcurr)
+        double fp,lp;
+        Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+        GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
+        if( PPC.NbPoints()>0 &&
+            PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
+          double param = PPC.Parameter(1);
+          gp_Pnt PC1;
+          C->D0(param,PC1);
+          // split current edge
+          Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+          Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+          TopoDS_Edge E1,E2;
+          gp_Pnt Pfp;
+          C->D0(fp,Pfp);
+          if(Pfp.Distance(P1)<tol) {
+            B.MakeEdge(E1,tc1,tol);
+            B.Add(E1,V1);
+            TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+            B.Add(E1,TopoDS::Vertex(tmpV));
+            tmpEdges.Append(E1);
+            B.MakeEdge(E2,tc2,tol);
+            tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+            B.Add(E2,TopoDS::Vertex(tmpV));
+            B.Add(E2,V2);
+          }
+          else {
+            B.MakeEdge(E1,tc2,tol);
+            TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+            B.Add(E1,TopoDS::Vertex(tmpV));
+            B.Add(E1,V1);
+            E1.Reverse();
+            tmpEdges.Append(E1);
+            B.MakeEdge(E2,tc1,tol);
+            B.Add(E2,V2);
+            tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+            B.Add(E2,TopoDS::Vertex(tmpV));
+            E2.Reverse();
+          }
+          // create wire from tmpEdges
+          TopoDS_Wire W;
+          B.MakeWire(W);
+          for(j=1; j<=tmpEdges.Length(); j++)
+            B.Add(W,tmpEdges.Value(j));
+          Wires.Append(W);
+          jcurr++;
+          tmpEdges.Clear();
+          Edges.Remove(i);
+          Edges.InsertAfter(i-1,E1);
+          Edges.InsertAfter(i,E2);
+        }
+        else {
+          tmpEdges.Append(E);
+        }
       }
     }
     // create wire from other edges
@@ -839,7 +831,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
   //TopTools_SequenceOfShape aSeqFaces;
   TopoDS_Compound aComp;
   B.MakeCompound(aComp);
-  for(i=1 ; i<nbBases; i++) {
+  for (i = 1; i < nbBases; i++) {
     TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i));
     // 1 section
     Handle(Standard_Transient) anItem1 = aBasesObjs->Value(i);
@@ -898,69 +890,69 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       TColgp_SequenceOfPnt aPnts;
       double xc=0, yc=0, zc=0;
       for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
-       TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
-       aPnts.Append(BRep_Tool::Pnt(V));
-       xc += aPnts.Last().X();
-       yc += aPnts.Last().Y();
-       zc += aPnts.Last().Z();
+        TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+        aPnts.Append(BRep_Tool::Pnt(V));
+        xc += aPnts.Last().X();
+        yc += aPnts.Last().Y();
+        zc += aPnts.Last().Z();
       }
       gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
       gp_Vec V1(PC,aPnts.Value(1));
       gp_Vec V2(PC,aPnts.Value(2));
       gp_Vec VN = V1.Crossed(V2);
       for(int ip=2; ip<aPnts.Length(); ip++) {
-       V1 = gp_Vec(PC,aPnts.Value(ip));
-       V2 = gp_Vec(PC,aPnts.Value(ip+1));
-       VN.Add(V1.Crossed(V2));
+        V1 = gp_Vec(PC,aPnts.Value(ip));
+        V2 = gp_Vec(PC,aPnts.Value(ip+1));
+        VN.Add(V1.Crossed(V2));
       }
       gp_Vec PathNorm;
       gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
       TopExp_Explorer WE;
       for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
-       TopoDS_Edge edge = TopoDS::Edge(WE.Current());
-       double tol = BRep_Tool::Tolerance(edge);
-       TopoDS_Vertex VF = sae.FirstVertex(edge);
-       gp_Pnt PF = BRep_Tool::Pnt(VF);
-       if( PF.Distance(PLoc) < tol ) {
-         double fp,lp;
-         Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-         gp_Pnt P1,P2;
-         C->D0(fp,P1);
-         if( P1.Distance(PLoc) < tol ) {
-           C->D0(fp+(lp-fp)/100,P2);
-         }
-         else {
-           C->D0(lp,P1);
-           C->D0(lp+(fp-lp)/100,P2);
-         }
-         PathNorm = gp_Vec(P1,P2);
-         break;
-       }
-       else {
-         TopoDS_Vertex VL = sae.LastVertex(edge);
-         gp_Pnt PL = BRep_Tool::Pnt(VL);
-         if( PL.Distance(PLoc) < tol ) {
-           double fp,lp;
-           Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-           gp_Pnt P1,P2;
-           C->D0(fp,P1);
-           if( P1.Distance(PLoc) < tol ) {
-             C->D0(fp+(lp-fp)/100,P2);
-           }
-           else {
-             C->D0(lp,P1);
-             C->D0(lp+(fp-lp)/100,P2);
-           }
-           PathNorm = gp_Vec(P2,P1);
-           break;
-         }
-       }
+        TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+        double tol = BRep_Tool::Tolerance(edge);
+        TopoDS_Vertex VF = sae.FirstVertex(edge);
+        gp_Pnt PF = BRep_Tool::Pnt(VF);
+        if( PF.Distance(PLoc) < tol ) {
+          double fp,lp;
+          Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+          gp_Pnt P1,P2;
+          C->D0(fp,P1);
+          if( P1.Distance(PLoc) < tol ) {
+            C->D0(fp+(lp-fp)/100,P2);
+          }
+          else {
+            C->D0(lp,P1);
+            C->D0(lp+(fp-lp)/100,P2);
+          }
+          PathNorm = gp_Vec(P1,P2);
+          break;
+        }
+        else {
+          TopoDS_Vertex VL = sae.LastVertex(edge);
+          gp_Pnt PL = BRep_Tool::Pnt(VL);
+          if( PL.Distance(PLoc) < tol ) {
+            double fp,lp;
+            Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+            gp_Pnt P1,P2;
+            C->D0(fp,P1);
+            if( P1.Distance(PLoc) < tol ) {
+              C->D0(fp+(lp-fp)/100,P2);
+            }
+            else {
+              C->D0(lp,P1);
+              C->D0(lp+(fp-lp)/100,P2);
+            }
+            PathNorm = gp_Vec(P2,P1);
+            break;
+          }
+        }
       }
       cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
       cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
       if(fabs(VN.Angle(PathNorm))>PI/2.) {
-       NeedReverse = true;
-       aShBase1.Reverse();
+        NeedReverse = true;
+        aShBase1.Reverse();
       }
     }
     {
@@ -970,68 +962,68 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       TColgp_SequenceOfPnt aPnts;
       double xc=0, yc=0, zc=0;
       for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
-       TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
-       aPnts.Append(BRep_Tool::Pnt(V));
-       xc += aPnts.Last().X();
-       yc += aPnts.Last().Y();
-       zc += aPnts.Last().Z();
+        TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+        aPnts.Append(BRep_Tool::Pnt(V));
+        xc += aPnts.Last().X();
+        yc += aPnts.Last().Y();
+        zc += aPnts.Last().Z();
       }
       gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
       gp_Vec V1(PC,aPnts.Value(1));
       gp_Vec V2(PC,aPnts.Value(2));
       gp_Vec VN = V1.Crossed(V2);
       for(int ip=2; ip<aPnts.Length(); ip++) {
-       V1 = gp_Vec(PC,aPnts.Value(ip));
-       V2 = gp_Vec(PC,aPnts.Value(ip+1));
-       VN.Add(V1.Crossed(V2));
+        V1 = gp_Vec(PC,aPnts.Value(ip));
+        V2 = gp_Vec(PC,aPnts.Value(ip+1));
+        VN.Add(V1.Crossed(V2));
       }
       gp_Vec PathNorm;
       gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
       TopExp_Explorer WE;
       for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
-       TopoDS_Edge edge = TopoDS::Edge(WE.Current());
-       double tol = BRep_Tool::Tolerance(edge);
-       TopoDS_Vertex VF = sae.FirstVertex(edge);
-       gp_Pnt PF = BRep_Tool::Pnt(VF);
-       if( PF.Distance(PLoc) < tol ) {
-         double fp,lp;
-         Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-         gp_Pnt P1,P2;
-         C->D0(fp,P1);
-         if( P1.Distance(PLoc) < tol ) {
-           C->D0(fp+(lp-fp)/100,P2);
-         }
-         else {
-           C->D0(lp,P1);
-           C->D0(lp+(fp-lp)/100,P2);
-         }
-         PathNorm = gp_Vec(P2,P1);
-         break;
-       }
-       else {
-         TopoDS_Vertex VL = sae.LastVertex(edge);
-         gp_Pnt PL = BRep_Tool::Pnt(VL);
-         if( PL.Distance(PLoc) < tol ) {
-           double fp,lp;
-           Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-           gp_Pnt P1,P2;
-           C->D0(fp,P1);
-           if( P1.Distance(PLoc) < tol ) {
-             C->D0(fp+(lp-fp)/100,P2);
-           }
-           else {
-             C->D0(lp,P1);
-             C->D0(lp+(fp-lp)/100,P2);
-           }
-           PathNorm = gp_Vec(P2,P1);
-           break;
-         }
-       }
+        TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+        double tol = BRep_Tool::Tolerance(edge);
+        TopoDS_Vertex VF = sae.FirstVertex(edge);
+        gp_Pnt PF = BRep_Tool::Pnt(VF);
+        if( PF.Distance(PLoc) < tol ) {
+          double fp,lp;
+          Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+          gp_Pnt P1,P2;
+          C->D0(fp,P1);
+          if( P1.Distance(PLoc) < tol ) {
+            C->D0(fp+(lp-fp)/100,P2);
+          }
+          else {
+            C->D0(lp,P1);
+            C->D0(lp+(fp-lp)/100,P2);
+          }
+          PathNorm = gp_Vec(P2,P1);
+          break;
+        }
+        else {
+          TopoDS_Vertex VL = sae.LastVertex(edge);
+          gp_Pnt PL = BRep_Tool::Pnt(VL);
+          if( PL.Distance(PLoc) < tol ) {
+            double fp,lp;
+            Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+            gp_Pnt P1,P2;
+            C->D0(fp,P1);
+            if( P1.Distance(PLoc) < tol ) {
+              C->D0(fp+(lp-fp)/100,P2);
+            }
+            else {
+              C->D0(lp,P1);
+              C->D0(lp+(fp-lp)/100,P2);
+            }
+            PathNorm = gp_Vec(P2,P1);
+            break;
+          }
+        }
       }
       //cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
       //cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
       if(fabs(VN.Angle(PathNorm))>PI/2.)
-       aShBase2.Reverse();
+        aShBase2.Reverse();
     }
     */
 
@@ -1040,114 +1032,114 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       TopoDS_Shape aWire1, aWire2;
       // prepare aWire1
       if(aType1==TopAbs_SHELL) {
-       // create wire as boundary contour if shell is no closed
-       // get free boundary shapes
-       ShapeAnalysis_FreeBounds anAnalizer( aShBase1 );
-       TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
-       //TopExp_Explorer anExp;
-       Standard_Integer NbWires = 0;
-       for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
-         NbWires++;
-         aWire1 = anExp.Current();
-       }
-       if(NbWires!=1) {
-         // bad case
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Bad shell is used as section ");
-       }
+        // create wire as boundary contour if shell is no closed
+        // get free boundary shapes
+        ShapeAnalysis_FreeBounds anAnalizer( aShBase1 );
+        TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+        //TopExp_Explorer anExp;
+        Standard_Integer NbWires = 0;
+        for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+          NbWires++;
+          aWire1 = anExp.Current();
+        }
+        if(NbWires!=1) {
+          // bad case
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Bad shell is used as section ");
+        }
       }
       else { // aType1==TopAbs_FACE
-       TopExp_Explorer aExpW(aShBase1,TopAbs_WIRE);
-       aWire1 = aExpW.Current();
+        TopExp_Explorer aExpW(aShBase1,TopAbs_WIRE);
+        aWire1 = aExpW.Current();
       }
       // prepare aWire2
       if(aType2==TopAbs_SHELL) {
-       // create wire as boundary contour if shell is no closed
-       // get free boundary shapes
-       ShapeAnalysis_FreeBounds anAnalizer( aShBase2 );
-       TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
-       //TopExp_Explorer anExp;
-       Standard_Integer NbWires = 0;
-       for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
-         NbWires++;
-         aWire2 = anExp.Current();
-       }
-       if(NbWires!=1) {
-         // bad case
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Bad shell is used as section ");
-       }
+        // create wire as boundary contour if shell is no closed
+        // get free boundary shapes
+        ShapeAnalysis_FreeBounds anAnalizer( aShBase2 );
+        TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+        //TopExp_Explorer anExp;
+        Standard_Integer NbWires = 0;
+        for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+          NbWires++;
+          aWire2 = anExp.Current();
+        }
+        if(NbWires!=1) {
+          // bad case
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Bad shell is used as section ");
+        }
       }
       else { // aType2==TopAbs_FACE
-       TopExp_Explorer aExpW(aShBase2,TopAbs_WIRE);
-       aWire2 = aExpW.Current();
+        TopExp_Explorer aExpW(aShBase2,TopAbs_WIRE);
+        aWire2 = aExpW.Current();
       }
       // make pipe using aWire1 and aWire2
       if( !aWire1.IsNull() && !aWire2.IsNull() ) {
-       //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
-       BRepOffsetAPI_MakePipeShell aBuilder(WPath);
-       aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
-                    aWithContact, aWithCorrect);
-       aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
-                    aWithContact, aWithCorrect);
-       if(!aBuilder.IsReady()) {
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
-       }
-       aBuilder.Build();
-       TopoDS_Shape aShape = aBuilder.Shape();
-       TopoDS_Shell aShell;
-       B.MakeShell(aShell);
-       for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-         B.Add(aShell,anExp.Current());
-       }
-       for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-         B.Add(aShell,anExp.Current());
-       }
-       for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-         B.Add(aShell,anExp.Current());
-       }
-       // make sewing for this shell
-       Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
-       aSewing->SetTolerance(Precision::Confusion());
-       aSewing->SetFaceMode(Standard_True);
-       aSewing->SetFloatingEdgesMode(Standard_False);
-       aSewing->SetNonManifoldMode(Standard_False);
-       for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-         aSewing->Add(anExp.Current());
-       }
-       aSewing->Perform();
-       const TopoDS_Shape aSewShape = aSewing->SewedShape();
-       if( aSewShape.ShapeType() == TopAbs_SHELL ) {
-         aShell = TopoDS::Shell(aSewShape);
-         GProp_GProps aSystem;
-         BRepGProp::VolumeProperties(aShell, aSystem);
-         if(aSystem.Mass()<0) {
-           aShell.Reverse();
-         }
-         if(BRep_Tool::IsClosed(aShell)) {
-           TopoDS_Solid aSolid;
-           B.MakeSolid(aSolid);
-           B.Add(aSolid,aShell);
-           B.Add(aComp,aSolid);
-         }
-         else {
-           B.Add(aComp,aShell);
-         }
-       }
-       else {
-         B.Add(aComp,aShell);
-       }
+        //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+        BRepOffsetAPI_MakePipeShell aBuilder(WPath);
+        aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
+                     aWithContact, aWithCorrect);
+        aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
+                     aWithContact, aWithCorrect);
+        if(!aBuilder.IsReady()) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+        }
+        aBuilder.Build();
+        TopoDS_Shape aShape = aBuilder.Shape();
+        TopoDS_Shell aShell;
+        B.MakeShell(aShell);
+        for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+          B.Add(aShell,anExp.Current());
+        }
+        for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+          B.Add(aShell,anExp.Current());
+        }
+        for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+          B.Add(aShell,anExp.Current());
+        }
+        // make sewing for this shell
+        Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
+        aSewing->SetTolerance(Precision::Confusion());
+        aSewing->SetFaceMode(Standard_True);
+        aSewing->SetFloatingEdgesMode(Standard_False);
+        aSewing->SetNonManifoldMode(Standard_False);
+        for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+          aSewing->Add(anExp.Current());
+        }
+        aSewing->Perform();
+        const TopoDS_Shape aSewShape = aSewing->SewedShape();
+        if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+          aShell = TopoDS::Shell(aSewShape);
+          GProp_GProps aSystem;
+          BRepGProp::VolumeProperties(aShell, aSystem);
+          if(aSystem.Mass()<0) {
+            aShell.Reverse();
+          }
+          if(BRep_Tool::IsClosed(aShell)) {
+            TopoDS_Solid aSolid;
+            B.MakeSolid(aSolid);
+            B.Add(aSolid,aShell);
+            B.Add(aComp,aSolid);
+          }
+          else {
+            B.Add(aComp,aShell);
+          }
+        }
+        else {
+          B.Add(aComp,aShell);
+        }
       }
     }
     else {
       // main block - creation few solids (for each pair of faces)
       TopTools_MapOfShape aFaces1,aFaces2;
       for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-       aFaces1.Add(anExp.Current());
+        aFaces1.Add(anExp.Current());
       }
       for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-       aFaces2.Add(anExp.Current());
+        aFaces2.Add(anExp.Current());
       }
       // creating map of edge faces
       TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces1;
@@ -1159,220 +1151,219 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       TopTools_IndexedDataMapOfShapeShape FF;
       TopoDS_Shape FS1,FS2;
       if(nbSubBases==0) {
-       // find edge the most distant from location point
-       // (this edge is not shared by two faces)
-       double maxdist = 0.;
-       TopoDS_Shape E1;
-       TopoDS_Vertex V11,V21;
-       for(j=1; j<=aMapEdgeFaces1.Extent(); j++) {
-         TopoDS_Shape tmp = aMapEdgeFaces1.FindKey(j);
-         const TopTools_ListOfShape& aList = aMapEdgeFaces1.FindFromKey(tmp);
-         if(aList.Extent()>1)
-           continue;
-         TopExp_Explorer expv;
-         expv.Init( tmp, TopAbs_VERTEX );
-         TopoDS_Vertex V1 = TopoDS::Vertex(expv.Current());
-         expv.Next();
-         TopoDS_Vertex V2 = TopoDS::Vertex(expv.Current());
-         gp_Pnt P1 = BRep_Tool::Pnt(V1);
-         gp_Pnt P2 = BRep_Tool::Pnt(V2);
-         double dist = PLocs.Value(i).Distance(P1) + PLocs.Value(i).Distance(P2);
-         if(dist>maxdist) {
-           E1 = tmp;
-           V11 = V1;
-           V21 = V2;
-           TopTools_ListIteratorOfListOfShape anIter(aList);
-           FS1 = anIter.Value();
-           maxdist = dist;
-         }
-       }
-       // main direction for comparing
-       gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1));
-       // find corresponding edge from next section
-       double minang = PI;
-       gp_Pnt P11 = BRep_Tool::Pnt(V11);
-       gp_Pnt P21 = BRep_Tool::Pnt(V21);
-       TopoDS_Shape E2;
-       TopoDS_Vertex V12,V22;
-       for(j=1; j<=aMapEdgeFaces2.Extent(); j++) {
-         TopoDS_Shape tmp = aMapEdgeFaces2.FindKey(j);
-         const TopTools_ListOfShape& aList = aMapEdgeFaces2.FindFromKey(tmp);
-         if(aList.Extent()>1)
-           continue;
-         TopExp_Explorer expv;
-         expv.Init( tmp, TopAbs_VERTEX );
-         TopoDS_Vertex V1tmp = TopoDS::Vertex(expv.Current());
-         expv.Next();
-         TopoDS_Vertex V2tmp = TopoDS::Vertex(expv.Current());
-         gp_Pnt P1tmp = BRep_Tool::Pnt(V1tmp);
-         gp_Pnt P2tmp = BRep_Tool::Pnt(V2tmp);
-         double d1 = P1tmp.Distance(P11) + P2tmp.Distance(P21);
-         double d2 = P1tmp.Distance(P21) + P2tmp.Distance(P11);
-         TopoDS_Vertex V1,V2;
-         gp_Pnt P1,P2;
-         if(d1>d2) {
-           V1 = V2tmp; P1 = P2tmp;
-           V2 = V1tmp; P2 = P1tmp;
-         }
-         else {
-           V1 = V1tmp; P1 = P1tmp;
-           V2 = V2tmp; P2 = P2tmp;
-         }
-         gp_Vec Vec1(P11,P1);
-         gp_Vec Vec2(P21,P2);
-         double ang = fabs(Vec1.Angle(VM)) + fabs(Vec2.Angle(VM));
-         if(ang<minang) {
-           E2 = tmp;
-           V12 = V1;
-           V22 = V2;
-           TopTools_ListIteratorOfListOfShape anIter(aList);
-           FS2 = anIter.Value();
-           minang = ang;
-         }
-       }
-       // put all pairs to map FF
-       FF.Add(FS1,FS2);
-       FF.Add(E1,E2);
-       FF.Add(V11,V12);
-       FF.Add(V21,V22);
-
-       // add pairs of edges to FF
-       bool stat =  FillForOtherEdges(FS1,E1,V11,FF);
-       if( !stat ) {
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("FindForOtherEdges: Can not mapping other egdes");
-       }
+        // find edge the most distant from location point
+        // (this edge is not shared by two faces)
+        double maxdist = 0.;
+        TopoDS_Shape E1;
+        TopoDS_Vertex V11,V21;
+        for(j=1; j<=aMapEdgeFaces1.Extent(); j++) {
+          TopoDS_Shape tmp = aMapEdgeFaces1.FindKey(j);
+          const TopTools_ListOfShape& aList = aMapEdgeFaces1.FindFromKey(tmp);
+          if(aList.Extent()>1)
+            continue;
+          TopExp_Explorer expv;
+          expv.Init( tmp, TopAbs_VERTEX );
+          TopoDS_Vertex V1 = TopoDS::Vertex(expv.Current());
+          expv.Next();
+          TopoDS_Vertex V2 = TopoDS::Vertex(expv.Current());
+          gp_Pnt P1 = BRep_Tool::Pnt(V1);
+          gp_Pnt P2 = BRep_Tool::Pnt(V2);
+          double dist = PLocs.Value(i).Distance(P1) + PLocs.Value(i).Distance(P2);
+          if(dist>maxdist) {
+            E1 = tmp;
+            V11 = V1;
+            V21 = V2;
+            TopTools_ListIteratorOfListOfShape anIter(aList);
+            FS1 = anIter.Value();
+            maxdist = dist;
+          }
+        }
+        // main direction for comparing
+        gp_Vec VM(PLocs.Value(i),PLocs.Value(i+1));
+        // find corresponding edge from next section
+        double minang = PI;
+        gp_Pnt P11 = BRep_Tool::Pnt(V11);
+        gp_Pnt P21 = BRep_Tool::Pnt(V21);
+        TopoDS_Shape E2;
+        TopoDS_Vertex V12,V22;
+        for(j=1; j<=aMapEdgeFaces2.Extent(); j++) {
+          TopoDS_Shape tmp = aMapEdgeFaces2.FindKey(j);
+          const TopTools_ListOfShape& aList = aMapEdgeFaces2.FindFromKey(tmp);
+          if(aList.Extent()>1)
+            continue;
+          TopExp_Explorer expv;
+          expv.Init( tmp, TopAbs_VERTEX );
+          TopoDS_Vertex V1tmp = TopoDS::Vertex(expv.Current());
+          expv.Next();
+          TopoDS_Vertex V2tmp = TopoDS::Vertex(expv.Current());
+          gp_Pnt P1tmp = BRep_Tool::Pnt(V1tmp);
+          gp_Pnt P2tmp = BRep_Tool::Pnt(V2tmp);
+          double d1 = P1tmp.Distance(P11) + P2tmp.Distance(P21);
+          double d2 = P1tmp.Distance(P21) + P2tmp.Distance(P11);
+          TopoDS_Vertex V1,V2;
+          gp_Pnt P1,P2;
+          if(d1>d2) {
+            V1 = V2tmp; P1 = P2tmp;
+            V2 = V1tmp; P2 = P1tmp;
+          }
+          else {
+            V1 = V1tmp; P1 = P1tmp;
+            V2 = V2tmp; P2 = P2tmp;
+          }
+          gp_Vec Vec1(P11,P1);
+          gp_Vec Vec2(P21,P2);
+          double ang = fabs(Vec1.Angle(VM)) + fabs(Vec2.Angle(VM));
+          if(ang<minang) {
+            E2 = tmp;
+            V12 = V1;
+            V22 = V2;
+            TopTools_ListIteratorOfListOfShape anIter(aList);
+            FS2 = anIter.Value();
+            minang = ang;
+          }
+        }
+        // put all pairs to map FF
+        FF.Add(FS1,FS2);
+        FF.Add(E1,E2);
+        FF.Add(V11,V12);
+        FF.Add(V21,V22);
+
+        // add pairs of edges to FF
+        bool stat =  FillForOtherEdges(FS1,E1,V11,FF);
+        if( !stat ) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("FindForOtherEdges: Can not mapping other egdes");
+        }
 
       }
       else {
-       { // 1 section
-         Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i);
-         if(anItem.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
-         if(aRefBase.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         TopoDS_Shape aSh = aRefBase->GetValue();
-         if(aSh.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         if(aSh.ShapeType()!=TopAbs_FACE) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         FS1 = aSh;
-       }
-       { // 2 section
-         Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i+1);
-         if(anItem.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
-         if(aRefBase.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         TopoDS_Shape aSh = aRefBase->GetValue();
-         if(aSh.IsNull()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         if(aSh.ShapeType()!=TopAbs_FACE) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid subbase shape");
-         }
-         FS2 = aSh;
-       }
-
-       if( !aFaces1.Contains(FS1) || !aFaces2.Contains(FS2) ) {
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Invalid subbase shape");
-       }
-
-       FF.Add(FS1,FS2);
-
-       // add pairs of edges to FF
-       bool stat =  FillCorrespondingEdges(FS1, FS2, TopoDS::Vertex(VLocs(i)),
-                                           TopoDS::Vertex(VLocs(i+1)), WPath, FF);
-       if( !stat ) {
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Can not create correct pipe");
-       }
+        { // 1 section
+          Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i);
+          if(anItem.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
+          if(aRefBase.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          TopoDS_Shape aSh = aRefBase->GetValue();
+          if(aSh.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          if(aSh.ShapeType()!=TopAbs_FACE) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          FS1 = aSh;
+        }
+        { // 2 section
+          Handle(Standard_Transient) anItem = aSubBasesObjs->Value(i+1);
+          if(anItem.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
+          if(aRefBase.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          TopoDS_Shape aSh = aRefBase->GetValue();
+          if(aSh.IsNull()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          if(aSh.ShapeType()!=TopAbs_FACE) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid subbase shape");
+          }
+          FS2 = aSh;
+        }
+
+        if( !aFaces1.Contains(FS1) || !aFaces2.Contains(FS2) ) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Invalid subbase shape");
+        }
+
+        FF.Add(FS1,FS2);
+
+        // add pairs of edges to FF
+        bool stat =  FillCorrespondingEdges(FS1, FS2, TopoDS::Vertex(VLocs(i)),
+                                            TopoDS::Vertex(VLocs(i+1)), WPath, FF);
+        if( !stat ) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Can not create correct pipe");
+        }
       }
 
       FindNextPairOfFaces(FS1, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
 
-
       // make pipe for each pair of faces
       for(j=1; j<=FF.Extent(); j++) {
-       TopoDS_Shape F1 = FF.FindKey(j);
-       if( F1.ShapeType() != TopAbs_FACE )
-         continue;
-       TopoDS_Shape F2 = FF.FindFromIndex(j);
-       TopExp_Explorer aExpW1(F1,TopAbs_WIRE);
-       TopoDS_Wire aWire1 = TopoDS::Wire(aExpW1.Current());
-       TopExp_Explorer aExpW2(F2,TopAbs_WIRE);
-       TopoDS_Wire aWire2 = TopoDS::Wire(aExpW2.Current());
-       // make pipe using aWire1 and aWire2
-       if( !aWire1.IsNull() && !aWire2.IsNull() ) {
-         BRepOffsetAPI_MakePipeShell aBuilder(WPath);
-         aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
-                      aWithContact, aWithCorrect);
-         aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
-                      aWithContact, aWithCorrect);
-         if(!aBuilder.IsReady()) {
-           if(aCI) delete aCI;
-           Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
-         }
-         aBuilder.Build();
-         TopoDS_Shape aShape = aBuilder.Shape();
-         TopoDS_Shell aShell;
-         B.MakeShell(aShell);
-         for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-           B.Add(aShell,anExp.Current());
-         }
-
-         B.Add(aShell,F1);
-         B.Add(aShell,F2);
-         // make sewing for this shell
-         Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
-         aSewing->SetTolerance(Precision::Confusion());
-         aSewing->SetFaceMode(Standard_True);
-         aSewing->SetFloatingEdgesMode(Standard_False);
-         aSewing->SetNonManifoldMode(Standard_False);
-         for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-           aSewing->Add(anExp.Current());
-         }
-         aSewing->Perform();
-         const TopoDS_Shape aSewShape = aSewing->SewedShape();
-         if( aSewShape.ShapeType() == TopAbs_SHELL ) {
-           aShell = TopoDS::Shell(aSewShape);
-           GProp_GProps aSystem;
-           BRepGProp::VolumeProperties(aShell, aSystem);
-           if(aSystem.Mass()<0) {
-             //cout<<"aSewShape is reversed"<<endl;
-             aShell.Reverse();
-           }
-           if(BRep_Tool::IsClosed(aShell)) {
-             TopoDS_Solid aSolid;
-             B.MakeSolid(aSolid);
-             B.Add(aSolid,aShell);
-             B.Add(aComp,aSolid);
-           }
-           else {
-             B.Add(aComp,aShell);
-           }
-         }
-         else {
-           B.Add(aComp,aShell);
-         }
-       }
+        TopoDS_Shape F1 = FF.FindKey(j);
+        if( F1.ShapeType() != TopAbs_FACE )
+          continue;
+        TopoDS_Shape F2 = FF.FindFromIndex(j);
+        TopExp_Explorer aExpW1(F1,TopAbs_WIRE);
+        TopoDS_Wire aWire1 = TopoDS::Wire(aExpW1.Current());
+        TopExp_Explorer aExpW2(F2,TopAbs_WIRE);
+        TopoDS_Wire aWire2 = TopoDS::Wire(aExpW2.Current());
+        // make pipe using aWire1 and aWire2
+        if( !aWire1.IsNull() && !aWire2.IsNull() ) {
+          BRepOffsetAPI_MakePipeShell aBuilder(WPath);
+          aBuilder.Add(aWire1, TopoDS::Vertex(VLocs(i)),
+                       aWithContact, aWithCorrect);
+          aBuilder.Add(aWire2, TopoDS::Vertex(VLocs(i+1)),
+                       aWithContact, aWithCorrect);
+          if(!aBuilder.IsReady()) {
+            if(aCI) delete aCI;
+            Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+          }
+          aBuilder.Build();
+          TopoDS_Shape aShape = aBuilder.Shape();
+          TopoDS_Shell aShell;
+          B.MakeShell(aShell);
+          for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+            B.Add(aShell,anExp.Current());
+          }
+
+          B.Add(aShell,F1);
+          B.Add(aShell,F2);
+          // make sewing for this shell
+          Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
+          aSewing->SetTolerance(Precision::Confusion());
+          aSewing->SetFaceMode(Standard_True);
+          aSewing->SetFloatingEdgesMode(Standard_False);
+          aSewing->SetNonManifoldMode(Standard_False);
+          for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+            aSewing->Add(anExp.Current());
+          }
+          aSewing->Perform();
+          const TopoDS_Shape aSewShape = aSewing->SewedShape();
+          if( aSewShape.ShapeType() == TopAbs_SHELL ) {
+            aShell = TopoDS::Shell(aSewShape);
+            GProp_GProps aSystem;
+            BRepGProp::VolumeProperties(aShell, aSystem);
+            if(aSystem.Mass()<0) {
+              //cout<<"aSewShape is reversed"<<endl;
+              aShell.Reverse();
+            }
+            if(BRep_Tool::IsClosed(aShell)) {
+              TopoDS_Solid aSolid;
+              B.MakeSolid(aSolid);
+              B.Add(aSolid,aShell);
+              B.Add(aComp,aSolid);
+            }
+            else {
+              B.Add(aComp,aShell);
+            }
+          }
+          else {
+            B.Add(aComp,aShell);
+          }
+        }
       }
 
     }
@@ -1382,7 +1373,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
   return aComp;
 }
 
-
 //=======================================================================
 //function : CreatePipeShellsWithoutPath
 //purpose  : auxilary for Execute()
@@ -1407,7 +1397,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
     Standard_ConstructionError::Raise("Number of shapes for recognition is invalid");
   }
 
-
   TopTools_SequenceOfShape SecVs,Bases;
   for(i=1; i<=nbBases; i++) {
     // vertex
@@ -1439,7 +1428,7 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
   TopoDS_Compound aComp;
   B.MakeCompound(aComp);
 
-  for(i=1 ; i<nbBases; i++) {
+  for (i = 1; i < nbBases; i++) {
     MESSAGE ("Make pipe between sections "<<i<<" and "<<i+1);
     TopoDS_Shape aShBase1 = Bases.Value(i);
     TopoDS_Shape aShBase2 = Bases.Value(i+1);
@@ -1503,7 +1492,7 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
     for(j=1; j<=FF.Extent(); j++) {
       TopoDS_Shape F1 = FF.FindKey(j);
       if( F1.ShapeType() != TopAbs_FACE )
-       continue;
+        continue;
       TopoDS_Shape F2 = FF.FindFromIndex(j);
       nbff++;
 
@@ -1513,28 +1502,28 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
 
       Handle(Geom_Surface) S1 = BRep_Tool::Surface(TopoDS::Face(F1));
       if(S1->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
-       Handle(Geom_RectangularTrimmedSurface) RTS =
-         Handle(Geom_RectangularTrimmedSurface)::DownCast(S1);
-       S1 = RTS->BasisSurface();
+        Handle(Geom_RectangularTrimmedSurface) RTS =
+          Handle(Geom_RectangularTrimmedSurface)::DownCast(S1);
+        S1 = RTS->BasisSurface();
       }
       Handle(Geom_Plane) Pln1 = Handle(Geom_Plane)::DownCast(S1);
       if( Pln1.IsNull() ) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise("Surface from face is not plane");
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise("Surface from face is not plane");
       }
       gp_Vec aDir1(Pln1->Axis().Direction());
 
       Handle(Geom_Surface) S2 = BRep_Tool::Surface(TopoDS::Face(F2));
       if(S2->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
-       Handle(Geom_RectangularTrimmedSurface) RTS =
-         Handle(Geom_RectangularTrimmedSurface)::DownCast(S2);
-       S2 = RTS->BasisSurface();
+        Handle(Geom_RectangularTrimmedSurface) RTS =
+          Handle(Geom_RectangularTrimmedSurface)::DownCast(S2);
+        S2 = RTS->BasisSurface();
       }
       Handle(Geom_Plane) Pln2 =
-         Handle(Geom_Plane)::DownCast(S2);
+          Handle(Geom_Plane)::DownCast(S2);
       if( Pln2.IsNull() ) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise("Surface from face is not plane");
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise("Surface from face is not plane");
       }
       gp_Vec aDir2(Pln2->Axis().Direction());
 
@@ -1542,247 +1531,247 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
       gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(SecVs(i+1)));
       gp_Vec aDir(P1,P2);
       if(fabs(aDir.Angle(aDir1))>PI/2.)
-       aDir1.Reverse();
+        aDir1.Reverse();
       if(fabs(aDir.Angle(aDir2))>PI/2.)
-       aDir2.Reverse();
+        aDir2.Reverse();
 
       TopExp_Explorer anExpE(F1,TopAbs_EDGE);
       TopTools_SequenceOfShape aNewFs;
       //int nbee=0;
       for(; anExpE.More(); anExpE.Next()) {
-       TopoDS_Edge E1 = TopoDS::Edge(anExpE.Current());
-       //nbee++;
-       if(!FF.Contains(E1))
-         MESSAGE ("map FF not contains key E1");
+        TopoDS_Edge E1 = TopoDS::Edge(anExpE.Current());
+        //nbee++;
+        if(!FF.Contains(E1))
+          MESSAGE ("map FF not contains key E1");
 
-       if(VPE.Contains(E1)) {
-         aNewFs.Append(VPE.FindFromKey(E1));
+        if(VPE.Contains(E1)) {
+          aNewFs.Append(VPE.FindFromKey(E1));
 #ifdef _DEBUG_
-         MESSAGE ("    using existed face");
+          MESSAGE ("    using existed face");
 #endif
-         continue;
-       }
-
-       TopoDS_Edge E3 = TopoDS::Edge(FF.FindFromKey(E1));
-       TopoDS_Vertex V1 = sae.FirstVertex(E1);
-       TopoDS_Vertex V2 = sae.LastVertex(E1);
-       if(!FF.Contains(V1))
-         MESSAGE ("map FF not contains key V1");
-       if(!FF.Contains(V2))
-         MESSAGE ("map FF not contains key V2");
-       TopoDS_Vertex V3 = TopoDS::Vertex(FF.FindFromKey(V2));
-       TopoDS_Vertex V4 = TopoDS::Vertex(FF.FindFromKey(V1));
-       TopoDS_Vertex Vtmp = sae.FirstVertex(E3);
-       if(Vtmp.IsSame(V4))
-         E3.Reverse();
-       gp_Pnt P1 = BRep_Tool::Pnt(V1);
-       gp_Pnt P2 = BRep_Tool::Pnt(V2);
-       gp_Pnt P3 = BRep_Tool::Pnt(V3);
-       gp_Pnt P4 = BRep_Tool::Pnt(V4);
-       // make E2
-       TopoDS_Edge E2;
-       Handle(Geom_BSplineCurve) C2;
-       if(VPE.Contains(V2)) {
-         E2 = TopoDS::Edge(VPE.FindFromKey(V2));
-         double fp,lp;
-         C2 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E2,fp,lp));
-       }
-       else {
-         Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
-         HAP->SetValue(1,P2);
-         HAP->SetValue(2,P3);
-         GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
-         anInt.Load(aDir1,aDir2);
-         anInt.Perform();
-         C2 = anInt.Curve();
-         B.MakeEdge(E2,C2,1.e-7);
-         B.Add(E2,TopoDS::Vertex(V2.Oriented(TopAbs_FORWARD)));
-         B.Add(E2,TopoDS::Vertex(V3.Oriented(TopAbs_REVERSED)));
-         VPE.Add(V2,E2);
-       }
-       // make E4
-       TopoDS_Edge E4;
-       Handle(Geom_BSplineCurve) C4;
-       if(VPE.Contains(V1)) {
-         E4 = TopoDS::Edge(VPE.FindFromKey(V1));
-         double fp,lp;
-         C4 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E4,fp,lp));
-       }
-       else {
-         Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
-         HAP->SetValue(1,P1);
-         HAP->SetValue(2,P4);
-         GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
-         anInt.Load(aDir1,aDir2);
-         anInt.Perform();
-         C4 = anInt.Curve();
-         B.MakeEdge(E4,anInt.Curve(),1.e-7);
-         B.Add(E4,TopoDS::Vertex(V1.Oriented(TopAbs_FORWARD)));
-         B.Add(E4,TopoDS::Vertex(V4.Oriented(TopAbs_REVERSED)));
-         VPE.Add(V1,E4);
-       }
-
-       TopoDS_Wire W;
-       B.MakeWire(W);
-       B.Add(W,E1);
-       B.Add(W,E2);
-       B.Add(W,E3);
-       B.Add(W,E4.Reversed());
-       //cout<<"      wire for edge "<<nbee<<" is created"<<endl;
-       //BRepTools::Write(W,"/dn02/users_Linux/skl/work/Bugs/14857/w.brep");
-
-       // make surface
-
-       double fp,lp;
-       Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1,fp,lp);
-       //bool IsConicC1 = false;
-       //if( C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
-       //  IsConicC1 = true;
-       //  cout<<"C1 - Geom_Conic"<<endl;
-       //}
-       if( C1->IsKind(STANDARD_TYPE(Geom_Line)) || C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
-         C1 = new Geom_TrimmedCurve(C1,fp,lp);
-       }
-       //if(IsConicC1) {
-       //  double tol = BRep_Tool::Tolerance(E1);
-       //  GeomConvert_ApproxCurve ApxC1(C1,tol,GeomAbs_C1,10,5);
-       //  C1 = ApxC1.Curve();
-       //}
-       Handle(Geom_Curve) C3 = BRep_Tool::Curve(E3,fp,lp);
-       if( C3->IsKind(STANDARD_TYPE(Geom_Line)) || C3->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
-         C3 = new Geom_TrimmedCurve(C3,fp,lp);
-       }
-       //filebuf fic;
-       //ostream os(&fic);
-       //os.precision(15);
-       Handle(Geom_BSplineCurve) CE1 =
-         GeomConvert::CurveToBSplineCurve(C1,Convert_RationalC1);
-       if(CE1->Degree()<3)
-         CE1->IncreaseDegree(3);
-       Handle(Geom_BSplineCurve) CE2 =
-         GeomConvert::CurveToBSplineCurve(C2,Convert_RationalC1);
-       if(CE2->Degree()<3)
-         CE2->IncreaseDegree(3);
-       Handle(Geom_BSplineCurve) CE3 =
-         GeomConvert::CurveToBSplineCurve(C3,Convert_RationalC1);
-       if(CE3->Degree()<3)
-         CE3->IncreaseDegree(3);
-       Handle(Geom_BSplineCurve) CE4 =
-         GeomConvert::CurveToBSplineCurve(C4,Convert_RationalC1);
-       if(CE4->Degree()<3)
-         CE4->IncreaseDegree(3);
-       //cout<<"CE1->Degree()="<<CE1->Degree()<<" CE2->Degree()="<<CE2->Degree()
-       //    <<" CE3->Degree()="<<CE3->Degree()<<" CE4->Degree()="<<CE4->Degree()<<endl;
-       //if(fic.open("/dn02/users_Linux/skl/work/Bugs/14857/ce1.brep",ios::out)) {
-       //  os<<"DrawTrSurf_BSplineCurve"<<endl;
-       //  GeomTools::Write(CE1,os);
-       //  fic.close();
-       //}
-
-       Handle(Geom_Surface) BS;
-       try {
-         GeomFill_BSplineCurves GF(CE1,CE2,CE3,CE4,GeomFill_CoonsStyle);
-         //GeomFill_BSplineCurves GF(CE1,CE2,CE3,CE4,GeomFill_StretchStyle);
-         BS = GF.Surface();
-       }
-       catch(...) {
-         MESSAGE ("      can not create BSplineSurface - create Bezier");
-         int NbP=26;
-         TColgp_Array2OfPnt Points(1,NbP,1,NbP);
-         double fp1,lp1,fp2,lp2;
-         Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1,fp1,lp1);
-         Handle(Geom_Curve) C3 = BRep_Tool::Curve(E3,fp2,lp2);
-         gp_Pnt P1C1,P2C1;
-         C1->D0(fp1,P1C1);
-         C1->D0(lp1,P2C1);
-         gp_Pnt P1C3,P2C3;
-         C3->D0(fp2,P1C3);
-         C3->D0(lp2,P2C3);
-         int n1,n2;
-         double fp,lp;
-         // get points from C1
-         if(P1.Distance(P1C1)<1.e-6) {
-           fp = fp1;
-           lp = lp1;
-         }
-         else {
-           fp = lp1;
-           lp = fp1;
-         }
-         double step = (lp-fp)/(NbP-1);
-         Points.SetValue(1,1,P1);
-         double par = fp;
-         for(n1=2; n1<NbP; n1++) {
-           gp_Pnt P;
-           par += step;
-           C1->D0(par,P);
-           Points.SetValue(1,n1,P);
-         }
-         Points.SetValue(1,NbP,P2);
-         // get points from C3
-         if(P4.Distance(P1C3)<1.e-6) {
-           fp = fp2;
-           lp = lp2;
-         }
-         else {
-           fp = lp2;
-           lp = fp2;
-         }
-         step = (lp-fp)/(NbP-1);
-         Points.SetValue(NbP,1,P4);
-         par = fp;
-         for(n1=2; n1<NbP; n1++) {
-           gp_Pnt P;
-           par += step;
-           C3->D0(par,P);
-           Points.SetValue(NbP,n1,P);
-         }
-         Points.SetValue(NbP,NbP,P3);
-         // create isolines and get points from them
-         for(n1=1; n1<=NbP; n1++) {
-           gp_Pnt PI1 = Points.Value(1,n1);
-           gp_Pnt PI2 = Points.Value(NbP,n1);
-           Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
-           HAP->SetValue(1,PI1);
-           HAP->SetValue(2,PI2);
-           GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
-           anInt.Load(aDir1,aDir2);
-           anInt.Perform();
-           Handle(Geom_Curve) iso = anInt.Curve();
-           fp = iso->FirstParameter();
-           lp = iso->LastParameter();
-           step = (lp-fp)/(NbP-1);
-           par = fp;
-           TopoDS_Compound VComp;
-           B.MakeCompound(VComp);
-           for(n2=2; n2<NbP; n2++) {
-             gp_Pnt P;
-             par += step;
-             iso->D0(par,P);
-             Points.SetValue(n2,n1,P);
-           }
-         }
-         // create surface and face
-         //Handle(Geom_BezierSurface) BS = new Geom_BezierSurface(Points);
-         BS = new Geom_BezierSurface(Points);
-       }
-
-       BRepBuilderAPI_MakeFace BB(BS,W);
-       TopoDS_Face NewF = BB.Face();
-       Handle(ShapeFix_Face) sff = new ShapeFix_Face(NewF);
-       sff->Perform();
-       sff->FixOrientation();
-       TopoDS_Face FixedFace = sff->Face();
-       aNewFs.Append(FixedFace);
-       VPE.Add(E1,FixedFace);
-       //cout<<"      face for edge "<<nbee<<" is created"<<endl;
-       //BRepTools::Write(FixedFace,"/dn02/users_Linux/skl/work/Bugs/14857/f.brep");
+          continue;
+        }
+
+        TopoDS_Edge E3 = TopoDS::Edge(FF.FindFromKey(E1));
+        TopoDS_Vertex V1 = sae.FirstVertex(E1);
+        TopoDS_Vertex V2 = sae.LastVertex(E1);
+        if(!FF.Contains(V1))
+          MESSAGE ("map FF not contains key V1");
+        if(!FF.Contains(V2))
+          MESSAGE ("map FF not contains key V2");
+        TopoDS_Vertex V3 = TopoDS::Vertex(FF.FindFromKey(V2));
+        TopoDS_Vertex V4 = TopoDS::Vertex(FF.FindFromKey(V1));
+        TopoDS_Vertex Vtmp = sae.FirstVertex(E3);
+        if(Vtmp.IsSame(V4))
+          E3.Reverse();
+        gp_Pnt P1 = BRep_Tool::Pnt(V1);
+        gp_Pnt P2 = BRep_Tool::Pnt(V2);
+        gp_Pnt P3 = BRep_Tool::Pnt(V3);
+        gp_Pnt P4 = BRep_Tool::Pnt(V4);
+        // make E2
+        TopoDS_Edge E2;
+        Handle(Geom_BSplineCurve) C2;
+        if(VPE.Contains(V2)) {
+          E2 = TopoDS::Edge(VPE.FindFromKey(V2));
+          double fp,lp;
+          C2 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E2,fp,lp));
+        }
+        else {
+          Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
+          HAP->SetValue(1,P2);
+          HAP->SetValue(2,P3);
+          GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
+          anInt.Load(aDir1,aDir2);
+          anInt.Perform();
+          C2 = anInt.Curve();
+          B.MakeEdge(E2,C2,1.e-7);
+          B.Add(E2,TopoDS::Vertex(V2.Oriented(TopAbs_FORWARD)));
+          B.Add(E2,TopoDS::Vertex(V3.Oriented(TopAbs_REVERSED)));
+          VPE.Add(V2,E2);
+        }
+        // make E4
+        TopoDS_Edge E4;
+        Handle(Geom_BSplineCurve) C4;
+        if(VPE.Contains(V1)) {
+          E4 = TopoDS::Edge(VPE.FindFromKey(V1));
+          double fp,lp;
+          C4 = Handle(Geom_BSplineCurve)::DownCast(BRep_Tool::Curve(E4,fp,lp));
+        }
+        else {
+          Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
+          HAP->SetValue(1,P1);
+          HAP->SetValue(2,P4);
+          GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
+          anInt.Load(aDir1,aDir2);
+          anInt.Perform();
+          C4 = anInt.Curve();
+          B.MakeEdge(E4,anInt.Curve(),1.e-7);
+          B.Add(E4,TopoDS::Vertex(V1.Oriented(TopAbs_FORWARD)));
+          B.Add(E4,TopoDS::Vertex(V4.Oriented(TopAbs_REVERSED)));
+          VPE.Add(V1,E4);
+        }
+
+        TopoDS_Wire W;
+        B.MakeWire(W);
+        B.Add(W,E1);
+        B.Add(W,E2);
+        B.Add(W,E3);
+        B.Add(W,E4.Reversed());
+        //cout<<"      wire for edge "<<nbee<<" is created"<<endl;
+        //BRepTools::Write(W,"/dn02/users_Linux/skl/work/Bugs/14857/w.brep");
+
+        // make surface
+
+        double fp,lp;
+        Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1,fp,lp);
+        //bool IsConicC1 = false;
+        //if( C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+        //  IsConicC1 = true;
+        //  cout<<"C1 - Geom_Conic"<<endl;
+        //}
+        if( C1->IsKind(STANDARD_TYPE(Geom_Line)) || C1->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+          C1 = new Geom_TrimmedCurve(C1,fp,lp);
+        }
+        //if(IsConicC1) {
+        //  double tol = BRep_Tool::Tolerance(E1);
+        //  GeomConvert_ApproxCurve ApxC1(C1,tol,GeomAbs_C1,10,5);
+        //  C1 = ApxC1.Curve();
+        //}
+        Handle(Geom_Curve) C3 = BRep_Tool::Curve(E3,fp,lp);
+        if( C3->IsKind(STANDARD_TYPE(Geom_Line)) || C3->IsKind(STANDARD_TYPE(Geom_Conic)) ) {
+          C3 = new Geom_TrimmedCurve(C3,fp,lp);
+        }
+        //filebuf fic;
+        //ostream os(&fic);
+        //os.precision(15);
+        Handle(Geom_BSplineCurve) CE1 =
+          GeomConvert::CurveToBSplineCurve(C1,Convert_RationalC1);
+        if(CE1->Degree()<3)
+          CE1->IncreaseDegree(3);
+        Handle(Geom_BSplineCurve) CE2 =
+          GeomConvert::CurveToBSplineCurve(C2,Convert_RationalC1);
+        if(CE2->Degree()<3)
+          CE2->IncreaseDegree(3);
+        Handle(Geom_BSplineCurve) CE3 =
+          GeomConvert::CurveToBSplineCurve(C3,Convert_RationalC1);
+        if(CE3->Degree()<3)
+          CE3->IncreaseDegree(3);
+        Handle(Geom_BSplineCurve) CE4 =
+          GeomConvert::CurveToBSplineCurve(C4,Convert_RationalC1);
+        if(CE4->Degree()<3)
+          CE4->IncreaseDegree(3);
+        //cout<<"CE1->Degree()="<<CE1->Degree()<<" CE2->Degree()="<<CE2->Degree()
+        //    <<" CE3->Degree()="<<CE3->Degree()<<" CE4->Degree()="<<CE4->Degree()<<endl;
+        //if(fic.open("/dn02/users_Linux/skl/work/Bugs/14857/ce1.brep",ios::out)) {
+        //  os<<"DrawTrSurf_BSplineCurve"<<endl;
+        //  GeomTools::Write(CE1,os);
+        //  fic.close();
+        //}
+
+        Handle(Geom_Surface) BS;
+        try {
+          GeomFill_BSplineCurves GF(CE1,CE2,CE3,CE4,GeomFill_CoonsStyle);
+          //GeomFill_BSplineCurves GF(CE1,CE2,CE3,CE4,GeomFill_StretchStyle);
+          BS = GF.Surface();
+        }
+        catch(...) {
+          MESSAGE ("      can not create BSplineSurface - create Bezier");
+          int NbP=26;
+          TColgp_Array2OfPnt Points(1,NbP,1,NbP);
+          double fp1,lp1,fp2,lp2;
+          Handle(Geom_Curve) C1 = BRep_Tool::Curve(E1,fp1,lp1);
+          Handle(Geom_Curve) C3 = BRep_Tool::Curve(E3,fp2,lp2);
+          gp_Pnt P1C1,P2C1;
+          C1->D0(fp1,P1C1);
+          C1->D0(lp1,P2C1);
+          gp_Pnt P1C3,P2C3;
+          C3->D0(fp2,P1C3);
+          C3->D0(lp2,P2C3);
+          int n1,n2;
+          double fp,lp;
+          // get points from C1
+          if(P1.Distance(P1C1)<1.e-6) {
+            fp = fp1;
+            lp = lp1;
+          }
+          else {
+            fp = lp1;
+            lp = fp1;
+          }
+          double step = (lp-fp)/(NbP-1);
+          Points.SetValue(1,1,P1);
+          double par = fp;
+          for(n1=2; n1<NbP; n1++) {
+            gp_Pnt P;
+            par += step;
+            C1->D0(par,P);
+            Points.SetValue(1,n1,P);
+          }
+          Points.SetValue(1,NbP,P2);
+          // get points from C3
+          if(P4.Distance(P1C3)<1.e-6) {
+            fp = fp2;
+            lp = lp2;
+          }
+          else {
+            fp = lp2;
+            lp = fp2;
+          }
+          step = (lp-fp)/(NbP-1);
+          Points.SetValue(NbP,1,P4);
+          par = fp;
+          for(n1=2; n1<NbP; n1++) {
+            gp_Pnt P;
+            par += step;
+            C3->D0(par,P);
+            Points.SetValue(NbP,n1,P);
+          }
+          Points.SetValue(NbP,NbP,P3);
+          // create isolines and get points from them
+          for(n1=1; n1<=NbP; n1++) {
+            gp_Pnt PI1 = Points.Value(1,n1);
+            gp_Pnt PI2 = Points.Value(NbP,n1);
+            Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,2);
+            HAP->SetValue(1,PI1);
+            HAP->SetValue(2,PI2);
+            GeomAPI_Interpolate anInt(HAP,Standard_False,1.e-7);
+            anInt.Load(aDir1,aDir2);
+            anInt.Perform();
+            Handle(Geom_Curve) iso = anInt.Curve();
+            fp = iso->FirstParameter();
+            lp = iso->LastParameter();
+            step = (lp-fp)/(NbP-1);
+            par = fp;
+            TopoDS_Compound VComp;
+            B.MakeCompound(VComp);
+            for(n2=2; n2<NbP; n2++) {
+              gp_Pnt P;
+              par += step;
+              iso->D0(par,P);
+              Points.SetValue(n2,n1,P);
+            }
+          }
+          // create surface and face
+          //Handle(Geom_BezierSurface) BS = new Geom_BezierSurface(Points);
+          BS = new Geom_BezierSurface(Points);
+        }
+
+        BRepBuilderAPI_MakeFace BB(BS,W);
+        TopoDS_Face NewF = BB.Face();
+        Handle(ShapeFix_Face) sff = new ShapeFix_Face(NewF);
+        sff->Perform();
+        sff->FixOrientation();
+        TopoDS_Face FixedFace = sff->Face();
+        aNewFs.Append(FixedFace);
+        VPE.Add(E1,FixedFace);
+        //cout<<"      face for edge "<<nbee<<" is created"<<endl;
+        //BRepTools::Write(FixedFace,"/dn02/users_Linux/skl/work/Bugs/14857/f.brep");
       }
       // make shell
       TopoDS_Shell aShell;
       B.MakeShell(aShell);
       for(int nf=1; nf<=aNewFs.Length(); nf++) {
-       B.Add(aShell,aNewFs(nf));
+        B.Add(aShell,aNewFs(nf));
       }
       B.Add(aShell,F1);
       B.Add(aShell,F2);
@@ -1794,35 +1783,35 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
       aSewing->SetFloatingEdgesMode(Standard_False);
       aSewing->SetNonManifoldMode(Standard_False);
       for ( anExp.Init( aShell, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
-       aSewing->Add(anExp.Current());
+        aSewing->Add(anExp.Current());
       }
       aSewing->Perform();
       MESSAGE ("    shell for face "<<nbff<<" is created");
       const TopoDS_Shape aSewShape = aSewing->SewedShape();
       //BRepTools::Write(aSewShape,"/dn02/users_Linux/skl/work/Bugs/14857/sew.brep");
       if( aSewShape.ShapeType() == TopAbs_SHELL ) {
-       aShell = TopoDS::Shell(aSewShape);
-       GProp_GProps aSystem;
-       BRepGProp::VolumeProperties(aShell, aSystem);
-       if(aSystem.Mass()<0) {
-         //cout<<"aSewShape is reversed"<<endl;
-         aShell.Reverse();
-       }
-       if(BRep_Tool::IsClosed(aShell)) {
-         TopoDS_Solid aSolid;
-         B.MakeSolid(aSolid);
-         B.Add(aSolid,aShell);
-         B.Add(aComp,aSolid);
-         MESSAGE ("    solid for face "<<nbff<<" is created");
-       }
-       else {
-         B.Add(aComp,aShell);
-         MESSAGE ("    solid for face "<<nbff<<" is not created");
-       }
+        aShell = TopoDS::Shell(aSewShape);
+        GProp_GProps aSystem;
+        BRepGProp::VolumeProperties(aShell, aSystem);
+        if(aSystem.Mass()<0) {
+          //cout<<"aSewShape is reversed"<<endl;
+          aShell.Reverse();
+        }
+        if(BRep_Tool::IsClosed(aShell)) {
+          TopoDS_Solid aSolid;
+          B.MakeSolid(aSolid);
+          B.Add(aSolid,aShell);
+          B.Add(aComp,aSolid);
+          MESSAGE ("    solid for face "<<nbff<<" is created");
+        }
+        else {
+          B.Add(aComp,aShell);
+          MESSAGE ("    solid for face "<<nbff<<" is not created");
+        }
       }
       else {
-       B.Add(aComp,aShell);
-       MESSAGE ("    solid for face "<<nbff<<" is not created");
+        B.Add(aComp,aShell);
+        MESSAGE ("    solid for face "<<nbff<<" is not created");
       }
       //cout<<"    solid for face "<<nbff<<" is created"<<endl;
 
@@ -1833,17 +1822,17 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
       GProp_GProps aSystem;
       BRepGProp::VolumeProperties(FixedShell, aSystem);
       if(aSystem.Mass()<0) {
-       //cout<<"aSewShape is reversed"<<endl;
-       FixedShell.Reverse();
+        //cout<<"aSewShape is reversed"<<endl;
+        FixedShell.Reverse();
       }
       if(BRep_Tool::IsClosed(FixedShell)) {
-       TopoDS_Solid aSolid;
-       B.MakeSolid(aSolid);
-       B.Add(aSolid,aShell);
-       B.Add(aComp,aSolid);
+        TopoDS_Solid aSolid;
+        B.MakeSolid(aSolid);
+        B.Add(aSolid,aShell);
+        B.Add(aComp,aSolid);
       }
       else {
-       B.Add(aComp,FixedShell);
+        B.Add(aComp,FixedShell);
       }
       */
     }
@@ -1853,13 +1842,12 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
   return aComp;
 }
 
-
 //=======================================================================
 //function : CreatePipeBiNormalAlongVector
 //purpose  : auxilary for Execute()
 //=======================================================================
 static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath,
-                                                 GEOMImpl_IPipe* aCI)
+                                                  GEOMImpl_IPipe* aCI)
 {
   GEOMImpl_IPipeBiNormal* aCIBN = (GEOMImpl_IPipeBiNormal*)aCI;
 
@@ -1919,7 +1907,6 @@ static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath,
   return PipeBuilder.Shape();
 }
 
-
 //=======================================================================
 //function : Execute
 //purpose  :
@@ -1962,12 +1949,12 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     }
     else {
       if (aShapePath.ShapeType() == TopAbs_EDGE) {
-       TopoDS_Edge anEdge = TopoDS::Edge(aShapePath);
-       aWirePath = BRepBuilderAPI_MakeWire(anEdge);
+        TopoDS_Edge anEdge = TopoDS::Edge(aShapePath);
+        aWirePath = BRepBuilderAPI_MakeWire(anEdge);
       }
       else {
-       if(aCI) delete aCI;
-       Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
+        if(aCI) delete aCI;
+        Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
       }
     }
   }
@@ -2008,70 +1995,70 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     TopTools_SequenceOfShape aSeqBases;
     TopTools_SequenceOfShape aSeqLocs;
     TopTools_SequenceOfShape aSeqFaces;
-    for; i <= nbBases; i++) {
+    for (; i <= nbBases; i++) {
       Handle(Standard_Transient) anItem = aBasesObjs->Value(i);
       if(anItem.IsNull())
-       continue;
+        continue;
       Handle(GEOM_Function) aRefBase = Handle(GEOM_Function)::DownCast(anItem);
       if(aRefBase.IsNull())
-       continue;
+        continue;
       TopoDS_Shape aShapeBase = aRefBase->GetValue();
       if(aShapeBase.IsNull())
-       continue;
+        continue;
       TopAbs_ShapeEnum aTypeBase = aShapeBase.ShapeType();
 
       //if for section was specified face with a few wires then a few
       //    pipes were build and make solid
       Standard_Boolean NeedCreateSolid = Standard_False;
       if(aTypeBase == TopAbs_SHELL) {
-       // create wire as boundary contour if shell is no closed
-       // get free boundary shapes
-       ShapeAnalysis_FreeBounds anAnalizer( aShapeBase );
-       TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
-       TopExp_Explorer anExp;
-       TopoDS_Shape aWire;
-       Standard_Integer NbWires = 0;
-       for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
-         NbWires++;
-         aWire = anExp.Current();
-       }
-       if(NbWires!=1) {
-         // bad case
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Bad shell is used as section ");
-       }
-       NeedCreateSolid = Standard_True;
+        // create wire as boundary contour if shell is no closed
+        // get free boundary shapes
+        ShapeAnalysis_FreeBounds anAnalizer( aShapeBase );
+        TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
+        TopExp_Explorer anExp;
+        TopoDS_Shape aWire;
+        Standard_Integer NbWires = 0;
+        for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) {
+          NbWires++;
+          aWire = anExp.Current();
+        }
+        if(NbWires!=1) {
+          // bad case
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Bad shell is used as section ");
+        }
+        NeedCreateSolid = Standard_True;
         aSeqFaces.Append(aShapeBase);
-       aSeqBases.Append(aWire);
+        aSeqBases.Append(aWire);
       }
       else if(aTypeBase == TopAbs_FACE) {
-       NeedCreateSolid = Standard_True;
-       //for case one path should be used other type function
+        NeedCreateSolid = Standard_True;
+        //for case one path should be used other type function
         aSeqFaces.Append(aShapeBase);
         TopExp_Explorer aExpW(aShapeBase,TopAbs_WIRE);
-       for( ; aExpW.More(); aExpW.Next())
-       {
-         TopoDS_Shape aWireProf = aExpW.Current();
-         aSeqBases.Append(aWireProf);
-       }
+        for (; aExpW.More(); aExpW.Next())
+        {
+          TopoDS_Shape aWireProf = aExpW.Current();
+          aSeqBases.Append(aWireProf);
+        }
       }
       else if(aTypeBase == TopAbs_WIRE || aTypeBase == TopAbs_VERTEX) {
         aSeqBases.Append(aShapeBase);
       }
       else if(aTypeBase == TopAbs_EDGE) {
         TopoDS_Edge anEdge = TopoDS::Edge(aShapeBase);
-       TopoDS_Shape aWireProf = BRepBuilderAPI_MakeWire(anEdge);
-       aSeqBases.Append(aWireProf);
+        TopoDS_Shape aWireProf = BRepBuilderAPI_MakeWire(anEdge);
+        aSeqBases.Append(aWireProf);
       }
       if(nbLocs) {
         Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
-       if(anItemLoc.IsNull())
-         continue;
-       Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
+        if(anItemLoc.IsNull())
+          continue;
+        Handle(GEOM_Function) aRefLoc = Handle(GEOM_Function)::DownCast(anItemLoc);
         TopoDS_Shape aShapeLoc = aRefLoc->GetValue();
-       if(aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
-         continue;
-       aSeqLocs.Append(aShapeLoc);
+        if(aShapeLoc.IsNull() || aShapeLoc.ShapeType() != TopAbs_VERTEX)
+          continue;
+        aSeqLocs.Append(aShapeLoc);
       }
     }
 
@@ -2084,13 +2071,13 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       // path and update aSeqLocs if it is needed (and possible)
       TColgp_SequenceOfPnt PLocs;
       for(i=1; i<=nbLocs; i++) {
-       TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
-       PLocs.Append(BRep_Tool::Pnt(V));
+        TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
+        PLocs.Append(BRep_Tool::Pnt(V));
       }
       //TopTools_SequenceOfShape Edges;
       TopExp_Explorer anExp;
       for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
-       Edges.Append(anExp.Current());
+        Edges.Append(anExp.Current());
       }
       int nbEdges = Edges.Length();
       ShapeAnalysis_Edge sae;
@@ -2100,9 +2087,9 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       gp_Pnt PF = BRep_Tool::Pnt(VF);
       //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
       if( PF.Distance(PLocs.First()) > tol ) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise
-         ("First location shapes is not coincided with first vertex of aWirePath");
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise
+          ("First location shapes is not coincided with first vertex of aWirePath");
       }
       aSeqLocs.ChangeValue(1) = VF;
       edge = TopoDS::Edge(Edges.Last());
@@ -2110,78 +2097,78 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       TopoDS_Vertex VL = sae.LastVertex(edge);
       gp_Pnt PL = BRep_Tool::Pnt(VL);
       if( PL.Distance(PLocs.Last()) > tol ) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise
-         ("Last location shapes is not coincided with last vertex of aWirePath");
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise
+          ("Last location shapes is not coincided with last vertex of aWirePath");
       }
       aSeqLocs.ChangeValue(nbLocs) = VL;
       int jcurr = 2;
       for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
-       TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
-       tol = BRep_Tool::Tolerance(edge);
-       TopoDS_Vertex V1 = sae.FirstVertex(E);
-       TopoDS_Vertex V2 = sae.LastVertex(E);
-       gp_Pnt P1 = BRep_Tool::Pnt(V1);
-       gp_Pnt P2 = BRep_Tool::Pnt(V2);
-       if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
-         aSeqLocs.ChangeValue(jcurr) = V2;
-         jcurr++;
-       }
-       else {
-         // find distance between E and aLocs(jcurr)
-         double fp,lp;
-         Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
-         GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
-         if( PPC.NbPoints()>0 &&
-             PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
-           double param = PPC.Parameter(1);
-           gp_Pnt PC1;
-           C->D0(param,PC1);
-           // split current edge
-           Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
-           Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
-           TopoDS_Edge E1,E2;
-           BRep_Builder B;
-           gp_Pnt Pfp;
-           C->D0(fp,Pfp);
-           if(Pfp.Distance(P1)<tol) {
-             B.MakeEdge(E1,tc1,tol);
-             B.Add(E1,V1);
-             TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
-             B.Add(E1,TopoDS::Vertex(tmpV));
-             B.MakeEdge(E2,tc2,tol);
-             tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
-             B.Add(E2,TopoDS::Vertex(tmpV));
-             B.Add(E2,V2);
-           }
-           else {
-             B.MakeEdge(E1,tc2,tol);
-             TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
-             B.Add(E1,TopoDS::Vertex(tmpV));
-             B.Add(E1,V1);
-             E1.Reverse();
-             B.MakeEdge(E2,tc1,tol);
-             B.Add(E2,V2);
-             tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
-             B.Add(E2,TopoDS::Vertex(tmpV));
-             E2.Reverse();
-           }
-           jcurr++;
-           Edges.Remove(i);
-           Edges.InsertAfter(i-1,E1);
-           Edges.InsertAfter(i,E2);
-         }
-       }
+        TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
+        tol = BRep_Tool::Tolerance(edge);
+        TopoDS_Vertex V1 = sae.FirstVertex(E);
+        TopoDS_Vertex V2 = sae.LastVertex(E);
+        gp_Pnt P1 = BRep_Tool::Pnt(V1);
+        gp_Pnt P2 = BRep_Tool::Pnt(V2);
+        if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
+          aSeqLocs.ChangeValue(jcurr) = V2;
+          jcurr++;
+        }
+        else {
+          // find distance between E and aLocs(jcurr)
+          double fp,lp;
+          Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+          GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
+          if( PPC.NbPoints()>0 &&
+              PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
+            double param = PPC.Parameter(1);
+            gp_Pnt PC1;
+            C->D0(param,PC1);
+            // split current edge
+            Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+            Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+            TopoDS_Edge E1,E2;
+            BRep_Builder B;
+            gp_Pnt Pfp;
+            C->D0(fp,Pfp);
+            if(Pfp.Distance(P1)<tol) {
+              B.MakeEdge(E1,tc1,tol);
+              B.Add(E1,V1);
+              TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+              B.Add(E1,TopoDS::Vertex(tmpV));
+              B.MakeEdge(E2,tc2,tol);
+              tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+              B.Add(E2,TopoDS::Vertex(tmpV));
+              B.Add(E2,V2);
+            }
+            else {
+              B.MakeEdge(E1,tc2,tol);
+              TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+              B.Add(E1,TopoDS::Vertex(tmpV));
+              B.Add(E1,V1);
+              E1.Reverse();
+              B.MakeEdge(E2,tc1,tol);
+              B.Add(E2,V2);
+              tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+              B.Add(E2,TopoDS::Vertex(tmpV));
+              E2.Reverse();
+            }
+            jcurr++;
+            Edges.Remove(i);
+            Edges.InsertAfter(i-1,E1);
+            Edges.InsertAfter(i,E2);
+          }
+        }
       }
       if(nbEdges<Edges.Length()) {
-       // one of edges was splitted => we have to update WirePath
-       BRep_Builder B;
-       TopoDS_Wire W;
-       B.MakeWire(W);
-       for(i=1; i<=Edges.Length(); i++) {
-         B.Add(W,TopoDS::Edge(Edges.Value(i)));
-       }
-       aWirePath = W;
+        // one of edges was splitted => we have to update WirePath
+        BRep_Builder B;
+        TopoDS_Wire W;
+        B.MakeWire(W);
+        for(i=1; i<=Edges.Length(); i++) {
+          B.Add(W,TopoDS::Edge(Edges.Value(i)));
+        }
+        aWirePath = W;
       }
     }
 
@@ -2210,18 +2197,18 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       double ang = fabs(Vec1.Angle(Vec2));
       SumAng += ang;
       if(SumAng>4*PI) {
-       SumAng = ang;
-       SplitEdgeNums.Append(i-1);
-       int j;
-       for(j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
-         TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
-         gp_Pnt P = BRep_Tool::Pnt(aVert);
-         if( P1.Distance(P) < tol ) {
-           SplitLocNums.Append(j);
-           LastLoc = j;
-           break;
-         }
-       }
+        SumAng = ang;
+        SplitEdgeNums.Append(i-1);
+        int j;
+        for(j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
+          TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+          gp_Pnt P = BRep_Tool::Pnt(aVert);
+          if( P1.Distance(P) < tol ) {
+            SplitLocNums.Append(j);
+            LastLoc = j;
+            break;
+          }
+        }
       }
       Vec1 = Vec2;
       P1 = P2;
@@ -2233,61 +2220,61 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       TopTools_SequenceOfShape aSeqRes;
       int nn, num1 = 1, num2 = 1;
       for(nn=1; nn<=SplitEdgeNums.Length(); nn++) {
-       // create wirepath and sequences of shapes
-       BRep_Builder B;
-       TopoDS_Wire tmpW;
-       B.MakeWire(tmpW);
-       for(i=num1; i<=SplitEdgeNums.Value(nn); i++) {
-         B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
-       }
-       num1 = SplitEdgeNums.Value(nn) + 1;
-       TopTools_SequenceOfShape aTmpSeqBases;
-       TopTools_SequenceOfShape aTmpSeqLocs;
-       for(i=num2; i<=SplitLocNums.Value(nn); i++) {
-         aTmpSeqBases.Append(aSeqBases.Value(i));
-         aTmpSeqLocs.Append(aSeqLocs.Value(i));
-       }
-       num2 = SplitLocNums.Value(nn);
-       // make pipe
-       BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
-       Standard_Integer nbShapes = aTmpSeqBases.Length();
-       for(i=1; i<=nbShapes; i++) {
-         TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
-         TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
-         aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
-       }
-       if(!aBuilder.IsReady()) {
-         if(aCI) delete aCI;
-         Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
-       }
-       aBuilder.Build();
-       TopoDS_Shape resShape = aBuilder.Shape();
-       aSeqRes.Append(resShape);
+        // create wirepath and sequences of shapes
+        BRep_Builder B;
+        TopoDS_Wire tmpW;
+        B.MakeWire(tmpW);
+        for(i=num1; i<=SplitEdgeNums.Value(nn); i++) {
+          B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
+        }
+        num1 = SplitEdgeNums.Value(nn) + 1;
+        TopTools_SequenceOfShape aTmpSeqBases;
+        TopTools_SequenceOfShape aTmpSeqLocs;
+        for(i=num2; i<=SplitLocNums.Value(nn); i++) {
+          aTmpSeqBases.Append(aSeqBases.Value(i));
+          aTmpSeqLocs.Append(aSeqLocs.Value(i));
+        }
+        num2 = SplitLocNums.Value(nn);
+        // make pipe
+        BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
+        Standard_Integer nbShapes = aTmpSeqBases.Length();
+        for(i=1; i<=nbShapes; i++) {
+          TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
+          TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+          aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
+        }
+        if(!aBuilder.IsReady()) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+        }
+        aBuilder.Build();
+        TopoDS_Shape resShape = aBuilder.Shape();
+        aSeqRes.Append(resShape);
       }
       // create wirepath and sequences of shapes for last part
       BRep_Builder B;
       TopoDS_Wire tmpW;
       B.MakeWire(tmpW);
       for(i=num1; i<=Edges.Length(); i++) {
-       B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
+        B.Add(tmpW,TopoDS::Edge(Edges.Value(i)));
       }
       TopTools_SequenceOfShape aTmpSeqBases;
       TopTools_SequenceOfShape aTmpSeqLocs;
       for(i=num2; i<=aSeqLocs.Length(); i++) {
-       aTmpSeqBases.Append(aSeqBases.Value(i));
-       aTmpSeqLocs.Append(aSeqLocs.Value(i));
+        aTmpSeqBases.Append(aSeqBases.Value(i));
+        aTmpSeqLocs.Append(aSeqLocs.Value(i));
       }
       // make pipe for last part
       BRepOffsetAPI_MakePipeShell aBuilder(tmpW);
       Standard_Integer nbShapes = aTmpSeqBases.Length();
       for(i=1; i<=nbShapes; i++) {
-       TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
-       TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
-       aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
+        TopoDS_Shape aShapeLoc = aTmpSeqLocs.Value(i);
+        TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+        aBuilder.Add(aTmpSeqBases.Value(i), aVert, aWithContact, aWithCorrect);
       }
       if(!aBuilder.IsReady()) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
       }
       aBuilder.Build();
       TopoDS_Shape resShape = aBuilder.Shape();
@@ -2299,7 +2286,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       aSewing->SetFloatingEdgesMode(Standard_False);
       aSewing->SetNonManifoldMode(Standard_False);
       for(i=1; i<=aSeqRes.Length(); i++) {
-       aSewing->Add(aSeqRes.Value(i));
+        aSewing->Add(aSeqRes.Value(i));
       }
       aSewing->Perform();
       aShape = aSewing->SewedShape();
@@ -2311,45 +2298,45 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
       Standard_Integer nbShapes = aSeqBases.Length();
       Standard_Integer step = nbShapes/nbBases;
 
-      if(nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) {
-       if(aCI) delete aCI;
-       Standard_ConstructionError::Raise("Invalid sections were specified for building pipe");
+      if (nbShapes < nbBases || fmod((double)nbShapes, (double)nbBases)) {
+        if(aCI) delete aCI;
+        Standard_ConstructionError::Raise("Invalid sections were specified for building pipe");
       }
       Standard_Integer ind =0;
-      for( i=1; i  <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes
-       TopTools_SequenceOfShape usedBases;
-       Standard_Integer j = 1;
-       for( ; j <= nbBases ; j++) {
-         ind = i + (j-1)*step;
-         TopoDS_Shape aWireProf = aSeqBases.Value(ind);
-         usedBases.Append(aWireProf);
-         if(nbLocs) {
-           TopoDS_Shape aShapeLoc = aSeqLocs.Value(j);
-           TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
-           aBuilder.Add(aWireProf,aVert,aWithContact,aWithCorrect);
-         }
-         else
-           aBuilder.Add(aWireProf,aWithContact,aWithCorrect);
-       }
-      if(!aBuilder.IsReady()) {
-       if(aCI) delete aCI;
-        Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
-      }
-      aBuilder.Build();
-      aShape = aBuilder.Shape();
-      aSeqFaces.Append(aShape);
-      for( j = 1; j <=usedBases.Length(); j++)
-        aBuilder.Delete(usedBases.Value(j));
+      for (i = 1; i <= nbShapes && ind < nbShapes; i++) { //i+nbBases <= nbShapes
+        TopTools_SequenceOfShape usedBases;
+        Standard_Integer j = 1;
+        for (; j <= nbBases; j++) {
+          ind = i + (j-1)*step;
+          TopoDS_Shape aWireProf = aSeqBases.Value(ind);
+          usedBases.Append(aWireProf);
+          if(nbLocs) {
+            TopoDS_Shape aShapeLoc = aSeqLocs.Value(j);
+            TopoDS_Vertex aVert = TopoDS::Vertex(aShapeLoc);
+            aBuilder.Add(aWireProf,aVert,aWithContact,aWithCorrect);
+          }
+          else
+            aBuilder.Add(aWireProf,aWithContact,aWithCorrect);
+        }
+        if(!aBuilder.IsReady()) {
+          if(aCI) delete aCI;
+          Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
+        }
+        aBuilder.Build();
+        aShape = aBuilder.Shape();
+        aSeqFaces.Append(aShape);
+        for( j = 1; j <=usedBases.Length(); j++)
+          aBuilder.Delete(usedBases.Value(j));
       }
 
       //for case if section is face
-      if(aSeqFaces.Length() >1)        {
-       BRep_Builder aB;
-       TopoDS_Compound aComp;
-       aB.MakeCompound(aComp);
-       for( i = 1; i <= aSeqFaces.Length(); i++)
-         aB.Add(aComp,aSeqFaces.Value(i));
-       aShape = aComp;
+      if(aSeqFaces.Length() >1) {
+        BRep_Builder aB;
+        TopoDS_Compound aComp;
+        aB.MakeCompound(aComp);
+        for( i = 1; i <= aSeqFaces.Length(); i++)
+          aB.Add(aComp,aSeqFaces.Value(i));
+        aShape = aComp;
       }
     }
   }
@@ -2402,7 +2389,6 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
   return 1;
 }
 
-
 //=======================================================================
 //function :  GEOMImpl_PipeDriver_Type_
 //purpose  :
@@ -2417,13 +2403,12 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_PipeDriver_Type_()
   static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
   if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
 
-
   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
   static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PipeDriver",
-                                                        sizeof(GEOMImpl_PipeDriver),
-                                                        1,
-                                                        (Standard_Address)_Ancestors,
-                                                        (Standard_Address)NULL);
+                                                         sizeof(GEOMImpl_PipeDriver),
+                                                         1,
+                                                         (Standard_Address)_Ancestors,
+                                                         (Standard_Address)NULL);
 
   return _aType;
 }
@@ -2442,6 +2427,5 @@ const Handle(GEOMImpl_PipeDriver) Handle(GEOMImpl_PipeDriver)::DownCast(const Ha
      }
   }
 
-  return _anOtherObject ;
+  return _anOtherObject;
 }
-
index f557dea20c988df6c6d9b1a0b1c8a3ba29c5e95c..17d810da96250b99874c30613db28ba784d39fcf 100644 (file)
@@ -421,15 +421,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     if ( ish == 0 ) return 0;
     BRepClass3d_SolidClassifier SC (Sol);
     SC.PerformInfinitePoint(Precision::Confusion());
-    switch (SC.State()) {
-    case TopAbs_IN:
-      aShape = Sol.Reversed(); break;
-    case TopAbs_OUT:
-      aShape = Sol; break;
-    default: // not closed shell?
-      return 0;
-    }
-
+    if (SC.State() == TopAbs_IN)
+      aShape = Sol.Reversed();
+    else
+      aShape = Sol;
   }
   else if (aType == COMPOUND_SHAPES) {
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
index 6642592d15f208330405e4fa44c5555a7af29708..cf2407d3f8fa792b0739e941d7dfe1ba726d4e42 100644 (file)
@@ -28,6 +28,8 @@
 
 #include <GEOMImpl_IMeasureOperations.hxx>
 
+#include <Basics_Utils.hxx>
+
 // OCCT Includes
 #include <BRepBuilderAPI_Transform.hxx>
 #include <BRep_Tool.hxx>
@@ -78,6 +80,9 @@ Standard_Integer GEOMImpl_SketcherDriver::Execute(TFunction_Logbook& log) const
 
   TopoDS_Shape aShape;
 
+  // Set "C" numeric locale to save numbers correctly
+  Kernel_Utils::Localizer loc;
+
   // create sketcher
   Sketcher_Profile aProfile (aCommand.ToCString());
 
index 70820da32c2def305a8963c4fafccc7f39b39bcf..948b0c0b13e22c637afb68970ef099230477a276 100644 (file)
@@ -229,7 +229,7 @@ libGEOMimpl_la_LDFLAGS  =                   \
        ../ShHealOper/libShHealOper.la          \
        ../ARCHIMEDE/libGEOMArchimede.la        \
        ../SKETCHER/libGEOMSketcher.la          \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace    \
+       $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics     \
        $(STDLIB)                               \
        $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset
 
index fceff718fdeb89e0242884b9db91baf24054bf88..521e92e1bf7111595b75b0059c9abaa7550b7b95 100644 (file)
@@ -407,6 +407,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
        OnShowHideChildren( theCommandID == 8037 );
        break;
       }
+    case 8039: // POINT MARKER
+      {
+       OnPointMarker();
+       break;
+      }
     case 9024 : // OPEN - OBJBROSER POPUP
       {
        OnOpen();
index 91d8db55918e2e08e8a83ab34ceeb56d172fdcdc..0f48e9dd1806b714480b62d2df62ffe8723fd8e8 100644 (file)
@@ -72,6 +72,7 @@ private:
   void         OnOpen();
   void         OnSelectOnly(int mode);
   void         OnShowHideChildren( bool );
+  void         OnPointMarker();
 
   // Recursive deletion of object with children
   void         removeObjectWithChildren( _PTR(SObject),
index bc7e8fd23675299e05ad4e67cd0c23c5d6b44452..f9b7e9544b712353478cd483509d8f7fa0e11600 100644 (file)
@@ -28,6 +28,7 @@
 #include "GEOMToolsGUI.h"
 #include "GEOMToolsGUI_TransparencyDlg.h"
 #include "GEOMToolsGUI_NbIsosDlg.h"
+#include "GEOMToolsGUI_MarkerDlg.h"
 
 #include <GeometryGUI.h>
 #include <GEOM_Displayer.h>
@@ -70,6 +71,7 @@
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
+#include <Graphic3d_HArray1OfBytes.hxx>
 
 // QT Includes
 #include <QColorDialog>
@@ -257,7 +259,15 @@ void GEOMToolsGUI::OnAutoColor()
       Standard_Real aCurScale;
       Aspect_TypeOfMarker aCurTypeOfMarker;
       aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
-      aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
+      if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
+       aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
+      }
+      else {
+       Standard_Integer aWidth, aHeight;
+       aCurPointAspect->GetTextureSize( aWidth, aHeight );
+       Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
+       aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
+      }
       ic->SetLocalAttributes( io, aCurDrawer );
 
       io->SetColor( aQuanColor );
@@ -348,7 +358,15 @@ void GEOMToolsGUI::OnColor()
                  Standard_Real aCurScale;
                  Aspect_TypeOfMarker aCurTypeOfMarker;
                  aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
-                 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) );
+                 if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
+                   aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aColor, aCurScale) );
+                 }
+                 else {
+                   Standard_Integer aWidth, aHeight;
+                   aCurPointAspect->GetTextureSize( aWidth, aHeight );
+                   Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
+                   aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aColor, 1, aWidth, aHeight, aTexture ) );
+                 }
                  ic->SetLocalAttributes(io, aCurDrawer);
                  
                  io->SetColor( aColor );
@@ -645,3 +663,9 @@ void GEOMToolsGUI::OnShowHideChildren( bool show )
     app->updateActions();
   }
 }
+
+void GEOMToolsGUI::OnPointMarker()
+{
+  GEOMToolsGUI_MarkerDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
+  dlg.exec();
+}
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx
new file mode 100644 (file)
index 0000000..cb5b817
--- /dev/null
@@ -0,0 +1,370 @@
+// Copyright (C) 2007-2009  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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   : GEOMToolsGUI_MarkerDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
+#include "GEOMToolsGUI_MarkerDlg.h"
+
+#include <GeometryGUI.h>
+#include <GEOM_Displayer.h>
+
+#include <QtxComboBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+
+#include <QButtonGroup>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QStackedWidget>
+
+#define MARGIN  9
+#define SPACING 6
+
+GEOMToolsGUI_MarkerDlg::GEOMToolsGUI_MarkerDlg( QWidget* parent )
+  : QDialog ( parent )
+{
+  setWindowTitle( tr( "SET_MARKER_TLT" ) );
+  setSizeGripEnabled( true );
+  setModal( true );
+
+  // ---
+
+  QRadioButton* aStandardTypeRB = new QRadioButton( tr( "STANDARD_MARKER" ), this );
+  QRadioButton* aCustomTypeRB   = new QRadioButton( tr( "CUSTOM_MARKER" ), this );
+  myTypeGroup = new QButtonGroup( this );
+  myTypeGroup->addButton( aStandardTypeRB, 0 );
+  myTypeGroup->addButton( aCustomTypeRB,   1 );
+
+  QHBoxLayout* aRadioLayout = new QHBoxLayout;
+  aRadioLayout->setMargin( 0 );
+  aRadioLayout->setSpacing( SPACING );
+  aRadioLayout->addWidget( aStandardTypeRB );
+  aRadioLayout->addWidget( aCustomTypeRB );
+
+  // ---
+
+  myWGStack = new QStackedWidget( this );
+  myWGStack->setFrameStyle( QFrame::Box | QFrame::Sunken );
+
+  // ---
+
+  QWidget* aStdWidget = new QWidget( myWGStack );
+
+  QLabel* aTypeLab  = new QLabel( tr( "TYPE" ),  aStdWidget );
+  QLabel* aScaleLab = new QLabel( tr( "SCALE" ), aStdWidget );
+
+  myStdTypeCombo  = new QtxComboBox( aStdWidget );
+  myStdScaleCombo = new QtxComboBox( aStdWidget );
+
+  QGridLayout* aStdLayout = new QGridLayout;
+  aStdLayout->setMargin( MARGIN );
+  aStdLayout->setSpacing( SPACING );
+  aStdLayout->addWidget( aTypeLab,        0, 0 );
+  aStdLayout->addWidget( myStdTypeCombo,  0, 1 );
+  aStdLayout->addWidget( aScaleLab,       1, 0 );
+  aStdLayout->addWidget( myStdScaleCombo, 1, 1 );
+  aStdWidget->setLayout( aStdLayout );
+
+  // ---
+
+  QWidget* aCustomWidget = new QWidget( myWGStack );
+
+  QLabel* aCustomLab = new QLabel( tr( "CUSTOM" ), aCustomWidget );
+  myCustomTypeCombo = new QtxComboBox( aCustomWidget );
+  QPushButton* aBrowseBtn = new QPushButton( tr( "BROWSE" ), aCustomWidget );
+
+  QGridLayout* aCustomLayout = new QGridLayout;
+  aCustomLayout->setMargin( MARGIN );
+  aCustomLayout->setSpacing( SPACING );
+  aCustomLayout->addWidget( aCustomLab,        0, 0 );
+  aCustomLayout->addWidget( myCustomTypeCombo, 0, 1 );
+  aCustomLayout->addWidget( aBrowseBtn,       0, 2 );
+  aCustomLayout->setRowStretch( 1, 5 );
+  aCustomWidget->setLayout( aCustomLayout );
+
+  // ---
+  
+  myWGStack->insertWidget( 0, aStdWidget );
+  myWGStack->insertWidget( 1, aCustomWidget );
+
+  // ---
+  
+  QPushButton* aOkBtn     = new QPushButton( tr( "OK_BTN" ),     this );
+  aOkBtn->setAutoDefault( true ); aOkBtn->setDefault( true ); 
+  QPushButton* aCancelBtn = new QPushButton( tr( "CANCEL_BTN" ), this );
+  aCancelBtn->setAutoDefault( true );
+  QPushButton* aHelpBtn   = new QPushButton( tr( "HELP_BTN" ), this );
+  aHelpBtn->setAutoDefault( true );
+
+  QHBoxLayout* aBtnLayout = new QHBoxLayout;
+  aBtnLayout->setMargin( 0 );
+  aBtnLayout->setSpacing( SPACING );
+  aBtnLayout->addWidget( aOkBtn );
+  aBtnLayout->addSpacing( 10 );
+  aBtnLayout->addStretch();
+  aBtnLayout->addWidget( aCancelBtn );
+  aBtnLayout->addWidget( aHelpBtn );
+
+  // ---
+
+  QVBoxLayout* aTopLayout = new QVBoxLayout;
+  aTopLayout->setMargin( MARGIN );
+  aTopLayout->setSpacing( SPACING );
+  aTopLayout->addLayout( aRadioLayout );
+  aTopLayout->addWidget( myWGStack );
+  aTopLayout->addLayout( aBtnLayout );
+  setLayout( aTopLayout );
+
+  // ---
+
+  connect( myTypeGroup, SIGNAL( buttonClicked( int ) ), myWGStack, SLOT( setCurrentIndex( int ) ) );
+  connect( aBrowseBtn,  SIGNAL( clicked() ), this, SLOT( browse() ) );
+  connect( aOkBtn,      SIGNAL( clicked() ), this, SLOT( accept() ) );
+  connect( aCancelBtn,  SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( aHelpBtn,    SIGNAL( clicked() ), this, SLOT( help() ) );
+
+  // ---
+
+  aStandardTypeRB->setChecked( true );
+  init();
+}
+
+GEOMToolsGUI_MarkerDlg::~GEOMToolsGUI_MarkerDlg()
+{
+  myOperation->Destroy();
+}
+
+void GEOMToolsGUI_MarkerDlg::setStandardMarker( GEOM::marker_type type, GEOM::marker_size size )
+{
+  if ( type > GEOM::MT_NONE && type < GEOM::MT_USER ) {
+    myTypeGroup->button( 0 )->setChecked( true );
+    myWGStack->setCurrentIndex( 0 );
+    myStdTypeCombo->setCurrentIndex( (int)type - 1 );
+#ifdef WNT
+    int asize = max( (int)GEOM::MS_10, min( (int)GEOM::MS_70, (int)size ) );
+#else
+    int asize = std::max( (int)GEOM::MS_10, std::min( (int)GEOM::MS_70, (int)size ) );
+#endif
+    myStdScaleCombo->setCurrentIndex( asize-1 );
+  }
+}
+
+void GEOMToolsGUI_MarkerDlg::setCustomMarker( int id )
+{
+  if ( id > 0 ) {
+    myTypeGroup->button( 1 )->setChecked( true );
+    myWGStack->setCurrentIndex( 1 );
+    addTexture( id );
+    myCustomTypeCombo->setCurrentId( id );
+  }
+}
+
+GEOM::marker_type GEOMToolsGUI_MarkerDlg::getMarkerType() const
+{
+  return myWGStack->currentIndex() == 0 ? (GEOM::marker_type)myStdTypeCombo->currentId() : GEOM::MT_USER;
+}
+
+GEOM::marker_size GEOMToolsGUI_MarkerDlg::getStandardMarkerScale() const
+{
+  return myWGStack->currentIndex() == 0 ? (GEOM::marker_size)myStdScaleCombo->currentId() : GEOM::MS_NONE;
+}
+
+int GEOMToolsGUI_MarkerDlg::getCustomMarkerID() const
+{
+  return myWGStack->currentIndex() == 1 ? myCustomTypeCombo->currentId() : 0;
+}
+
+void GEOMToolsGUI_MarkerDlg::accept()
+{
+  if ( getStudy() ) {
+    LightApp_SelectionMgr* selMgr = qobject_cast<SalomeApp_Application*>( getStudy()->application() )->selectionMgr();
+    if ( selMgr ) {
+      SALOME_ListIO selected;
+      selMgr->selectedObjects( selected );
+      if ( !selected.IsEmpty() ) {
+       _PTR(Study) study = getStudy()->studyDS();
+       for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
+         _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
+         GEOM::GEOM_Object_var anObject =
+           GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
+         if ( !anObject->_is_nil() ) {
+           if ( myWGStack->currentIndex() == 0 )
+             anObject->SetMarkerStd( getMarkerType(), getStandardMarkerScale() );
+           else if ( getCustomMarkerID() > 0 )
+             anObject->SetMarkerTexture( getCustomMarkerID() );
+         }
+       }
+       GEOM_Displayer displayer( getStudy() );
+       displayer.Redisplay( selected, true );
+      }
+    }
+  }
+  QDialog::accept();
+}
+
+void GEOMToolsGUI_MarkerDlg::keyPressEvent( QKeyEvent* e )
+{
+  if ( e->key() == Qt::Key_F1 )
+    help();
+  QDialog::keyPressEvent( e );
+}
+
+void GEOMToolsGUI_MarkerDlg::init()
+{
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+  // ---
+
+  for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
+    QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+    QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
+    myStdTypeCombo->addItem( pixmap, QString() );
+    myStdTypeCombo->setId( myStdTypeCombo->count()-1, i );
+  }
+
+  // ---
+
+  for ( int i = GEOM::MS_10; i <= GEOM::MS_70; i++ ) {
+    myStdScaleCombo->addItem( QString::number( (i-1)*0.5 + 1.0 ) );
+    myStdScaleCombo->setId( myStdScaleCombo->count()-1, i );
+  }
+
+  // ---
+  
+  GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen();
+  myOperation = engine->GetIInsertOperations( getStudy()->id() );
+  GEOM::ListOfLong_var ids = myOperation->GetAllTextures();
+  for ( int i = 0; i < ids->length(); i++ )
+    addTexture( ids[i] );
+
+  // ---
+
+  GEOM::marker_type aType    = (GEOM::marker_type)-1;
+  GEOM::marker_size aSize    = (GEOM::marker_size)-1;
+  int               aTexture = 0;
+  if ( getStudy() ) {
+    LightApp_SelectionMgr* selMgr = qobject_cast<SalomeApp_Application*>( getStudy()->application() )->selectionMgr();
+    if ( selMgr ) {
+      SALOME_ListIO selected;
+      selMgr->selectedObjects( selected );
+      if ( !selected.IsEmpty() ) {
+       _PTR(Study) study = getStudy()->studyDS();
+       for ( SALOME_ListIteratorOfListIO it( selected ); it.More(); it.Next() ) {
+         _PTR(SObject) aSObject( study->FindObjectID( it.Value()->getEntry() ) );
+         GEOM::GEOM_Object_var anObject =
+           GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( aSObject ) );
+         if ( !anObject->_is_nil() ) {
+           GEOM::marker_type mtype = anObject->GetMarkerType();
+           if ( aType == -1 )
+             aType = mtype;
+           else if ( aType != mtype ) {
+             aType = (GEOM::marker_type)-1;
+             break;
+           }
+           if ( mtype > GEOM::MT_NONE && mtype < GEOM::MT_USER ) {
+             GEOM::marker_size msize = anObject->GetMarkerSize();
+             if ( aSize == -1 )
+               aSize = msize;
+             else if ( aSize != msize )
+               break;
+           }
+           else if ( mtype == GEOM::MT_USER ) {
+             int mtexture = anObject->GetMarkerTexture();
+             if ( aTexture == 0 )
+               aTexture = mtexture;
+             else if ( aTexture != mtexture )
+               break;
+           }
+         }
+       }
+      }
+    }
+  }
+  if ( aType > GEOM::MT_NONE && aType < GEOM::MT_USER )
+    setStandardMarker( aType, aSize );
+  else if ( aType == GEOM::MT_USER )
+    setCustomMarker( aTexture );
+  else
+    setStandardMarker((GEOM::marker_type)(resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS) + 1),
+                     (GEOM::marker_size)(resMgr->integerValue("Geometry", "marker_scale", 1)));
+}
+
+void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const
+{
+  if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
+    int tWidth, tHeight;
+    Handle(Graphic3d_HArray1OfBytes) texture = GeometryGUI::getTexture( getStudy(), id, tWidth, tHeight );
+    if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
+      QImage image( tWidth, tHeight, QImage::Format_Mono );
+      image.setColor( 0, qRgba( 0, 0, 0, 0   ) );
+      image.setColor( 1, qRgba( 0, 0, 0, 255 ) );
+      int bytesperline = tWidth/8;
+      for ( int j = texture->Lower(); j <= texture->Upper(); j++ ) {
+       uchar val = (uchar)texture->Value( j );
+       for ( int k = 0; k < 8; k++ ) {
+         int row = ( j - texture->Lower() ) / bytesperline;
+         int col = ( ( j - texture->Lower() ) % bytesperline ) * 8 + k;
+         image.setPixel( row, col, ( val & (1<<(8-k-1)) ) ? 1 : 0 );
+       }
+      }
+      QPixmap pixmap = QPixmap::fromImage( image );
+      if ( !pixmap.isNull() ) {
+       myCustomTypeCombo->addItem( pixmap, QString::number( id ) );
+       myCustomTypeCombo->setId( myCustomTypeCombo->count()-1, id );
+       if ( select ) myCustomTypeCombo->setCurrentId( id );
+      }
+    }
+  }
+}
+
+SalomeApp_Study* GEOMToolsGUI_MarkerDlg::getStudy() const
+{
+  return qobject_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+}
+
+void GEOMToolsGUI_MarkerDlg::browse()
+{
+  QStringList filters;
+  filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" );
+  QString aFileName = SUIT_Session::session()->activeApplication()->getFileName( true, QString(), filters.join( ";;" ), tr( "LOAD_TEXTURE_TLT" ), this );
+  if ( !aFileName.isEmpty() ) {
+    addTexture( myOperation->LoadTexture( aFileName.toLatin1().constData() ), true );
+  }
+}
+
+void GEOMToolsGUI_MarkerDlg::help()
+{
+  if ( getStudy() ) {
+    SalomeApp_Application* app = qobject_cast<SalomeApp_Application*>( getStudy()->application() );
+    app->onHelpContextModule( "GEOM", "point_marker_page.html" );
+  }
+}
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.h
new file mode 100644 (file)
index 0000000..e063c14
--- /dev/null
@@ -0,0 +1,78 @@
+// Copyright (C) 2007-2009  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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   : GEOMToolsGUI_MarkerDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
+#ifndef GEOMTOOLSGUI_MARKERDLG_H
+#define GEOMTOOLSGUI_MARKERDLG_H
+
+#include "GEOM_ToolsGUI.hxx"
+
+#include <QDialog>
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+
+class QButtonGroup;
+class QStackedWidget;
+class QtxComboBox;
+class SalomeApp_Study;
+
+class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_MarkerDlg : public QDialog
+{
+  Q_OBJECT
+
+public:
+  GEOMToolsGUI_MarkerDlg( QWidget* = 0 );
+  ~GEOMToolsGUI_MarkerDlg();
+
+  void                             setStandardMarker( GEOM::marker_type, GEOM::marker_size );
+  void                             setCustomMarker( int );
+  GEOM::marker_type                getMarkerType() const;
+  GEOM::marker_size                getStandardMarkerScale() const;
+  int                              getCustomMarkerID() const;
+
+  void                             accept();
+
+protected:
+  void                             keyPressEvent( QKeyEvent* );
+
+private:
+  void                             init();
+  void                             addTexture( int, bool = false ) const;
+  SalomeApp_Study*                 getStudy() const;
+
+private slots:
+  void                             browse();
+  void                             help();
+
+private:
+  GEOM::GEOM_IInsertOperations_var myOperation;
+  QButtonGroup*                    myTypeGroup;
+  QStackedWidget*                  myWGStack;
+  QtxComboBox*                     myStdTypeCombo;
+  QtxComboBox*                     myStdScaleCombo;
+  QtxComboBox*                     myCustomTypeCombo;
+};
+
+#endif // GEOMTOOLSGUI_MARKERDLG_H
index 06fda8bf05a2d012506f5658f600f8b0c9028e38..1a0a919b507f8cfb350a1606befe894573a349da 100644 (file)
@@ -34,19 +34,22 @@ salomeinclude_HEADERS =                             \
        GEOM_ToolsGUI.hxx                       \
        GEOMToolsGUI_NbIsosDlg.h                \
        GEOMToolsGUI_TransparencyDlg.h          \
-       GEOMToolsGUI_DeleteDlg.h
+       GEOMToolsGUI_DeleteDlg.h                \
+       GEOMToolsGUI_MarkerDlg.h
 
 dist_libGEOMToolsGUI_la_SOURCES =              \
        GEOMToolsGUI.cxx                        \
        GEOMToolsGUI_1.cxx                      \
        GEOMToolsGUI_TransparencyDlg.cxx        \
        GEOMToolsGUI_NbIsosDlg.cxx              \
-       GEOMToolsGUI_DeleteDlg.cxx
+       GEOMToolsGUI_DeleteDlg.cxx              \
+       GEOMToolsGUI_MarkerDlg.cxx
 
 MOC_FILES =                                    \
        GEOMToolsGUI_TransparencyDlg_moc.cxx    \
        GEOMToolsGUI_NbIsosDlg_moc.cxx          \
-       GEOMToolsGUI_DeleteDlg_moc.cxx
+       GEOMToolsGUI_DeleteDlg_moc.cxx          \
+       GEOMToolsGUI_MarkerDlg_moc.cxx
 
 nodist_libGEOMToolsGUI_la_SOURCES =            \
        $(MOC_FILES)
index 35d6d742dfe83f298877290a1b92e3b70e5299ca..58471eebb24b9d0e4c7987efdedde747936d6a1e 100644 (file)
 // function : GEOM_Gen_i()
 // purpose  : constructor to be called for servant creation.
 //============================================================================
-GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr orb,
-                      PortableServer::POA_ptr poa,
-                      PortableServer::ObjectId * contId,
-                      const char *instanceName,
-                      const char *interfaceName) :
+GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr            orb,
+                      PortableServer::POA_ptr   poa,
+                      PortableServer::ObjectId* contId,
+                      const char*               instanceName,
+                      const char*               interfaceName) :
   Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
 {
   _thisObj = this;
@@ -1587,7 +1587,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainShap
 void GEOM_Gen_i::RemoveObject(GEOM::GEOM_Object_ptr theObject)
 {
   CORBA::String_var anEntry = theObject->GetEntry();
-  Handle(GEOM_Object) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry);
+  Handle(GEOM_Object) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry, false);
   if (anObject.IsNull()) return;
   _impl->RemoveObject(anObject);
   return;
@@ -1808,19 +1808,19 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry)
 //=====================================================================================
 extern "C"
 {
-GEOM_I_EXPORT
-PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB*, PortableServer::POA*, PortableServer::ObjectId*, const char*, const char*);
-
-GEOM_I_EXPORT
-  PortableServer::ObjectId * GEOMEngine_factory(CORBA::ORB_ptr orb,
-                                               PortableServer::POA_ptr poa,
-                                               PortableServer::ObjectId * contId,
-                                               const char *instanceName,
-                                               const char * interfaceName)
+  /*
+  GEOM_I_EXPORT
+  PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB*, PortableServer::POA*, PortableServer::ObjectId*, const char*, const char*);
+  */
+  
+  GEOM_I_EXPORT
+  PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB_ptr            orb,
+                                              PortableServer::POA_ptr   poa,
+                                              PortableServer::ObjectId* contId,
+                                              const char*               instanceName,
+                                              const char*               interfaceName)
   {
-   GEOM_Gen_i * myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
-   // Don't understand the reason of this register ????
-//   myGEOM_Gen_i->register_name("/myGEOM_Gen"); // NRI : 11/07/2002 : Add for Supervision example
-   return myGEOM_Gen_i->getId();
+    GEOM_Gen_i* myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
+    return myGEOM_Gen_i->getId();
   }
 }
index b32b3eb717457407857f29ab3b4e210d04ab90ff..c5570650e29f0f78075416215f28ca22b108d241 100644 (file)
@@ -35,6 +35,7 @@
 #include "GEOM_Object.hxx"
 
 #include <TColStd_HSequenceOfAsciiString.hxx>
+#include <TDataStd_HArray1OfByte.hxx>
 
 //=============================================================================
 /*!
@@ -215,3 +216,52 @@ void GEOM_IInsertOperations_i::ExportTranslators
   theFormats  = aFormatsArray._retn();
   thePatterns = aPatternsArray._retn();
 }
+
+CORBA::Long GEOM_IInsertOperations_i::LoadTexture(const char* theTextureFile)
+{
+  GetOperations()->SetNotDone();
+  return GetOperations()->LoadTexture( theTextureFile );
+}
+
+CORBA::Long GEOM_IInsertOperations_i::AddTexture(CORBA::Long theWidth, CORBA::Long theHeight,
+                                                const SALOMEDS::TMPFile& theTexture)
+{
+  GetOperations()->SetNotDone();
+  Handle(TDataStd_HArray1OfByte) aTexture;
+  if ( theTexture.length() > 0 ) {
+    aTexture = new TDataStd_HArray1OfByte( 1, theTexture.length() );
+    for ( int i = 0; i < theTexture.length(); i++ )
+      aTexture->SetValue( i+1, (Standard_Byte)theTexture[i] );
+  }
+  return GetOperations()->AddTexture( theWidth, theHeight, aTexture );
+}
+
+SALOMEDS::TMPFile* GEOM_IInsertOperations_i::GetTexture(CORBA::Long theID, 
+                                                       CORBA::Long& theWidth,
+                                                       CORBA::Long& theHeight)
+{
+  int aWidth, aHeight;
+  Handle(TDataStd_HArray1OfByte) aTextureImpl = GetOperations()->GetTexture( theID, aWidth, aHeight );
+  theWidth  = aWidth;
+  theHeight = aHeight;
+  SALOMEDS::TMPFile_var aTexture;
+  if ( !aTextureImpl.IsNull() ) {
+    aTexture = new SALOMEDS::TMPFile;
+    aTexture->length( aTextureImpl->Length() );
+    for ( int i = aTextureImpl->Lower(); i <= aTextureImpl->Upper(); i++ )
+      aTexture[i-aTextureImpl->Lower()] = aTextureImpl->Value( i );
+  }
+  return aTexture._retn();
+}
+
+GEOM::ListOfLong* GEOM_IInsertOperations_i::GetAllTextures()
+{
+  std::list<int> localIDs = GetOperations()->GetAllTextures();
+  GEOM::ListOfLong_var anIDs = new GEOM::ListOfLong(localIDs.size());
+  anIDs->length(localIDs.size());
+  std::list<int>::const_iterator anIt;
+  int i = 0;
+  for( anIt = localIDs.begin(); anIt != localIDs.end(); ++anIt, i++)
+    anIDs[i] = *anIt;
+  return anIDs._retn();
+}
index da29eabf0600ea325980119fabc6fe97864b97d0..49a4269814373ed24306b0e5ef3bf502054eb20c 100644 (file)
@@ -27,6 +27,7 @@
 #include <SALOMEconfig.h>
 
 #include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_CLIENT_HEADER(SALOMEDS)
 #include "GEOM_IOperations_i.hh"
 #include "GEOM_Object_i.hh"
 
@@ -56,6 +57,15 @@ class GEOM_I_EXPORT GEOM_IInsertOperations_i :
   void ExportTranslators (GEOM::string_array_out theFormats,
                          GEOM::string_array_out thePatterns);
 
+  CORBA::Long LoadTexture(const char* theTextureFile);
+  CORBA::Long AddTexture(CORBA::Long theWidth, CORBA::Long theHeight, 
+                        const SALOMEDS::TMPFile& theTexture);
+  SALOMEDS::TMPFile* GetTexture(CORBA::Long theID, 
+                               CORBA::Long& theWidth,
+                               CORBA::Long& theHeight);
+
+  GEOM::ListOfLong* GetAllTextures();
+
   ::GEOMImpl_IInsertOperations* GetOperations()
   { return (::GEOMImpl_IInsertOperations*)GetImpl(); }
 };
index b99e24c226d5cad16d2fd6cd566a36e3f10e85a9..f164b4ef4bb9dc58916730914d297300ac57a73e 100644 (file)
@@ -184,6 +184,69 @@ CORBA::Boolean GEOM_Object_i::GetAutoColor()
 }
 
 
+//=============================================================================
+/*!
+ *  SetMarkerStd
+ */
+//=============================================================================
+void GEOM_Object_i::SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize)
+{
+  if ( theType == GEOM::MT_NONE || theSize == GEOM::MS_NONE ) {
+    _impl->UnsetMarker();
+  }
+  else {
+    Aspect_TypeOfMarker aType = (Aspect_TypeOfMarker)( (int)theType-1 );
+    double aSize = ((int)theSize+1)*0.5;
+    _impl->SetMarkerStd( aType, aSize );
+  }
+}
+
+
+//=============================================================================
+/*!
+ *  SetMarkerTexture
+ */
+//=============================================================================
+void GEOM_Object_i::SetMarkerTexture(CORBA::Long theTextureId)
+{
+  _impl->SetMarkerTexture( theTextureId );
+}
+
+
+//=============================================================================
+/*!
+ *  GetMarkerType
+ */
+//=============================================================================
+GEOM::marker_type GEOM_Object_i::GetMarkerType()
+{
+  return (GEOM::marker_type)( (int)_impl->GetMarkerType()+1 );
+}
+
+
+//=============================================================================
+/*!
+ *  GetMarkerSize
+ */
+//=============================================================================
+GEOM::marker_size GEOM_Object_i::GetMarkerSize()
+{
+  int aSize = (int)( _impl->GetMarkerSize()/0.5 ) - 1;
+  return aSize < GEOM::MS_10 || aSize > GEOM::MS_70 ? GEOM::MS_NONE : (GEOM::marker_size)aSize;
+}
+
+
+//=============================================================================
+/*!
+ *  GetMarkerTexture
+ */
+//=============================================================================
+CORBA::Long GEOM_Object_i::GetMarkerTexture()
+{
+  return _impl->GetMarkerTexture();
+}
+
+
 //=============================================================================
 /*!
  *  SetStudyEntry
index 13bb0290f7646f176e817c497914055a46a4e4e4..b6f16c3546410cac0d2e1917385926f8ec6e1e93 100644 (file)
@@ -62,6 +62,16 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
 
   virtual CORBA::Boolean GetAutoColor();
 
+  void SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize);
+  
+  void SetMarkerTexture(CORBA::Long theTextureId);
+  
+  GEOM::marker_type GetMarkerType();
+
+  GEOM::marker_size GetMarkerSize();
+
+  CORBA::Long GetMarkerTexture();
+  
   virtual void SetStudyEntry(const char* theEntry);
 
   virtual char* GetStudyEntry();
index e78b2aec4795f4242c78fb7f52a25a2a4acbf432..fb8c18bf8af5c028e2b6a20cd80a5570a7cf9bc8 100644 (file)
@@ -456,13 +456,13 @@ def TestOtherOperations (geompy, math):
 
   Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5])
   Solid_1 = geompy.MakeSolid([Shell_1])
-  NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, 0)
+  NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, True) # doUnionFaces = True
 
   geompy.addToStudy(Shell_1, "Shell_1")
   geompy.addToStudy(Solid_1, "Solid_1")
   geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1")
 
-  # RemoveExtraEdges
+  # RemoveExtraEdges (by default, doUnionFaces = False)
   freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces)
 
   geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")
@@ -529,7 +529,7 @@ def TestOtherOperations (geompy, math):
                                                      v_y, Loc, geompy.GEOM.ST_ON)
   for edge_i in edges_on_pln:
     geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)")
-    
+
   # GetShapesOnPlaneWithLocationIDs
   edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(
            blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON)
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              \
index 081435b2a381c053c390ee528123d9d4ece564d8..ebcb211ed24a4ab456314276727193be2738466b 100644 (file)
@@ -38,5 +38,5 @@ for k in dir(geom):
   if k[0] == '_':continue
   globals()[k]=getattr(geom,k)
 del k
-from geompyDC import ShapeType,GEOM,kind, info
+from geompyDC import ShapeType,GEOM,kind, info, PackData, ReadTexture
 
index 309c667e8c16b29427fbcd982badf9af343436e9..c8ef92793f9a967e0a405260321f5ad3903b1394 100644 (file)
@@ -93,9 +93,9 @@ ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE"
 def RaiseIfFailed (Method_name, Operation):
     if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
-    
+
 ## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary    
+## @ingroup l1_geompy_auxiliary
 def ParseParameters(*parameters):
     Result = []
     StringResult = ""
@@ -108,16 +108,16 @@ def ParseParameters(*parameters):
         else:
             Result.append(parameter)
             pass
-        
+
         StringResult = StringResult + str(parameter)
         StringResult = StringResult + ":"
         pass
     StringResult = StringResult[:len(StringResult)-1]
     Result.append(StringResult)
     return Result
-    
+
 ## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary    
+## @ingroup l1_geompy_auxiliary
 def ParseList(list):
     Result = []
     StringResult = ""
@@ -128,15 +128,15 @@ def ParseList(list):
         else:
             Result.append(str(parameter))
             pass
-        
+
         StringResult = StringResult + str(parameter)
         StringResult = StringResult + ":"
         pass
     StringResult = StringResult[:len(StringResult)-1]
     return Result, StringResult
-    
+
 ## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary    
+## @ingroup l1_geompy_auxiliary
 def ParseSketcherCommand(command):
     Result = ""
     StringResult = ""
@@ -168,6 +168,88 @@ def ParseSketcherCommand(command):
     Result = Result[:len(Result)-1]
     return Result, StringResult
 
+## Helper function which can be used to pack the passed string to the byte data.
+## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
+## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
+## For example,
+## \code
+## val = PackData("10001110") # val = 0xAE
+## val = PackData("1")        # val = 0x80
+## \endcode
+## @param data unpacked data - a string containing '1' and '0' symbols
+## @return data packed to the byte stream
+## @ingroup l1_geompy_auxiliary
+def PackData(data):
+    bytes = len(data)/8
+    if len(data)%8: bytes += 1
+    res = ""
+    for b in range(bytes):
+        d = data[b*8:(b+1)*8]
+        val = 0
+        for i in range(8):
+            val *= 2
+            if i < len(d):
+                if d[i] == "1": val += 1
+                elif d[i] != "0":
+                    raise "Invalid symbol %s" % d[i]
+                pass
+            pass
+        res += chr(val)
+        pass
+    return res
+
+## Read bitmap texture from the text file.
+## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
+## A zero symbol ('0') represents transparent pixel of the texture bitmap.
+## The function returns width and height of the pixmap in pixels and byte stream representing
+## texture bitmap itself.
+##
+## This function can be used to read the texture to the byte stream in order to pass it to
+## the AddTexture() function of geompy class.
+## For example,
+## \code
+## import geompy
+## geompy.init_geom(salome.myStudy)
+## texture = geompy.readtexture('mytexture.dat')
+## texture = geompy.AddTexture(*texture)
+## obj.SetMarkerTexture(texture)
+## \endcode
+## @param fname texture file name
+## @return sequence of tree values: texture's width, height in pixels and its byte stream
+## @ingroup l1_geompy_auxiliary
+def ReadTexture(fname):
+    try:
+        f = open(fname)
+        lines = [ l.strip() for l in f.readlines()]
+        f.close()
+        maxlen = 0
+        if lines: maxlen = max([len(x) for x in lines])
+        lenbytes = maxlen/8
+        if maxlen%8: lenbytes += 1
+        bytedata=""
+        for line in lines:
+            if len(line)%8:
+                lenline = (len(line)/8+1)*8
+                pass
+            else:
+                lenline = (len(line)/8)*8
+                pass
+            for i in range(lenline/8):
+                byte=""
+                for j in range(8):
+                    if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
+                    else: byte += "0"
+                    pass
+                bytedata += PackData(byte)
+                pass
+            for i in range(lenline/8, lenbytes):
+                bytedata += PackData("0")
+            pass
+        return lenbytes*8, len(lines), bytedata
+    except:
+        pass
+    return 0, 0, ""
+
 ## Kinds of shape enumeration
 #  @ingroup l1_geompy_auxiliary
 kind = GEOM.GEOM_IKindOfShape
@@ -179,7 +261,6 @@ class info:
     CLOSED   = 1
     UNCLOSED = 2
 
-
 class geompyDC(GEOM._objref_GEOM_Gen):
 
         def __init__(self):
@@ -436,7 +517,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
             RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
             return anObj
-           
+
         ## Create a tangent plane, corresponding to the given parameter on the given face.
         #  @param theFace The face for which tangent plane should be built.
         #  @param theParameterV vertical value of the center point (0.0 - 1.0).
@@ -559,7 +640,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakePlaneFace", self.BasicOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
+
        ## Create a plane, passing through the 2 vectors
         #  with center in a start point of the first vector.
         #  @param theVec1 Vector, defining center point and plane direction.
@@ -575,7 +656,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakePlane2Vec", self.BasicOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
+
        ## Create a plane, based on a Local coordinate system.
         #  @param theLCS  coordinate system, defining plane.
         #  @param theTrimSize Half size of a side of quadrangle face, representing the plane.
@@ -600,7 +681,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  @ref swig_MakeMarker "Example"
         def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
             # Example: see GEOM_TestAll.py
-            OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);  
+            OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
             anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
             RaiseIfFailed("MakeMarker", self.BasicOp)
             anObj.SetParameters(Parameters)
@@ -851,7 +932,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
             RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
             return anObj
-           
+
        ## Create a sketcher wire, following the numerical description,
         #  passed through <VAR>theCoordinates</VAR> argument. \n
        #  @param theCoordinates double values, defining points to create a wire,
@@ -908,12 +989,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
             RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
             return anObj
-           
+
         ## Create a face with specified dimensions along OX-OY coordinate axes,
         #  with edges, parallel to this coordinate axes.
         #  @param theH height of Face.
         #  @param theW width of Face.
-       #  @param theOrientation orientation belong axis OXY OYZ OZX 
+       #  @param theOrientation orientation belong axis OXY OYZ OZX
         #  @return New GEOM_Object, containing the created face.
         #
         #  @ref tui_creation_face "Example"
@@ -970,7 +1051,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
 
         ## Create a disk with specified dimensions along OX-OY coordinate axes.
         #  @param theR Radius of Face.
-       #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX 
+       #  @param theOrientation set the orientation belong axis OXY or OYZ or OZX
         #  @return New GEOM_Object, containing the created disk.
         #
         #  @ref tui_creation_face "Example"
@@ -1173,7 +1254,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
+
        ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
         #  @param theBase Base shape to be extruded.
         #  @param theDX, theDY, theDZ Directions of extrusion.
@@ -1187,7 +1268,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
+
        ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
         #  i.e. all the space, transfixed by the base shape during its translation
         #  along the vector on the given distance in 2 Ways (forward/backward) .
@@ -2749,15 +2830,17 @@ class geompyDC(GEOM._objref_GEOM_Gen):
                 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
             anObj.SetParameters(Parameters)
             return anObj
-           
-        ## Perform a fillet on the specified edges of the given wire shape
-        #  @param theShape - Wire Shape(with planar edges) to perform fillet on.
+
+        ## Perform a fillet on the specified edges of the given shape
+        #  @param theShape - Wire Shape to perform fillet on.
         #  @param theR - Fillet radius.
         #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
         #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
+        #    \note The list of vertices could be empty,
+        #          in this case fillet will done done at all vertices in wire
         #  @return New GEOM_Object, containing the result shape.
         #
-        #  @ref tui_fillet1d "Example"
+        #  @ref tui_fillet2d "Example"
         def MakeFillet1D(self,theShape, theR, theListOfVertexes):
             # Example: see GEOM_TestAll.py
             anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
@@ -2778,22 +2861,6 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("MakeFillet2D", self.LocalOp)
             return anObj
 
-        ## Perform a fillet on the specified edges of the given shape
-        #  @param theShape - Wire Shape to perform fillet on.
-        #  @param theR - Fillet radius.
-        #  @param theListOfVertexes Global indices of vertexes to perform fillet on.
-        #    \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
-        #    \note The list of vertices could be empty,
-        #          in this case fillet will done done at all vertices in wire
-        #  @return New GEOM_Object, containing the result shape.
-        #
-        #  @ref tui_fillet2d "Example"
-        def MakeFillet1D(self,theShape, theR, theListOfVertexes):
-            # Example: see GEOM_TestAll.py
-            anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
-            RaiseIfFailed("MakeFillet1D", self.LocalOp)
-            return anObj
-
         ## Perform a symmetric chamfer on all edges of the given shape.
         #  @param theShape Shape, to perform chamfer on.
         #  @param theD Chamfer size along each face.
@@ -3560,16 +3627,16 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         #  Unite faces and edges, sharing one surface. It means that
         #  this faces must have references to one C++ surface object (handle).
         #  @param theShape The compound or single solid to remove irregular edges from.
-        #  @param theOptimumNbFaces If more than zero, unite faces only for those solids,
-        #         that have more than theOptimumNbFaces faces. If zero, unite faces always,
-        #         regardsless their quantity in the solid. If negative (the default value),
-        #         do not unite faces at all. For blocks repairing recommended value is 6.
+        #  @param doUnionFaces If True, then unite faces. If False (the default value),
+        #         do not unite faces.
         #  @return Improved shape.
         #
         #  @ref swig_RemoveExtraEdges "Example"
-        def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
+        def RemoveExtraEdges(self, theShape, doUnionFaces=False):
             # Example: see GEOM_TestOthers.py
-            anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
+            nbFacesOptimum = -1 # -1 means do not unite faces
+            if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
+            anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
             RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
             return anObj
 
@@ -3890,6 +3957,37 @@ class geompyDC(GEOM._objref_GEOM_Gen):
         def addPath(self,Path):
             if (sys.path.count(Path) < 1):
                 sys.path.append(Path)
+                pass
+            pass
+
+        ## Load marker texture from the file
+        #  @param Path a path to the texture file
+        #  @return unique texture identifier
+        #  @ingroup l1_geompy_auxiliary
+        def LoadTexture(self, Path):
+            # Example: see GEOM_TestAll.py
+            ID = self.InsertOp.LoadTexture(Path)
+            RaiseIfFailed("LoadTexture", self.InsertOp)
+            return ID
+
+        ## Add marker texture. @a Width and @a Height parameters
+        #  specify width and height of the texture in pixels.
+        #  If @a RowData is @c True, @a Texture parameter should represent texture data
+        #  packed into the byte array. If @a RowData is @c False (default), @a Texture
+        #  parameter should be unpacked string, in which '1' symbols represent opaque
+        #  pixels and '0' represent transparent pixels of the texture bitmap.
+        #
+        #  @param Width texture width in pixels
+        #  @param Height texture height in pixels
+        #  @param Texture texture data
+        #  @param RowData if @c True, @a Texture data are packed in the byte stream
+        #  @ingroup l1_geompy_auxiliary
+        def AddTexture(self, Width, Height, Texture, RowData=False):
+            # Example: see GEOM_TestAll.py
+            if not RowData: Texture = PackData(Texture)
+            ID = self.InsertOp.AddTexture(Width, Height, Texture)
+            RaiseIfFailed("AddTexture", self.InsertOp)
+            return ID
 
 import omniORB
 #Register the new proxy for GEOM_Gen
index 65daf0124a42277f08290598c5eb7097c9c25a6b..a1cc0bdb98b436fe8c1d2a2913af4546586ecc39 100644 (file)
@@ -614,49 +614,50 @@ void GroupGUI_GroupDlg::selectAllSubShapes()
     return;
 
   GEOM::ListOfLong_var aSubShapes;
-  GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
-  aSubShapes = aShOp->SubShapeAllIDs(myMainObj, getShapeType(), false);
-  if ( aSubShapes->length() > 0) {
-    //   if ( !myPlaceCheckBox->isChecked() )
-    if ( subSelectionWay() == ALL_SUBSHAPES )
-      {
-        myIdList->clear();
-        
-        if ( !aShOp->IsDone() )
-          return;
-      }
-    else
-      {
-        aSubShapes = new GEOM::ListOfLong();
-        aSubShapes->length( myMain2InPlaceIndices.Extent() );
-        TColStd_DataMapIteratorOfDataMapOfIntegerInteger m2ip( myMain2InPlaceIndices );
-        for ( int i = 0; m2ip.More(); i++, m2ip.Next() )
-          aSubShapes[ i ] = m2ip.Key();
-      }
-    bool isBlocked = myIdList->signalsBlocked();
-    myIdList->blockSignals( true );
-    
-    for ( int i = 0, n = aSubShapes->length(); i < n; i++ ) {
-      CORBA::Long anIndex = aSubShapes[i];
-      if ( anIndex < 0 )
-        continue;
+
+  //   if ( !myPlaceCheckBox->isChecked() )
+  if ( subSelectionWay() == ALL_SUBSHAPES )
+    {
+      if ( !myIsShapeType )
+        return;
+      myIdList->clear();
+      GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+      aSubShapes = aShOp->SubShapeAllIDs(myMainObj, getShapeType(), false);
       
-      QListWidgetItem* anItem = 0;
-      QString text = QString( "%1" ).arg( anIndex );
-      if ( !myInPlaceObj->_is_nil() ) {
-        QList<QListWidgetItem*> found = myIdList->findItems( text, Qt::MatchExactly );
-        if ( found.count() ) anItem = found[0];
-      }
-      if ( !anItem ) {
-        anItem = new QListWidgetItem( text );
-        myIdList->addItem( anItem );
-      }
-      anItem->setSelected( true );
+      if ( !aShOp->IsDone() )
+        return;
     }
-
-    myIdList->blockSignals( isBlocked );
-    highlightSubShapes();
+  else
+    {
+      aSubShapes = new GEOM::ListOfLong();
+      aSubShapes->length( myMain2InPlaceIndices.Extent() );
+      TColStd_DataMapIteratorOfDataMapOfIntegerInteger m2ip( myMain2InPlaceIndices );
+      for ( int i = 0; m2ip.More(); i++, m2ip.Next() )
+        aSubShapes[ i ] = m2ip.Key();
+    }
+  bool isBlocked = myIdList->signalsBlocked();
+  myIdList->blockSignals( true );
+  
+  for ( int i = 0, n = aSubShapes->length(); i < n; i++ ) {
+    CORBA::Long anIndex = aSubShapes[i];
+    if ( anIndex < 0 )
+      continue;
+    
+    QListWidgetItem* anItem = 0;
+    QString text = QString( "%1" ).arg( anIndex );
+    if ( !myInPlaceObj->_is_nil() ) {
+      QList<QListWidgetItem*> found = myIdList->findItems( text, Qt::MatchExactly );
+      if ( found.count() ) anItem = found[0];
+    }
+    if ( !anItem ) {
+      anItem = new QListWidgetItem( text );
+      myIdList->addItem( anItem );
+    }
+    anItem->setSelected( true );
   }
+  
+  myIdList->blockSignals( isBlocked );
+  highlightSubShapes();
 }
 
 //=================================================================================
@@ -680,6 +681,17 @@ void GroupGUI_GroupDlg::add()
       aSelMgr->selectedSubOwners( aMap );
       if ( aMap.Size() == 1 )
         aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
+      else { // selected the same subshape as the main object
+        SALOME_ListIO aSelList;
+        TColStd_IndexedMapOfInteger aMap;
+        aSelMgr->selectedObjects(aSelList);
+        if (aSelList.Extent() == 1) {
+          Standard_Boolean aRes = Standard_False;
+          GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+          if ( aSelectedObject->_is_equivalent(myMainObj) )
+            aMapIndex.Add(1); // add index of the only subshape of selected type
+        }
+      }
     }
   }
   GEOM::ListOfGO anObjects;
@@ -859,6 +871,22 @@ void GroupGUI_GroupDlg::updateState()
       aSelMgr->selectedSubOwners( aMap );
       if ( aMap.Size() == 1 )
         aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
+      else { // selected the same subshape as the main object
+        SALOME_ListIO aSelList;
+        aSelMgr->selectedObjects(aSelList);
+        if (aSelList.Extent() == 1) {
+          myBusy = true;
+          Standard_Boolean aRes = Standard_False;
+          GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+          if ( aSelectedObject->_is_equivalent(myMainObj) ) {
+            aMapIndex.Add(1); // add index of the only subshape of selected type
+            TColStd_MapOfInteger anIds; // higlight selected index
+            anIds.Add(1);
+            aSelMgr->AddOrRemoveIndex(aSelList.First(), anIds, false);
+          }
+          myBusy = false;
+        }
+      }
     }
   }
 
index 23ecf22bc0dc1fd114c8ac34a43b77ab92acae78..72e6cb2fa51e9bf8ca8f1c871ec0cbcb1f804df1 100644 (file)
@@ -26,6 +26,8 @@
 //
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <IGESControl_Controller.hxx>
 #include <IGESControl_Writer.hxx>
 #include <Interface_Static.hxx>
@@ -73,6 +75,9 @@ IGESEXPORT_EXPORT
       if (theFormatName.IsEqual("IGES_5_3"))
         aBrepMode = 1;
 
+      // Set "C" numeric locale to save numbers correctly
+      Kernel_Utils::Localizer loc;
+
       // initialize writer
       IGESControl_Controller::Init();
       //IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"),
@@ -83,7 +88,10 @@ IGESEXPORT_EXPORT
       // perform shape writing
       ICW.AddShape( theShape );
       ICW.ComputeModel();
-      if ( ICW.Write( theFileName.ToCString() ) )
+      bool ok = ICW.Write( theFileName.ToCString() );
+      
+      // Return previous locale
+      if ( ok )
         return 1;
     }
     catch(Standard_Failure)
index 317442f8af52ba48265982692bcdedb6d42224ec..3d1912bf5514be63e4485a7eaf4fc7db31be9a77 100644 (file)
@@ -42,4 +42,4 @@ libIGESExport_la_CPPFLAGS =   \
 libIGESExport_la_LDFLAGS  =    \
        $(STDLIB)               \
        $(CAS_LDPATH) -lTKIGES  \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace
+       $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics
index 3b28d20092e512a80d52d790d9f8bc962b01e0e3..ec51293b04d1ea047d9a55bae99bfbf1067bef31 100644 (file)
@@ -26,6 +26,8 @@
 //
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <IFSelect_ReturnStatus.hxx>
 #include <IGESControl_Reader.hxx>
 #include <IGESData_IGESModel.hxx>
@@ -71,6 +73,9 @@ IGESIMPORT_EXPORT
                        TCollection_AsciiString&       theError,
                       const TDF_Label&)
   {
+    // Set "C" numeric locale to save numbers correctly
+    Kernel_Utils::Localizer loc;
+
     IGESControl_Reader aReader;
     TopoDS_Shape aResShape;
     Interface_Static::SetCVal("xstep.cascade.unit","M");
index 0252162d6474e1fa4ae16d0d806cdd1746385fbb..d12dceda68601cd395c1f056a84881c048d99c6e 100644 (file)
@@ -42,4 +42,4 @@ libIGESImport_la_CPPFLAGS =   \
 libIGESImport_la_LDFLAGS  =    \
        $(STDLIB)               \
        $(CAS_LDPATH) -lTKIGES  \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace
+       $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics
index 11d0ab3e0f1772b64c24b39d3879c3cfa0095921..13d6580283f667351f401c89353e9be1b084c5d6 100644 (file)
@@ -22,7 +22,7 @@
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : MeasureGUI_CheckCompoundOfBlocksDlg.cxx
 // Author : Vladimir KLYACHIN, Open CASCADE S.A.S. (vladimir.klyachin@opencascade.com)
-//
+
 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h"
 #include "MeasureGUI_Widgets.h"
 
@@ -123,8 +123,8 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::Init()
   connect( myGrp->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
   connect( myGrp->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
 
-  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), 
-          this, SLOT( SelectionIntoArgument() ) );
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "GEOM_BLOCKS_COMPOUND") );
   buttonOk()->setEnabled( false );
@@ -236,7 +236,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::ActivateThisDialog()
 // purpose  :
 //=================================================================================
 bool MeasureGUI_CheckCompoundOfBlocksDlg::getBCErrors( bool& theIsCompoundOfBlocks,
-                                                      GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
+                                                       GEOM::GEOM_IBlocksOperations::BCErrors& theErrors)
 {
   if ( myObj->_is_nil() )
     return false;
@@ -245,7 +245,9 @@ bool MeasureGUI_CheckCompoundOfBlocksDlg::getBCErrors( bool& theIsCompoundOfBloc
     try {
       GEOM::GEOM_IBlocksOperations::BCErrors_var aErrs;
       theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aErrs );
-      theErrors = aErrs;
+      if (anOper->IsDone() && aErrs->length() > 0)
+      //if (anOper->IsDone() && !aErrs._is_nil())
+        theErrors = aErrs;
     }
     catch ( const SALOME::SALOME_Exception& e ) {
       SalomeApp_Tools::QtCatchCorbaException( e );
@@ -266,6 +268,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
   bool isCompoundOfBlocks;
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
+    aMsg += tr( "GEOM_CHECK_BLOCKS_COMPOUND_FAILED" );
     myGrp->TextView1->setText( aMsg );
     myGrp->ListBox1->clear();
     myGrp->ListBox2->clear();
@@ -277,7 +280,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
     aMsg += tr( "GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS" );
     buttonOk()->setEnabled( false );
     buttonApply()->setEnabled( false );
-  } 
+  }
   else {
     aMsg += tr( "GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS" );
     buttonOk()->setEnabled( true );
@@ -295,29 +298,29 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
     aErrStr = "";
     switch ( aErrs[i].error ) {
       case GEOM::GEOM_IBlocksOperations::NOT_BLOCK :
-       aErrStr = "Not a Block";
+        aErrStr = "Not a Block";
         break;
       case GEOM::GEOM_IBlocksOperations::EXTRA_EDGE :
-       aErrStr = "Extra Edge";
+        aErrStr = "Extra Edge";
         break;
       case GEOM::GEOM_IBlocksOperations::INVALID_CONNECTION :
-       aErrStr = "Invalid Connection";
-       aErrStr += aConSfx;
-       aErrStr += QString::number( aConNum );
-       aConNum++;
+        aErrStr = "Invalid Connection";
+        aErrStr += aConSfx;
+        aErrStr += QString::number( aConNum );
+        aConNum++;
         break;
       case GEOM::GEOM_IBlocksOperations::NOT_CONNECTED :
-       aErrStr = "Not Connected";
+        aErrStr = "Not Connected";
         break;
       case GEOM::GEOM_IBlocksOperations::NOT_GLUED :
-       aErrStr = "Not Glued";
-       aErrStr += aGluedSfx;
-       aErrStr += QString::number( aGluedNum );
-       aGluedNum++;
+        aErrStr = "Not Glued";
+        aErrStr += aGluedSfx;
+        aErrStr += QString::number( aGluedNum );
+        aGluedNum++;
         break;
       default :
-       aErrStr = "";
-       break;
+        aErrStr = "";
+        break;
     }
     if ( !aErrStr.isEmpty() )
       aErrList.append( aErrStr );
@@ -355,11 +358,11 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
     myGrp->ListBox2->clear();
     return;
   }
-  
+
   GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
   GEOM::ListOfLong aObjLst = aErr.incriminated;
   TopoDS_Shape aSelShape;
-  TopoDS_Shape aSubShape; 
+  TopoDS_Shape aSubShape;
   TopTools_IndexedMapOfShape anIndices;
   QStringList aSubShapeList;
   QString aSubShapeName( "" );
@@ -369,8 +372,8 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
     for ( int i = 0, n = aObjLst.length(); i < n; i++ ) {
       aSubShapeName = "";
       aSubShape = anIndices.FindKey(aObjLst[i]);
-      if ( GEOMBase::GetShapeTypeString( aSubShape, aTypeString ) )    
-       aSubShapeName = QString( aTypeString ) + QString( "_" ) + QString::number( aObjLst[i] );        
+      if ( GEOMBase::GetShapeTypeString( aSubShape, aTypeString ) )
+        aSubShapeName = QString( aTypeString ) + QString( "_" ) + QString::number( aObjLst[i] );
       if ( !aSubShapeName.isEmpty() )
       aSubShapeList.append( aSubShapeName );
     }
@@ -391,7 +394,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
     return;
   QList<int> aIds;
   for ( int i = 0, n = myGrp->ListBox2->count(); i < n; i++ ) {
-    if ( myGrp->ListBox2->item( i )->isSelected() ) 
+    if ( myGrp->ListBox2->item( i )->isSelected() )
       aIds.append( i );
   }
   if ( aIds.count() < 1 )
@@ -404,11 +407,11 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
     myGrp->ListBox2->clear();
     return;
   }
-  
+
   GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aErrCurItem];
   GEOM::ListOfLong aObjLst = aErr.incriminated;
   TopoDS_Shape aSelShape;
-  TopoDS_Shape aSubShape; 
+  TopoDS_Shape aSubShape;
   TopTools_IndexedMapOfShape anIndices;
   if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) {
     QString aMess;
@@ -426,7 +429,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
         getDisplayer()->SetToActivate( false );
         aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs( aSubShape ) : 0;
         if ( aPrs )
-         displayPreview( aPrs, true );
+          displayPreview( aPrs, true );
       }
       catch ( const SALOME::SALOME_Exception& e ) {
         SalomeApp_Tools::QtCatchCorbaException( e );
index 113d7a931bf39a5d561c70f888158cdb726bfbcd..b88a14528c050e6feedf5982653b5a7f61377c0f 100644 (file)
@@ -44,6 +44,9 @@
 #include <vtkMatrix4x4.h>
 #include <vtkTransform.h>
 #include <vtkVectorText.h>
+#include <vtkCoordinate.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
 
 /*
   Class       : GEOM_VTKTrihedron
@@ -80,10 +83,7 @@ vtkStandardNewMacro( GEOM_VTKTrihedronAxis );
 
 GEOM_VTKTrihedronAxis::GEOM_VTKTrihedronAxis()
 {
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor( 0.0, 0.0, 1.0 );
-  SetProperty( aProperty );
-  aProperty->Delete();
+  VTKViewer_Axis::SetColor( 0.0, 0.0, 1.0 );
   myMatrix = vtkMatrix4x4::New();
   myTrsf = vtkTransform::New();
 }
@@ -122,15 +122,22 @@ void GEOM_VTKTrihedronAxis::SetSize( vtkFloatingPointType theSize )
   myArrowActor->SetUserMatrix( myMatrix );
   myArrowActor->SetPosition( aPosition );
     
+#ifdef IPAL21440
+  if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
+    aCoord->SetValue( aPosition );
+#else
   myLabelActor->SetPosition( 0, 0, 0 );
   myLabelActor->AddPosition( aPosition );
+#endif
 }
 
 void GEOM_VTKTrihedronAxis::Render(vtkRenderer* theRenderer)
 {
   myLineActor->Render( theRenderer );
   myArrowActor->Render( theRenderer );
+#ifndef IPAL21440
   myLabelActor->Render( theRenderer );
+#endif
 
   vtkCamera* aCamera = theRenderer->GetActiveCamera();
   SetCamera( aCamera );
@@ -158,25 +165,25 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis,
 
   vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
   aColor[ theRot ] = 1;
-  vtkProperty* aProperty = vtkProperty::New();
   if ( theColor[ 0 ] == -1 )
-    aProperty->SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
+    VTKViewer_Axis::SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
   else
-    aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
-  SetProperty( aProperty );
-  aProperty->Delete();
+    VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
 
+#ifdef IPAL21440
+  if      ( theRot == 0 ) myTextMapper->SetInput( "X" );
+  else if ( theRot == 1 ) myTextMapper->SetInput( "Y" );
+  else if ( theRot == 2 ) myTextMapper->SetInput( "Z" );
+#else
   if      ( theRot == 0 ) myVectorText->SetText( "X" );
   else if ( theRot == 1 ) myVectorText->SetText( "Y" );
   else if ( theRot == 2 ) myVectorText->SetText( "Z" );
+#endif
 }
 
 void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] )
 {
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
-  SetProperty( aProperty );
-  aProperty->Delete();
+  VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
 }
 
 
@@ -193,9 +200,18 @@ GEOM_VTKTrihedron::GEOM_VTKTrihedron()
   myMapper = vtkPolyDataMapper::New();
   myAxis[ 0 ] = myAxis[ 1 ] = myAxis[ 2 ] = 0;
   mySize = 100;
-  SetInfinitive( true );
-  myColor[ 0 ] = myColor[ 1 ] = myColor[ 1 ] = -1;
-  SetInfinitive( true );
+
+  myColor[ 0 ] = myColor[ 1 ] = myColor[ 2 ] = -1;
+
+  myDefaultColor[ 0 ] = myDefaultColor[ 1 ] = myDefaultColor[ 2 ] = 1;
+
+  myPreHighlightColor[ 0 ] = 0;
+  myPreHighlightColor[ 1 ] = myPreHighlightColor[ 2 ] = 1;
+
+  myHighlightColor[ 0 ] = myHighlightColor[ 1 ] = myHighlightColor[ 2 ] = 1;
+
+  //SetInfinitive( true );
+  SetPickable( true );
 }
 
 GEOM_VTKTrihedron::~GEOM_VTKTrihedron()
@@ -247,6 +263,12 @@ void GEOM_VTKTrihedron::SetSize( vtkFloatingPointType theSize )
   aRes->Delete();
 }
 
+void GEOM_VTKTrihedron::SetVisibility( int theVisibility )
+{
+  Superclass::SetVisibility( theVisibility );
+  SetVisibility( theVisibility == 1 ? VTKViewer_Trihedron::eOn : VTKViewer_Trihedron::eOff );
+}
+
 void GEOM_VTKTrihedron::SetVisibility( VTKViewer_Trihedron::TVisibility theVis )
 {
   for ( int i = 0; i < 3; i++ )
@@ -361,21 +383,48 @@ bool GEOM_VTKTrihedron::IsSetCamera() const
 
 bool GEOM_VTKTrihedron::IsResizable() const
 {
-  return true;
+  return false;
 }
 
+void GEOM_VTKTrihedron::Highlight( bool theIsHighlight )
+{
+  if( theIsHighlight )
+    SetAxesColors( myHighlightColor );
+  else
+    ResetAxesColors();
 
+  Superclass::Highlight( theIsHighlight );
+}
 
+bool GEOM_VTKTrihedron::PreHighlight( vtkInteractorStyle *theInteractorStyle, 
+                                      SVTK_SelectionEvent* theSelectionEvent,
+                                      bool theIsHighlight )
+{
+  if ( !GetPickable() )
+    return false;  
 
+  if ( !isHighlighted() )
+  {
+    if( theIsHighlight )
+      SetAxesColors( myPreHighlightColor );
+    else
+      ResetAxesColors();
+  }
 
+  return Superclass::PreHighlight( theInteractorStyle, theSelectionEvent, theIsHighlight );
+}
 
+void GEOM_VTKTrihedron::ResetAxesColors()
+{
+  if( myColor[0] != -1 )
+    SetAxesColors( myColor );
+  else
+    SetAxesColors( myDefaultColor, true );
+}
 
-
-
-
-
-
-
-
-
-
+void GEOM_VTKTrihedron::SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse )
+{
+  myAxis[ 0 ]->SetColor( theColor[0], theIsDiffuse ? 0.0 : theColor[1], theIsDiffuse ? 0.0 : theColor[2] );
+  myAxis[ 1 ]->SetColor( theIsDiffuse ? 0.0 : theColor[0], theColor[1], theIsDiffuse ? 0.0 : theColor[2] );
+  myAxis[ 2 ]->SetColor( theIsDiffuse ? 0.0 : theColor[0], theIsDiffuse ? 0.0 : theColor[1], theColor[2] );
+}
index 9dde2edd4a829ae32db1622743c674f9abc8937c..7808b0b6059b08abf975241f92382329ea1a76da 100644 (file)
@@ -57,6 +57,7 @@ public:
 
   virtual vtkFloatingPointType      GetSize() { return mySize;}
 
+  virtual void                      SetVisibility( int theVisibility );
   virtual void                      SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
   virtual void                      VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
   virtual void                      VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
@@ -79,7 +80,16 @@ public:
   void                              SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
   void                              GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
 
-  virtual bool                      hasHighlight() { return false; } 
+  virtual bool                      hasHighlight() { return true; } 
+
+  virtual void                      Highlight( bool theHighlight );
+  virtual bool                      PreHighlight( vtkInteractorStyle* theInteractorStyle,
+                                                  SVTK_SelectionEvent* theSelectionEvent,
+                                                  bool theIsHighlight );
+
+protected:
+  virtual void                      ResetAxesColors();
+  virtual void                      SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse = false );
 
 protected:
   VTKViewer_Axis*                   myAxis[3];
@@ -88,6 +98,9 @@ protected:
   gp_Pnt                            myLocation;
   gp_Dir                            myDirX, myDirY, myDirZ;
   vtkFloatingPointType              myColor[ 3 ];
+  vtkFloatingPointType              myDefaultColor[ 3 ];
+  vtkFloatingPointType              myPreHighlightColor[ 3 ];
+  vtkFloatingPointType              myHighlightColor[ 3 ];
 };
 
 #endif
index d3220fed89829a38281e420a0e100e5f3e183292..56f9cb31a98bbed73b9694a0c1df5428875bdd40 100644 (file)
@@ -139,6 +139,8 @@ void OperationGUI_Fillet1d2dDlg::Init()
 
   initName(myIs1D ? tr("GEOM_FILLET_1D") : tr("GEOM_FILLET_2D"));
   GroupVertexes->PushButton1->click();
+
+  SelectionIntoArgument();
 }
 
 //=================================================================================
index 3748333cb2dfa369717890f7eac878b1f61bed59..3371f010542098b24f810401ff51e711210c8a62 100644 (file)
@@ -43,6 +43,6 @@ libSTEPExport_la_CPPFLAGS =   \
        $(KERNEL_CXXFLAGS)
 
 libSTEPExport_la_LDFLAGS  =                    \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace    \
+       $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
        $(STDLIB)                               \
        $(CAS_LDPATH) -lTKSTEP
index 75fd79cfe8fb0d33cf937205934d99b7affeedf1..6c2e9fac17bcf2a28fd61f03941d0afb77812705 100644 (file)
@@ -26,6 +26,8 @@
 //
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <IFSelect_ReturnStatus.hxx>
 
 #include <STEPControl_Writer.hxx>
@@ -67,6 +69,9 @@ STEPEXPORT_EXPORT
 
   try 
     {
+      // Set "C" numeric locale to save numbers correctly
+      Kernel_Utils::Localizer loc;
+
       IFSelect_ReturnStatus status ;
       //VRV: OCC 4.0 migration
       STEPControl_Writer aWriter;
@@ -76,7 +81,9 @@ STEPEXPORT_EXPORT
       status = aWriter.Transfer( theShape, STEPControl_AsIs );
       //VRV: OCC 4.0 migration
       if ( status == IFSelect_RetDone ) 
-         status = aWriter.Write( theFileName.ToCString() ) ;
+         status = aWriter.Write( theFileName.ToCString() );
+
+      // Return previous locale
       if ( status == IFSelect_RetDone ) 
        return 1;
     }
index f5e90dabdc9e96dff752259d0937b5a72fa2be94..a03e4d7822d41214cb7fe93d148d2a315ffff71d 100644 (file)
@@ -43,6 +43,6 @@ libSTEPImport_la_CPPFLAGS =   \
        $(KERNEL_CXXFLAGS)
 
 libSTEPImport_la_LDFLAGS  =                    \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace    \
+       $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
        $(STDLIB)                               \
        $(CAS_LDPATH) -lTKSTEP
index f021d3a79ac31b5d64de6ae54e919b85108672ab..e4786f2aa4b701d077277ec13cc8c046e483b8f3 100644 (file)
@@ -26,6 +26,8 @@
 //
 #include "utilities.h"
 
+#include <Basics_Utils.hxx>
+
 #include <BRep_Builder.hxx>
 
 #include <IFSelect_ReturnStatus.hxx>
@@ -74,6 +76,8 @@ STEPIMPORT_EXPORT
                       const TDF_Label&)
   {
     MESSAGE("Import STEP model from file " << theFileName.ToCString());
+    // Set "C" numeric locale to save numbers correctly
+    Kernel_Utils::Localizer loc;
     TopoDS_Shape aResShape;
     //VRV: OCC 4.0 migration
     STEPControl_Reader aReader;
@@ -152,6 +156,7 @@ STEPIMPORT_EXPORT
       theError = aFail->GetMessageString();
       aResShape.Nullify();
     }
+    // Return previous locale
     return aResShape;
   }
 }
index bb37c2f91731de9ab81f33e14c4e9f8ff4f658eb..f5d58b65829dc7e691980f7e7980f0230e07cb9d 100644 (file)
@@ -289,10 +289,11 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
   }
 
   // clear selection
-  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   myGeomGUI->getApp()->selectionMgr()->clearSelected();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-          this, SLOT(SelectionIntoArgument()));
+  this, SLOT(SelectionIntoArgument()));*/
+  // here commented, because multiple objects can be selected IPAL 21437
 
   displayPreview();
 }
index 6a04c1b988a823bb745a189392ffc5acdfc8895b..8f01e524645ad93ef898fd968790e6ca2568f107 100644 (file)
@@ -425,10 +425,11 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument()
   }
 
   // clear selection
-  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   myGeomGUI->getApp()->selectionMgr()->clearSelected();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-          this, SLOT(SelectionIntoArgument()));
+  this, SLOT(SelectionIntoArgument()));*/
+  // here commented, because multiple objects can be selected IPAL 21437
 
   displayPreview();
 }
index 5e68057be8d7082c80b9c39e3a698a4a6fbb5025..1ff6844600cacf66b782ad79f948fa1953a3204c 100644 (file)
@@ -332,10 +332,10 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
   myEditCurrentArgument->setText(aName);
 
   if (myEditCurrentArgument == GroupPoints->LineEdit1) {
-    if (myObjects.length()) {
+    /*    if (myObjects.length()) {
       if (getConstructorId() == 0 && myAxis->_is_nil() || getConstructorId() == 1 && myCentPoint->_is_nil() )
        GroupPoints->PushButton2->click();
-    }
+        }*/   // here commented, because multiple objects can be selected IPAL 21437
   }
   else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0) {
     myAxis = aSelectedObject;
@@ -359,10 +359,11 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
   }
 
   // clear selection
-  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   myGeomGUI->getApp()->selectionMgr()->clearSelected();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-          this, SLOT(SelectionIntoArgument()));
+  this, SLOT(SelectionIntoArgument()));*/
+  // here commented, because multiple objects can be selected IPAL 21437
 
   displayPreview();
 }
index 3384b18167423ba6a9098330e30c1c8a522b6698..6ad61b4ec17d49a6dbd3db6a0bf5e6429e38ba87 100644 (file)
@@ -344,10 +344,11 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
   }
 
   // clear selection
-  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   myGeomGUI->getApp()->selectionMgr()->clearSelected();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-          this, SLOT(SelectionIntoArgument()));
+  this, SLOT(SelectionIntoArgument()));*/
+  // here commented, because multiple objects can be selected IPAL 21437
 
   displayPreview();
 }
index b498d5a68fbe8f9153bdeee5c7e3cda87d539f65..5bdd8ee5ffb2fd44ebad9c9a5fa6b61da332ed35 100644 (file)
@@ -396,10 +396,11 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
   }
 
   // clear selection
-  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  /*  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   myGeomGUI->getApp()->selectionMgr()->clearSelected();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-          this, SLOT(SelectionIntoArgument()));
+  this, SLOT(SelectionIntoArgument()));*/
+  // here commented, because multiple objects can be selected IPAL 21437
 
   displayPreview();
 }