2006-06-01 17:39:17 +06:00
|
|
|
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2003-07-10 19:41:56 +06:00
|
|
|
#
|
2006-06-01 17:39:17 +06:00
|
|
|
# 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.
|
2003-07-10 19:41:56 +06:00
|
|
|
#
|
2006-06-01 17:39:17 +06:00
|
|
|
# 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
|
2003-07-10 19:41:56 +06:00
|
|
|
#
|
|
|
|
# File : batchmode_smesh.py
|
|
|
|
# Author : Oksana TCHEBANOVA
|
|
|
|
# Module : SMESH
|
2003-05-19 20:07:00 +06:00
|
|
|
# $Header$
|
|
|
|
|
|
|
|
from batchmode_salome import *
|
2004-12-01 15:48:31 +05:00
|
|
|
from batchmode_geompy import ShapeType
|
2003-05-19 20:07:00 +06:00
|
|
|
import SMESH
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
|
|
|
|
|
|
|
|
smesh = lcc.FindOrLoadComponent("FactoryServer", "SMESH")
|
|
|
|
myStudyBuilder = myStudy.NewBuilder()
|
|
|
|
|
|
|
|
if myStudyBuilder is None:
|
|
|
|
raise RuntimeError, " Null myStudyBuilder"
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
father = myStudy.FindComponent("SMESH")
|
2003-05-19 20:07:00 +06:00
|
|
|
if father is None:
|
2004-12-01 15:48:31 +05:00
|
|
|
father = myStudyBuilder.NewComponent("SMESH")
|
|
|
|
FName = myStudyBuilder.FindOrCreateAttribute(father, "AttributeName")
|
|
|
|
Comp = modulecatalog.GetComponent("SMESH")
|
|
|
|
FName.SetValue(Comp._get_componentusername())
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(father, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap("ICON_OBJBROWSER_Mesh")
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
myStudyBuilder.DefineComponentInstance(father,smesh)
|
|
|
|
|
|
|
|
mySComponentMesh = father._narrow(SALOMEDS.SComponent)
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
Tag_HypothesisRoot = 1
|
|
|
|
Tag_AlgorithmsRoot = 2
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
Tag_RefOnShape = 1
|
|
|
|
Tag_RefOnAppliedHypothesis = 2
|
|
|
|
Tag_RefOnAppliedAlgorithms = 3
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
Tag_SubMeshOnVertex = 4
|
|
|
|
Tag_SubMeshOnEdge = 5
|
|
|
|
Tag_SubMeshOnFace = 6
|
|
|
|
Tag_SubMeshOnSolid = 7
|
|
|
|
Tag_SubMeshOnCompound = 8
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
Tag = {"HypothesisRoot":1,"AlgorithmsRoot":2,"RefOnShape":1,"RefOnAppliedHypothesis":2,"RefOnAppliedAlgorithms":3,"SubMeshOnVertex":4,"SubMeshOnEdge":5,"SubMeshOnFace":6,"SubMeshOnSolid":7,"SubMeshOnCompound":8}
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def Init():
|
|
|
|
pass
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def AddNewMesh(IOR):
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - objects are published automatically by the engine
|
|
|
|
aSO = myStudy.FindObjectIOR( IOR )
|
|
|
|
if aSO is not None:
|
|
|
|
return aSO.GetID()
|
|
|
|
# VSR ######################################################################
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
res,HypothesisRoot = mySComponentMesh.FindSubObject ( Tag_HypothesisRoot )
|
|
|
|
if HypothesisRoot is None or res == 0:
|
|
|
|
HypothesisRoot = myStudyBuilder.NewObjectToTag(mySComponentMesh, Tag_HypothesisRoot)
|
2004-06-18 14:34:31 +06:00
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeName")
|
|
|
|
aName.SetValue("Hypotheses")
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributePixMap")
|
2003-05-19 20:07:00 +06:00
|
|
|
aPixmap.SetPixMap( "mesh_tree_hypo.png" )
|
2004-06-18 14:34:31 +06:00
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable")
|
2004-12-01 15:48:31 +05:00
|
|
|
aSelAttr.SetSelectable(0)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
res, AlgorithmsRoot = mySComponentMesh.FindSubObject (Tag_AlgorithmsRoot)
|
|
|
|
if AlgorithmsRoot is None or res == 0:
|
|
|
|
AlgorithmsRoot = myStudyBuilder.NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot)
|
2004-06-18 14:34:31 +06:00
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeName")
|
2004-12-01 15:48:31 +05:00
|
|
|
aName.SetValue("Algorithms")
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_algo.png" )
|
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable")
|
|
|
|
aSelAttr.SetSelectable(0)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
HypothesisRoot = HypothesisRoot._narrow(SALOMEDS.SObject)
|
|
|
|
newMesh = myStudyBuilder.NewObject(mySComponentMesh)
|
2004-06-18 14:34:31 +06:00
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(newMesh, "AttributePixMap")
|
2003-05-19 20:07:00 +06:00
|
|
|
aPixmap.SetPixMap( "mesh_tree_mesh.png" )
|
2004-06-18 14:34:31 +06:00
|
|
|
anIOR = myStudyBuilder.FindOrCreateAttribute(newMesh, "AttributeIOR")
|
2003-05-19 20:07:00 +06:00
|
|
|
anIOR.SetValue(IOR)
|
|
|
|
return newMesh.GetID()
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def AddNewHypothesis(IOR):
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - objects are published automatically by the engine
|
|
|
|
aSO = myStudy.FindObjectIOR( IOR )
|
|
|
|
if aSO is not None:
|
|
|
|
return aSO.GetID()
|
|
|
|
# VSR ######################################################################
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
res, HypothesisRoot = mySComponentMesh.FindSubObject (Tag_HypothesisRoot)
|
|
|
|
if HypothesisRoot is None or res == 0:
|
|
|
|
HypothesisRoot = myStudyBuilder.NewObjectToTag (mySComponentMesh, Tag_HypothesisRoot)
|
2004-12-01 15:48:31 +05:00
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeName")
|
|
|
|
aName.SetValue("Hypotheses")
|
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributeSelectable")
|
|
|
|
aSelAttr.SetSelectable(0)
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(HypothesisRoot, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_hypo.png" )
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
# Add New Hypothesis
|
|
|
|
newHypo = myStudyBuilder.NewObject(HypothesisRoot)
|
2004-06-18 14:34:31 +06:00
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributePixMap")
|
2003-05-19 20:07:00 +06:00
|
|
|
H = orb.string_to_object(IOR)
|
2004-12-01 15:48:31 +05:00
|
|
|
aType = H.GetName()
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_hypo.png_" + aType )
|
|
|
|
anIOR = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributeIOR")
|
|
|
|
anIOR.SetValue(IOR)
|
|
|
|
return newHypo.GetID()
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def AddNewAlgorithms(IOR):
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - objects are published automatically by the engine
|
|
|
|
aSO = myStudy.FindObjectIOR( IOR )
|
|
|
|
if aSO is not None:
|
|
|
|
return aSO.GetID()
|
|
|
|
# VSR ######################################################################
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
res, AlgorithmsRoot = mySComponentMesh.FindSubObject (Tag_AlgorithmsRoot)
|
|
|
|
if AlgorithmsRoot is None or res == 0:
|
|
|
|
AlgorithmsRoot = myStudyBuilde.NewObjectToTag (mySComponentMesh, Tag_AlgorithmsRoot)
|
2004-06-18 14:34:31 +06:00
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeName")
|
2004-12-01 15:48:31 +05:00
|
|
|
aName.SetValue("Algorithms")
|
2004-06-18 14:34:31 +06:00
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributeSelectable")
|
2004-12-01 15:48:31 +05:00
|
|
|
aSelAttr.SetSelectable(0)
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(AlgorithmsRoot, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_algo.png" )
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
# Add New Algorithms
|
|
|
|
newHypo = myStudyBuilder.NewObject(AlgorithmsRoot)
|
2004-12-01 15:48:31 +05:00
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributePixMap")
|
|
|
|
aPixmap = anAttr._narrow(SALOMEDS.AttributePixMap)
|
2003-05-19 20:07:00 +06:00
|
|
|
H = orb.string_to_object(IOR)
|
|
|
|
aType = H.GetName(); #QString in fact
|
2004-12-01 15:48:31 +05:00
|
|
|
aPixmap.SetPixMap( "mesh_tree_algo.png_" + aType )
|
|
|
|
anIOR = myStudyBuilder.FindOrCreateAttribute(newHypo, "AttributeIOR")
|
|
|
|
anIOR.SetValue(IOR)
|
|
|
|
return newHypo.GetID()
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def SetShape(ShapeEntry, MeshEntry):
|
|
|
|
SO_MorSM = myStudy.FindObjectID( MeshEntry )
|
2004-12-01 15:48:31 +05:00
|
|
|
SO_GeomShape = myStudy.FindObjectID( ShapeEntry )
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
if SO_MorSM is not None and SO_GeomShape is not None :
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - shape reference is published automatically by the engine
|
2004-12-01 15:48:31 +05:00
|
|
|
res, Ref = SO_MorSM.FindSubObject( Tag_RefOnShape )
|
2004-06-18 14:34:31 +06:00
|
|
|
if res == 1 :
|
2004-12-01 15:48:31 +05:00
|
|
|
return
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR ######################################################################
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
SO = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnShape)
|
|
|
|
myStudyBuilder.Addreference (SO,SO_GeomShape)
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def SetHypothesis(Mesh_Or_SubMesh_Entry, Hypothesis_Entry):
|
2004-12-01 15:48:31 +05:00
|
|
|
SO_MorSM = myStudy.FindObjectID( Mesh_Or_SubMesh_Entry )
|
|
|
|
SO_Hypothesis = myStudy.FindObjectID( Hypothesis_Entry )
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
if SO_MorSM is not None and SO_Hypothesis is not None :
|
|
|
|
|
|
|
|
#Find or Create Applied Hypothesis root
|
|
|
|
res, AHR = SO_MorSM.FindSubObject (Tag_RefOnAppliedHypothesis)
|
|
|
|
if AHR is None or res == 0:
|
2004-12-01 15:48:31 +05:00
|
|
|
AHR = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnAppliedHypothesis)
|
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeName")
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
# The same name as in SMESH_Mesh_i::AddHypothesis() ##################
|
2004-12-01 15:48:31 +05:00
|
|
|
aName.SetValue("Applied hypotheses")
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeSelectable")
|
|
|
|
aSelAttr.SetSelectable(0)
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_hypo.png" )
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
# VSR: added temporarily - reference to applied hypothesis is published automatically by the engine
|
|
|
|
else :
|
2004-12-01 15:48:31 +05:00
|
|
|
it = myStudy.NewChildIterator(AHR)
|
2004-06-18 14:34:31 +06:00
|
|
|
while it.More() :
|
2004-12-01 15:48:31 +05:00
|
|
|
res, Ref = it.Value().ReferencedObject()
|
2004-06-18 14:34:31 +06:00
|
|
|
if res and Ref is not None and Ref.GetID() == Hypothesis_Entry :
|
2004-12-01 15:48:31 +05:00
|
|
|
return
|
|
|
|
it.Next()
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR ######################################################################
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
SO = myStudyBuilder.NewObject(AHR)
|
|
|
|
myStudyBuilder.Addreference (SO,SO_Hypothesis)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def SetAlgorithms(Mesh_Or_SubMesh_Entry, Algorithms_Entry):
|
|
|
|
SO_MorSM = myStudy.FindObjectID( Mesh_Or_SubMesh_Entry )
|
|
|
|
SO_Algorithms = myStudy.FindObjectID( Algorithms_Entry )
|
|
|
|
if SO_MorSM != None and SO_Algorithms != None :
|
|
|
|
#Find or Create Applied Algorithms root
|
2004-12-01 15:48:31 +05:00
|
|
|
res, AHR = SO_MorSM.FindSubObject (Tag_RefOnAppliedAlgorithms)
|
2003-05-19 20:07:00 +06:00
|
|
|
if AHR is None or res == 0:
|
2004-12-01 15:48:31 +05:00
|
|
|
AHR = myStudyBuilder.NewObjectToTag (SO_MorSM, Tag_RefOnAppliedAlgorithms)
|
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeName")
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
# The same name as in SMESH_Mesh_i::AddHypothesis() ##################
|
2004-12-01 15:48:31 +05:00
|
|
|
aName.SetValue("Applied algorithms")
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributeSelectable")
|
|
|
|
aSelAttr.SetSelectable(0)
|
|
|
|
aPixmap = myStudyBuilder.FindOrCreateAttribute(AHR, "AttributePixMap")
|
|
|
|
aPixmap.SetPixMap( "mesh_tree_algo.png" )
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
# VSR: added temporarily - reference to applied hypothesis is published automatically by the engine
|
|
|
|
else :
|
2004-12-01 15:48:31 +05:00
|
|
|
it = myStudy.NewChildIterator(AHR)
|
2004-06-18 14:34:31 +06:00
|
|
|
while it.More() :
|
2004-12-01 15:48:31 +05:00
|
|
|
res, Ref = it.Value().ReferencedObject()
|
2004-06-18 14:34:31 +06:00
|
|
|
if res and Ref is not None and Ref.GetID() == Algorithms_Entry :
|
2004-12-01 15:48:31 +05:00
|
|
|
return
|
|
|
|
it.Next()
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR ######################################################################
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
SO = myStudyBuilder.NewObject(AHR)
|
|
|
|
myStudyBuilder.Addreference (SO,SO_Algorithms)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def UnSetHypothesis( Applied_Hypothesis_Entry ):
|
2004-12-01 15:48:31 +05:00
|
|
|
SO_Applied_Hypothesis = myStudy.FindObjectID( Applied_Hypothesis_Entry )
|
2003-05-19 20:07:00 +06:00
|
|
|
if SO_Applied_Hypothesis :
|
2004-12-01 15:48:31 +05:00
|
|
|
myStudyBuilder.RemoveObject(SO_Applied_Hypothesis)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def AddSubMesh ( SO_Mesh_Entry, SM_IOR, ST):
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - objects are published automatically by the engine
|
|
|
|
aSO = myStudy.FindObjectIOR( SM_IOR )
|
|
|
|
if aSO is not None:
|
|
|
|
return aSO.GetID()
|
|
|
|
# VSR ######################################################################
|
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
SO_Mesh = myStudy.FindObjectID( SO_Mesh_Entry )
|
|
|
|
if ( SO_Mesh ) :
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
if ST == ShapeType["COMPSOLID"] :
|
|
|
|
Tag_Shape = Tag_SubMeshOnSolid
|
|
|
|
Name = "SubMeshes on Solid"
|
|
|
|
elif ST == ShapeType["FACE"] :
|
|
|
|
Tag_Shape = Tag_SubMeshOnFace
|
|
|
|
Name = "SubMeshes on Face"
|
|
|
|
elif ST == ShapeType["EDGE"] :
|
|
|
|
Tag_Shape = Tag_SubMeshOnEdge
|
|
|
|
Name = "SubMeshes on Edge"
|
|
|
|
elif ST == ShapeType["VERTEX"] :
|
|
|
|
Tag_Shape = Tag_SubMeshOnVertex
|
|
|
|
Name = "SubMeshes on Vertex"
|
2003-05-19 20:07:00 +06:00
|
|
|
else :
|
2004-12-01 15:48:31 +05:00
|
|
|
Tag_Shape = Tag_SubMeshOnCompound
|
|
|
|
Name = "SubMeshes on Compound"
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
res, SubmeshesRoot = SO_Mesh.FindSubObject (Tag_Shape)
|
|
|
|
if SubmeshesRoot is None or res == 0:
|
2004-12-01 15:48:31 +05:00
|
|
|
SubmeshesRoot = myStudyBuilder.NewObjectToTag (SO_Mesh, Tag_Shape)
|
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(SubmeshesRoot, "AttributeName")
|
|
|
|
aName.SetValue(Name)
|
|
|
|
aSelAttr = myStudyBuilder.FindOrCreateAttribute(SubmeshesRoot, "AttributeSelectable")
|
|
|
|
aSelAttr.SetSelectable(0)
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
SO = myStudyBuilder.NewObject (SubmeshesRoot)
|
|
|
|
anIOR = myStudyBuilder.FindOrCreateAttribute(SO, "AttributeIOR")
|
|
|
|
anIOR.SetValue(SM_IOR)
|
|
|
|
return SO.GetID()
|
|
|
|
|
|
|
|
return None
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def AddSubMeshOnShape (Mesh_Entry, GeomShape_Entry, SM_IOR, ST) :
|
2004-06-18 14:34:31 +06:00
|
|
|
# VSR: added temporarily - objects are published automatically by the engine
|
|
|
|
aSO = myStudy.FindObjectIOR( SM_IOR )
|
|
|
|
if aSO is not None:
|
|
|
|
return aSO.GetID()
|
|
|
|
# VSR ######################################################################
|
2004-12-01 15:48:31 +05:00
|
|
|
SO_GeomShape = myStudy.FindObjectID( GeomShape_Entry )
|
2004-06-18 14:34:31 +06:00
|
|
|
if SO_GeomShape != None :
|
2004-12-01 15:48:31 +05:00
|
|
|
SM_Entry = AddSubMesh (Mesh_Entry,SM_IOR,ST)
|
|
|
|
SO_SM = myStudy.FindObjectID( SM_Entry )
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
if SO_SM != None :
|
2004-12-01 15:48:31 +05:00
|
|
|
SetShape (GeomShape_Entry, SM_Entry)
|
|
|
|
return SM_Entry
|
|
|
|
|
|
|
|
return None
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------
|
|
|
|
def SetName(Entry, Name):
|
2004-12-01 15:48:31 +05:00
|
|
|
SO = myStudy.FindObjectID( Entry )
|
2003-05-19 20:07:00 +06:00
|
|
|
if SO != None :
|
2004-12-01 15:48:31 +05:00
|
|
|
aName = myStudyBuilder.FindOrCreateAttribute(SO, "AttributeName")
|
|
|
|
aName.SetValue(Name)
|