--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>SHAPER_ICON_SOLID</source>
+ <translation>solid.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_COMPSOLID</source>
+ <translation>compsolid.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_FACE</source>
+ <translation>face.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_EDGE</source>
+ <translation>edge.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_SHELL</source>
+ <translation>shell.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_VERTEX</source>
+ <translation>vertex.png</translation>
+ </message>
+ <message>
+ <source>SHAPER_ICON_WIRE</source>
+ <translation>wire.png</translation>
+ </message>
+ </context>
+</TS>
from SHAPERSTUDY_utils import findOrCreateComponent, moduleName, getStudy, getORB
import salome
import SHAPERSTUDY_Object
+import GEOM
__entry2IOR__ = {}
+
class SHAPERSTUDY(SHAPERSTUDY_ORB__POA.Gen,
SALOME_ComponentPy.SALOME_ComponentPy_i,
SALOME_DriverPy.SALOME_DriverPy_i):
ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
+
+ ShaperIcons = {GEOM.COMPOUND:"SHAPER_ICON_COMPSOLID",
+ GEOM.COMPSOLID:"SHAPER_ICON_COMPSOLID",
+ GEOM.SOLID:"SHAPER_ICON_SOLID",
+ GEOM.SHELL:"SHAPER_ICON_SHELL",
+ GEOM.FACE:"SHAPER_ICON_FACE",
+ GEOM.WIRE:"SHAPER_ICON_WIRE",
+ GEOM.EDGE:"SHAPER_ICON_EDGE",
+ GEOM.VERTEX:"SHAPER_ICON_VERTEX",
+ GEOM.SHAPE:"SHAPER_ICON_SOLID",
+ GEOM.FLAT:"SHAPER_ICON_FACE"}
def __init__ ( self, orb, poa, contID, containerName, instanceName, interfaceName ):
"""
theFather = findOrCreateComponent()
aResultSO = aBuilder.NewObject(theFather);
aResultSO.SetAttrString("AttributeName", theName)
- if theObject:
- anIOR = salome.orb.object_to_string(theObject)
- aResultSO.SetAttrString("AttributeIOR", anIOR)
- theObject.SetSO(aResultSO)
+
+
+ if theObject is not None:
+ anIOR = salome.orb.object_to_string(theObject)
+ aResultSO.SetAttrString("AttributeIOR", anIOR)
+ theObject.SetSO(aResultSO)
+
+ aType = theObject.GetShapeType()
+ aAttr = aBuilder.FindOrCreateAttribute(aResultSO, "AttributePixMap")
+ aPixmap = aAttr._narrow(salome.SALOMEDS.AttributePixMap)
+ aPixmap.SetPixMap(SHAPERSTUDY.ShaperIcons[aType])
+
# add a red-reference that means that this is an active reference to SHAPER result
aSub = aBuilder.NewObject(aResultSO)
aBuilder.Addreference(aSub, aResultSO)