Salome HOME
Initial support of publication of shapes
[modules/shaper_study.git] / src / PY / SHAPERSTUDY_Object.py
1 # Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 import SHAPERSTUDY_ORB__POA
24 import GEOM
25 from SHAPERSTUDY_utils import getEngine
26
27 class SHAPERSTUDY_BaseObject(SHAPERSTUDY_ORB__POA.BaseObject):
28     """
29     Construct an instance of SHAPER_BaseObject.
30     """
31     def __init__ ( self, *args):
32         pass
33
34     def GetName( self ):
35         """
36         Get name of the object associated with this object.
37         """
38         return ""
39
40     def GetEntry( self ):
41         """
42         Get internal (unique) entry of the object in the component's data tree.
43         """
44         return '0:0:0:1'
45
46     def GetType( self ):
47         """
48         Get internal type of operation created this object.
49         In SMESH is used to find out if an object is GROUP (type == 37)
50         """
51         return 1
52
53     def GetTick( self ):
54         """
55         Get value of a modification counter of the object
56         """
57         return 1
58
59     def GetStudyEntry( self ):
60         """
61         Get a Study entry where this object was published.
62         """
63         return '0:0:0:1'
64
65     def IsShape( self ):
66         """
67         Return true if geom object representes a shape.
68         For example, method return false for GEOM_MARKER
69         """
70         return False
71
72     def IsSame( self, other ):
73         """
74         Return true if passed object is identical to this object
75         """
76         return False
77
78     def GetGen( self ):
79         """
80         Return the engine creating this object
81         """
82         return getEngine()
83
84     pass
85
86
87
88 class SHAPERSTUDY_Object(SHAPERSTUDY_ORB__POA.SHAPER_Object):
89     """
90     Construct an instance of SHAPERSTUDY Object.
91     """
92     def __init__ ( self, *args):
93         pass
94
95     def GetShapeType( self ):
96         """
97         Get a GEOM.shape_type of the object value.
98         """
99         return GEOM.SHAPE
100
101     def IsMainShape( self ):
102         """
103         Returns True if this object is not a sub-shape of another object.
104         """
105         return False
106
107     def GetSubShapeIndices( self ):
108         """
109         Get a list of ID's of sub-shapes in the main shape.
110         """
111         return [1]
112
113     def GetMainShape( self ):
114         """
115         Get a main shape object to which this object is a sub-shape.
116         """
117         return
118
119     def getShape( self ):
120         """
121         Get the TopoDS_Shape, for colocated case only.
122         Called by GEOM_Client to get TopoDS_Shape pointer
123         """
124         return 0
125
126     def GetShapeStream( self ):
127         """
128         Get geometric shape of the object as a byte stream in BRep format
129         """
130         return ;
131
132     def SetShapeByStream(self, theStream):
133         """
134         Sets geometric shape content of the object as a byte stream in BRep format
135         """
136         return ;
137
138     pass