]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020654: [CEA 386] GetType() function
authordmv <dmv@opencascade.com>
Tue, 19 Jan 2010 15:09:43 +0000 (15:09 +0000)
committerdmv <dmv@opencascade.com>
Tue, 19 Jan 2010 15:09:43 +0000 (15:09 +0000)
doc/salome/gui/GEOM/input/geometrical_object_properties.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/index.doc
src/GEOM_SWIG/geompyDC.py

diff --git a/doc/salome/gui/GEOM/input/geometrical_object_properties.doc b/doc/salome/gui/GEOM/input/geometrical_object_properties.doc
new file mode 100644 (file)
index 0000000..21b72f7
--- /dev/null
@@ -0,0 +1,85 @@
+/*!
+
+\page geometrical_obj_prop_page Geometrical Object Properties
+
+<h2>Geometrical Object Type</h2>
+
+The <b>Type</b> property of the geometrical object specifies the 
+way the object has been created. It is an integer identifier that 
+has predefined value depending on the function type used for the 
+object creation. The type of the object can be retrieved using the 
+<b>GetType()</b> function.
+
+<b>For example</b>: the geometrical object created using MakeBox() 
+functions has type equal to 7. The shape imported from the BREP, 
+IGES, STEP or other CAD file, has type equal to 1.
+
+The possible values of the geometrical objects are listed in the table below: 
+
+<table border="1" align="center" width="250" cellpadding="3"
+            cellspacing="0" bgcolor="#EEEEEE">
+            <tr align=center bgcolor=#999999><td>ID</td><td>STRING</td></tr>
+            <tr align=center><td>0</td><td>COPY</td></tr>
+            <tr align=center><td>1</td><td>IMPORT</td></tr>
+            <tr align=center><td>2</td><td>POINT</td></tr>
+            <tr align=center><td>3</td><td>VECTOR</td></tr>
+            <tr align=center><td>4</td><td>PLANE</td></tr>
+            <tr align=center><td>5</td><td>LINE</td></tr>
+            <tr align=center><td>6</td><td>TORUS</td></tr>
+            <tr align=center><td>7</td><td>BOX</td></tr>
+            <tr align=center><td>8</td><td>CYLINDER</td></tr>
+            <tr align=center><td>9</td><td>CONE</td></tr>
+            <tr align=center><td>10</td><td>SPHERE</td></tr>
+            <tr align=center><td>11</td><td>PRISM</td></tr>
+            <tr align=center><td>12</td><td>REVOLUTION</td></tr>
+            <tr align=center><td>13</td><td>BOOLEAN</td></tr>
+            <tr align=center><td>14</td><td>PARTITION</td></tr>
+            <tr align=center><td>15</td><td>POLYLINE</td></tr>
+            <tr align=center><td>16</td><td>CIRCLE</td></tr>
+            <tr align=center><td>17</td><td>SPLINE</td></tr>
+            <tr align=center><td>18</td><td>ELLIPSE</td></tr>
+            <tr align=center><td>19</td><td>CIRC_ARC</td></tr>
+            <tr align=center><td>20</td><td>FILLET</td></tr>
+            <tr align=center><td>21</td><td>CHAMFER</td></tr>
+            <tr align=center><td>22</td><td>EDGE</td></tr>
+            <tr align=center><td>23</td><td>WIRE</td></tr>
+            <tr align=center><td>24</td><td>FACE</td></tr>
+            <tr align=center><td>25</td><td>SHELL</td></tr>
+            <tr align=center><td>26</td><td>SOLID</td></tr>
+            <tr align=center><td>27</td><td>COMPOUND</td></tr>
+            <tr align=center><td>28</td><td>SUBSHAPE</td></tr>
+            <tr align=center><td>29</td><td>PIPE</td></tr>
+            <tr align=center><td>30</td><td>ARCHIMEDE</td></tr>
+            <tr align=center><td>31</td><td>FILLING</td></tr>
+            <tr align=center><td>32</td><td>EXPLODE</td></tr>
+            <tr align=center><td>33</td><td>GLUED</td></tr>
+            <tr align=center><td>34</td><td>SKETCHER</td></tr>
+            <tr align=center><td>35</td><td>CDG</td></tr>
+            <tr align=center><td>36</td><td>FREE_BOUNDS</td></tr>
+            <tr align=center><td>37</td><td>GROUP</td></tr>
+            <tr align=center><td>38</td><td>BLOCK</td></tr>
+            <tr align=center><td>39</td><td>MARKER</td></tr>
+            <tr align=center><td>40</td><td>THRUSECTIONS</td></tr>
+            <tr align=center><td>41</td><td>COMPOUNDFILTER</td></tr>
+            <tr align=center><td>42</td><td>SHAPES_ON_SHAPE</td></tr>
+            <tr align=center><td>43</td><td>ELLIPSE_ARC</td></tr>
+            <tr align=center><td>44</td><td>3DSKETCHER</td></tr>
+            <tr align=center><td>45</td><td>FILLET_2D</td></tr>
+            <tr align=center><td>46</td><td>FILLET_1D</td></tr>
+</table>
+
+Also geompy.py module provides a helper function ShapeIdToType() 
+that allows converting of the geometrical object type id value 
+to its string representation.
+
+<b>For example:</b>
+\code
+import geompy
+box = geompy.MakeBoxDXDYDZ(10,10,10)
+type = geompy.ShapeIdToType(box.GetType())
+print type
+\endcode
+
+The above code prints "BOX" value. 
+
+*/
index 96045dd6f220956f431a1a2846a13864223cfa75..d1485ef1417849b7efccc9d2c4250220871404dc 100644 (file)
@@ -13,6 +13,7 @@ using a wide range of functions;</li>
 <li>\subpage transform_geom_obj_page "transformation of geometrical objects" using
 various algorithms;</li>
 <li>\subpage repairing_operations_page "optimization of geometrical objects";</li>
+<li>\subpage geometrical_obj_prop_page "Geometrical object properties".</li>
 <li>\subpage using_measurement_tools_page "provision of information about geometrical objects".</li>
 <li>\subpage using_notebook_geom_page.</li>
 </ul>
index 1788293dda6d4ee0ab96fb41c63a1e2039bf5f7f..13a4c5ef60b12f0f42b45cc02a182f666a7bbfac 100644 (file)
@@ -3898,6 +3898,107 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             RaiseIfFailed("GetType", self.GroupOp)
             return aType
 
+        ## Convert a type of geom object from id to string value
+        #  @param theId is a GEOM obect type id.
+        #
+        #  @ref swig_GetType "Example"
+        def ShapeIdToType(self, theId):
+            if theId == 0:
+                return "COPY"
+            if theId == 1:
+                return "IMPORT"
+            if theId == 2:
+                return "POINT"
+            if theId == 3:
+                return "VECTOR"
+            if theId == 4:
+                return "PLANE"
+            if theId == 5:
+                return "LINE"
+            if theId == 6:
+                return "TORUS"
+            if theId == 7:
+                return "BOX"
+            if theId == 8:
+                return "CYLINDER"
+            if theId == 9:
+                return "CONE"
+            if theId == 10:
+                return "SPHERE"
+            if theId == 11:
+                return "PRISM"
+            if theId == 12:
+                return "REVOLUTION"
+            if theId == 13:
+                return "BOOLEAN"
+            if theId == 14:
+                return "PARTITION"
+            if theId == 15:
+                return "POLYLINE"
+            if theId == 16:
+                return "CIRCLE"
+            if theId == 17:
+                return "SPLINE"
+            if theId == 18:
+                return "ELLIPSE"
+            if theId == 19:
+                return "CIRC_ARC"
+            if theId == 20:
+                return "FILLET"
+            if theId == 21:
+                return "CHAMFER"
+            if theId == 22:
+                return "EDGE"
+            if theId == 23:
+                return "WIRE"
+            if theId == 24:
+                return "FACE"
+            if theId == 25:
+                return "SHELL"
+            if theId == 26:
+                return "SOLID"
+            if theId == 27:
+                return "COMPOUND"
+            if theId == 28:
+                return "SUBSHAPE"
+            if theId == 29:
+                return "PIPE"
+            if theId == 30:
+                return "ARCHIMEDE"
+            if theId == 31:
+                return "FILLING"
+            if theId == 32:
+                return "EXPLODE"
+            if theId == 33:
+                return "GLUED"
+            if theId == 34:
+                return "SKETCHER"
+            if theId == 35:
+                return "CDG"
+            if theId == 36:
+                return "FREE_BOUNDS"
+            if theId == 37:
+                return "GROUP"
+            if theId == 38:
+                return "BLOCK"
+            if theId == 39:
+                return "MARKER"
+            if theId == 40:
+                return "THRUSECTIONS"
+            if theId == 41:
+                return "COMPOUNDFILTER"
+            if theId == 42:
+                return "SHAPES_ON_SHAPE"
+            if theId == 43:
+                return "ELLIPSE_ARC"
+            if theId == 44:
+                return "3DSKETCHER"
+            if theId == 45:
+                return "FILLET_2D"
+            if theId == 46:
+                return "FILLET_1D"
+            return "Shape Id not exist."
+
         ## Returns a main shape associated with the group
         #  @param theGroup is a GEOM group for which a main shape object is requested
         #  @return a GEOM object which is a main shape for theGroup