import salome
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
###
# Geometry: an assembly of a box, a cylinder and a truncated cone
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# This script demonstrates generation of 3D mesh basing on a modified 2D mesh
#
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
Mesh_1 = smesh.Mesh(Cut_1)
Mesh_1.Compute()
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
[Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"])
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
def PrintMeshInfo(theMesh):
aMesh = theMesh.GetMesh()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
# Mesh the blocks with hexahedral
# -------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
def discretize(x, y, z, nbSeg, shape=blocks):
vert = geompy.MakeVertex( x, y, z )
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
## create a bottom box
Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
## create a bottom mesh
Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
name='Compound with UniteGrps and GrpsOfAllElems')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# make geometry of a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
import salome, math
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
box = geompy.MakeBoxDXDYDZ( 100, 100, 100 )
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a face from arc and straight segment
px = geompy.MakeVertex(100., 0. , 0. )
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a face
px = geompy.MakeVertex(100., 0. , 0. )
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a cylinder
cyl = geompy.MakeCylinderRH(30., 50.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create sketchers
sketcher1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
base = geompy.MakeSketcher("Sketcher:F 0 0:TT 10 0:TT 20 10:TT 0 10:WF", theName="F")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Prepare geometry
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Prepare geometry
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
# Create face and explode it on edges
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Create face from the wire and add to study
Face = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WF", [0, 0, 0, 1, 0, 0, 0, 0, 1])
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Get 1/4 part from the disk face.
Box_1 = geompy.MakeBoxDXDYDZ(100, 100, 100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
# Make quadrangle face and explode it on edges.
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Make a patritioned box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
X = geompy.MakeVectorDXDYDZ( 1,0,0 )
O = geompy.MakeVertex( 100,50,50 )
import salome, SMESH
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create mesh
face = geompy.MakeFaceHW(100, 100, 1, theName="quadrangle")
import salome, SMESH
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create mesh
face = geompy.MakeFaceHW(100, 100, 1)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
# make a mesh on a box
import salome
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
import salome
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
import salome, SMESH
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create two boxes to have two domains in the mesh
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# geometry
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBox(0., 0., 0., 100., 100., 100.)
# create SMESH group on <aGeomGroupE> with default name
aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
filtIDs3 = filtGroup.GetIDs()
print "After filter modification, group on filter contains %s elemens" % filtGroup.Size()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
pass
print ""
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")
print "Criterion: Any Area, Nb = ", len(aGroup5.GetListOfID())
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
print "Criterion: 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID())
# Please note that also there is IntersectGroups() method which works with two groups only
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
print "Criterion: Area >= 60, Nb = ", len(aGroupRes.GetListOfID())
# Please note that also there is CutListOfGroups() method which works with lists of groups of any lengths
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
# Create group of nodes using source groups of faces
aGrp = mesh.CreateDimGroup( [aSrcGroup1, aSrcGroup2], SMESH.NODE, "Nodes" )
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
from SMESH_mechanic import mesh as mesh1
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
from SMESH_mechanic import mesh as mesh1
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
salome.salome_init()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
mesh = smesh.Mesh()
salome.salome_init()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
mesh = smesh.Mesh()
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a geometry
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create an empty mesh structure
f2 = MakePolygon(mesh, 0, 0, 10, 21, 9)
f3 = MakePolygon(mesh, 0, 0, 20, 13, 6)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
[5,5,5,5,5,5,5,5,5,5,5,5])
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
box = geompy.MakeBoxDXDYDZ(200, 200, 200)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
if not res: print "failed!"
else: print "done."
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
if not res: print "failed!"
else: print "done."
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
if not res: print "failed!"
else: print "done."
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
# Change the orientation of the second and the fourth faces.
mesh.Reorient([2, 4])
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import SMESH_mechanic
if not res: print "failed!"
else: print "done."
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import SMESH_mechanic
# perform extrusion of the group
mesh.ExtrusionSweepObject(GroupTri, vector, 5)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# 1. Create points
points = [[0, 0], [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]
error = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,
1, [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# define the geometry
Box_1 = geompy.MakeBoxDXDYDZ(200., 200., 200.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create sphere of radius 100
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
# set variables
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
OX = geompy.MakeVectorDXDYDZ(1,0,0)
OY = geompy.MakeVectorDXDYDZ(0,1,0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Free borders")
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Borders at multi-connections")
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
aGroup = mesh.GetMesh().CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroupF.Add([aBorder.myElemId])
aGroupN.Add([aBorder.myPnt1, aBorder.myPnt2])
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create box
box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
pass
print ""
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
####### GEOM part ########
aGroup = Mesh_1.CreateEmptyGroup(SMESH.FACE, "Shared_faces")
aGroup.Add(aFaceIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create open shell: a box without one plane
box = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Faces with length 2D > " + `length_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a compound of two glued boxes
box1 = geompy.MakeBox(0., 0., 0., 20., 20., 15.)
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Borders at multi-connection 2D = " + `nb_conn`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Area > " + `area_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Taper > " + `taper_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Aspect Ratio > " + `ar_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Skew > " + `skew_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 2D > " + `mel_2d_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aGroup = mesh.CreateEmptyGroup(SMESH.FACE, "Element Diameter 3D > " + `mel_3d_margin`)
aGroup.Add(anIds)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# make a shape consisting of two quadranges
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
Box = geompy.MakeBoxDXDYDZ(200, 200, 200)
f = geompy.SubShapeAllSorted(Box, geompy.ShapeType["FACE"])
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a face to be meshed
px = geompy.MakeVertex(100., 0. , 0. )
print "Quadrangles: ", trias.NbQuadrangles()
print "Volumes : ", trias.NbVolumes()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create two faces of a box
box1 = geompy.MakeBox(0., 0., -10., 30., 20., 25.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# make two not sewed quadranges
OY0 = geompy.MakeVectorDXDYDZ(0, 1, 0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create two boxes
box1 = geompy.MakeBox(0., 0., 0., 10., 10., 10.)
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Create a box
# Update object browser
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(False)
+ salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import salome_notebook
import numpy as np
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create a box
box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Create a geometry to mesh
box = geompy.MakeBoxDXDYDZ(100,100,100)
\n the old mode (from dump):
\code
import smesh, SMESH, SALOMEDS
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
\endcode
\n the new mode:
\code
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
\endcode
<li>Create an instance of \ref smeshBuilder.smeshBuilder "smeshBuilder":
<pre>
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New( salome.myStudy )
+ smesh = smeshBuilder.New()
</pre></li>
<li>Create a \ref smeshBuilder.Mesh "mesh" object:
<pre>
boolean IsEmbeddedMode();
/*!
- Set the current study
+ Update the study
*/
- void SetCurrentStudy( in SALOMEDS::Study theStudy );
-
+ void UpdateStudy();
+
+ /*!
+ Set enable publishing in the study
+ */
+ void SetEnablePublish( in boolean theIsEnablePublish );
+
/*!
- Get the current study
+ Get enable publishing in the study
*/
- SALOMEDS::Study GetCurrentStudy();
+ boolean IsEnablePublish();
/*!
* Create a hypothesis that can be shared by differents parts of the mesh.
*/
long GetId();
- /*!
- * Get the study Id
- */
- long GetStudyId();
-
/*!
* Obtain instance of SMESH_MeshEditor
*/
<service-by-default>0</service-by-default>
<inParameter-list>
<inParameter>
- <inParameter-type>string</inParameter-type>
- <inParameter-name>anHyp</inParameter-name>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>studyId</inParameter-name>
- <inParameter-comment></inParameter-comment>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-name>anHyp</inParameter-name>
+ <inParameter-comment></inParameter-comment>
</inParameter>
</inParameter-list>
<outParameter-list>
<inParameter-name>geomEngine</inParameter-name>
<inParameter-comment></inParameter-comment>
</inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>studyId</inParameter-name>
- <inParameter-comment></inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-type>GEOM/GEOM_Object</inParameter-type>
<inParameter-name>aShape</inParameter-name>
/*!
* Constructor
- * @param aStudy pointer to the Study
*
*/
-GeomSelectionTools::GeomSelectionTools(_PTR(Study) aStudy)
+GeomSelectionTools::GeomSelectionTools()
{
- myStudy = aStudy;
-}
-
-/*!
- * Accessor to the Study used by this GeomSelectionTools object
- * @return The study used by the GeomSelectionTools class
- */
-_PTR(Study) GeomSelectionTools::getMyStudy()
-{
- return myStudy;
}
/*!
*/
std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject) anIO){
std::string entry="";
- _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+ _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
if (aSO){
_PTR(SObject) aRefSObj;
// If selected object is a reference
*/
std::string GeomSelectionTools::getNameFromEntry(std::string entry){
std::string name = "";
- _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+ _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
if (aSO){
_PTR(SObject) aRefSObj;
// If selected object is a reference
Handle(SALOME_InteractiveObject) anIO;
std::string DataType="";
anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
- _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+ _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(anIO->getEntry());
if (aSO){
_PTR(SObject) aRefSObj;
// If selected object is a reference
// MESSAGE("GeomSelectionTools::entryToShapeType"<<entry );
TopoDS_Shape S = TopoDS_Shape();
TopAbs_ShapeEnum ShapeType = TopAbs_SHAPE;
- _PTR(SObject) aSO = myStudy->FindObjectID(entry);
+ _PTR(SObject) aSO = SalomeApp_Application::getStudy()->FindObjectID(entry);
if (aSO){
_PTR(SObject) aRefSObj;
GEOM::GEOM_Object_var aShape;
if (aShape->GetType() == GEOM_GROUP){
// MESSAGE("It's a group");
GEOM::GEOM_IGroupOperations_wrap aGroupOp =
- _geomEngine->GetIGroupOperations(myStudy->StudyId());
+ _geomEngine->GetIGroupOperations();
ShapeType= (TopAbs_ShapeEnum)aGroupOp->GetType(aShape);
}
// if not
class PLUGINUTILS_EXPORT GeomSelectionTools
{
-private:
-
- _PTR(Study) myStudy;
-
public:
- GeomSelectionTools(_PTR(Study));
+ GeomSelectionTools();
static SalomeApp_Application* GetSalomeApplication();
static LightApp_SelectionMgr* selectionMgr();
SALOME_ListIO* getSelectedSalomeObjects();
TopAbs_ShapeEnum getFirstSelectedShapeType();
TopAbs_ShapeEnum entryToShapeType(std::string );
GeomAbs_SurfaceType getFaceInformation(TopoDS_Shape);
- _PTR(Study) getMyStudy();
};
//////////////////////////////////////////
*/
//=============================================================================
-SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+SMESH_Algo::SMESH_Algo (int hypId, SMESH_Gen * gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_compatibleAllHypFilter = _compatibleNoAuxHypFilter = NULL;
_onlyUnaryInput = _requireDiscreteBoundary = _requireShape = true;
*/
//=============================================================================
-SMESH_0D_Algo::SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Algo(hypId, studyId, gen)
+SMESH_0D_Algo::SMESH_0D_Algo(int hypId, SMESH_Gen* gen)
+ : SMESH_Algo(hypId, gen)
{
_shapeType = (1 << TopAbs_VERTEX);
_type = ALGO_0D;
}
-SMESH_1D_Algo::SMESH_1D_Algo(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Algo(hypId, studyId, gen)
+SMESH_1D_Algo::SMESH_1D_Algo(int hypId, SMESH_Gen* gen)
+ : SMESH_Algo(hypId, gen)
{
_shapeType = (1 << TopAbs_EDGE);
_type = ALGO_1D;
}
-SMESH_2D_Algo::SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Algo(hypId, studyId, gen)
+SMESH_2D_Algo::SMESH_2D_Algo(int hypId, SMESH_Gen* gen)
+ : SMESH_Algo(hypId, gen)
{
_shapeType = (1 << TopAbs_FACE);
_type = ALGO_2D;
}
-SMESH_3D_Algo::SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Algo(hypId, studyId, gen)
+SMESH_3D_Algo::SMESH_3D_Algo(int hypId, SMESH_Gen* gen)
+ : SMESH_Algo(hypId, gen)
{
_shapeType = (1 << TopAbs_SOLID);
_type = ALGO_3D;
/*!
* \brief Creates algorithm
* \param hypId - algorithm ID
- * \param studyId - study ID
* \param gen - SMESH_Gen
*/
- SMESH_Algo(int hypId, int studyId, SMESH_Gen * gen);
+ SMESH_Algo(int hypId, SMESH_Gen * gen);
/*!
* \brief Destructor
class SMESH_EXPORT SMESH_0D_Algo: public SMESH_Algo
{
public:
- SMESH_0D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+ SMESH_0D_Algo(int hypId, SMESH_Gen* gen);
};
class SMESH_EXPORT SMESH_1D_Algo: public SMESH_Algo
{
public:
- SMESH_1D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+ SMESH_1D_Algo(int hypId, SMESH_Gen* gen);
};
class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo
{
public:
- SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+ SMESH_2D_Algo(int hypId, SMESH_Gen* gen);
/*!
* \brief Method in which an algorithm generating a structured mesh
* fixes positions of in-face nodes after there movement
class SMESH_EXPORT SMESH_3D_Algo: public SMESH_Algo
{
public:
- SMESH_3D_Algo(int hypId, int studyId, SMESH_Gen* gen);
+ SMESH_3D_Algo(int hypId, SMESH_Gen* gen);
};
#endif
SMESH_Gen::SMESH_Gen()
{
+ _studyContext = new StudyContextStruct;
+ _studyContext->myDocument = new SMESHDS_Document();
_localId = 0;
_hypId = 0;
_segmentation = _nbSegments = 10;
SMESH_Gen::~SMESH_Gen()
{
- std::map < int, StudyContextStruct * >::iterator i_sc = _mapStudyContext.begin();
- for ( ; i_sc != _mapStudyContext.end(); ++i_sc )
- {
- StudyContextStruct* context = i_sc->second;
- std::map < int, SMESH_Hypothesis * >::iterator i_hyp = context->mapHypothesis.begin();
- for ( ; i_hyp != context->mapHypothesis.end(); ++i_hyp )
+ std::map < int, SMESH_Hypothesis * >::iterator i_hyp = _studyContext->mapHypothesis.begin();
+ for ( ; i_hyp != _studyContext->mapHypothesis.end(); ++i_hyp )
{
if ( _Hyp* h = static_cast< _Hyp*>( i_hyp->second ))
h->NullifyGen();
}
- delete context->myDocument;
- delete context;
- }
+ delete _studyContext->myDocument;
+ delete _studyContext;
}
//=============================================================================
*/
//=============================================================================
-SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
+SMESH_Mesh* SMESH_Gen::CreateMesh(bool theIsEmbeddedMode)
throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
- StudyContextStruct *aStudyContext = GetStudyContext(theStudyId);
-
// create a new SMESH_mesh object
SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
- theStudyId,
this,
theIsEmbeddedMode,
- aStudyContext->myDocument);
- aStudyContext->mapMesh[_localId-1] = aMesh;
+ _studyContext->myDocument);
+ _studyContext->mapMesh[_localId-1] = aMesh;
return aMesh;
}
*/
//=============================================================================
-StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
+StudyContextStruct *SMESH_Gen::GetStudyContext()
{
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
-
- if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
- {
- _mapStudyContext[studyId] = new StudyContextStruct;
- _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
- }
- StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
- return myStudyContext;
+ return _studyContext;
}
//================================================================================
SMESH_Gen();
~SMESH_Gen();
- SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode)
+ SMESH_Mesh* CreateMesh(bool theIsEmbeddedMode)
throw(SALOME_Exception);
enum ComputeFlags
// if Compute() would fail because of some algo bad state
// theErrors list contains problems description
- StudyContextStruct *GetStudyContext(int studyId);
+ StudyContextStruct *GetStudyContext();
static int GetShapeDim(const TopAbs_ShapeEnum & aShapeType);
static int GetShapeDim(const TopoDS_Shape & aShape)
private:
int _localId; // unique Id of created objects, within SMESH_Gen entity
- std::map < int, StudyContextStruct * >_mapStudyContext;
+ StudyContextStruct* _studyContext;
// hypotheses managing
int _hypId;
//=============================================================================
SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
- int studyId,
SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
{
_gen = gen;
- _studyId = studyId;
_type = PARAM_ALGO;
_shapeType = 0; // to be set by algo with TopAbs_Enum
_param_algo_dim = -1; // to be set by algo parameter
- StudyContextStruct* myStudyContext = gen->GetStudyContext(_studyId);
+ StudyContextStruct* myStudyContext = gen->GetStudyContext();
myStudyContext->mapHypothesis[hypId] = this;
}
{
if ( _gen )
{
- StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+ StudyContextStruct* myStudyContext = _gen->GetStudyContext();
myStudyContext->mapHypothesis[_hypId] = 0;
}
}
*/
//=============================================================================
-int SMESH_Hypothesis::GetStudyId() const
-{
- return _studyId;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
void SMESH_Hypothesis::NotifySubMeshesHypothesisModification()
{
// for all meshes in study
- StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+ StudyContextStruct* myStudyContext = _gen->GetStudyContext();
map<int, SMESH_Mesh*>::iterator itm;
for (itm = myStudyContext->mapMesh.begin();
itm != myStudyContext->mapMesh.end();
SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id)
{
- StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
+ StudyContextStruct* myStudyContext = _gen->GetStudyContext();
map<int, SMESH_Mesh*>::iterator itm = myStudyContext->mapMesh.begin();
for ( ; itm != myStudyContext->mapMesh.end(); itm++)
{
static bool IsStatusFatal(Hypothesis_Status theStatus)
{ return theStatus >= HYP_UNKNOWN_FATAL; }
- SMESH_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
+ SMESH_Hypothesis(int hypId, SMESH_Gen* gen);
virtual ~SMESH_Hypothesis();
virtual int GetDim() const;
- int GetStudyId() const;
SMESH_Gen* GetGen() const { return (SMESH_Gen*) _gen; }
virtual int GetShapeType() const;
virtual const char* GetLibName() const;
protected:
SMESH_Gen* _gen;
- int _studyId;
int _shapeType;
int _param_algo_dim; // to be set at descendant hypothesis constructor
//=============================================================================
SMESH_Mesh::SMESH_Mesh(int theLocalId,
- int theStudyId,
SMESH_Gen* theGen,
bool theIsEmbeddedMode,
SMESHDS_Document* theDocument):
{
if(MYDEBUG) MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
_id = theLocalId;
- _studyId = theStudyId;
_gen = theGen;
_myDocument = theDocument;
_myMeshDS = theDocument->NewMesh(theIsEmbeddedMode,theLocalId);
SMESH_Mesh::SMESH_Mesh():
_id(-1),
- _studyId(-1),
_groupId( 0 ),
_nbSubShapes( 0 ),
_isShapeToMesh( false ),
// remove self from studyContext
if ( _gen )
{
- StudyContextStruct * studyContext = _gen->GetStudyContext( _studyId );
+ StudyContextStruct * studyContext = _gen->GetStudyContext();
studyContext->mapMesh.erase( _id );
}
if ( _myDocument )
if ( _id == meshId )
return (SMESH_Mesh*) this;
- if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext( _studyId ))
+ if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext())
{
std::map < int, SMESH_Mesh * >::iterator i_m = aStudyContext->mapMesh.find( meshId );
if ( i_m != aStudyContext->mapMesh.end() )
Unexpect aCatch(SalomeException);
if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
- StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
+ StudyContextStruct *sc = _gen->GetStudyContext();
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const int anHypId) const
{
- StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
+ StudyContextStruct *sc = _gen->GetStudyContext();
if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
return NULL;
{
public:
SMESH_Mesh(int theLocalId,
- int theStudyId,
SMESH_Gen* theGen,
bool theIsEmbeddedMode,
SMESHDS_Document* theDocument);
protected:
int _id; // id given by creator (unique within the creator instance)
- int _studyId;
int _groupId; // id generator for group objects
int _nbSubShapes; // initial nb of subshapes in the shape to mesh
bool _isShapeToMesh;// set to true when a shape is given (only once)
//function : Create
//purpose :
//=======================================================================
-SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID)
+SMESHDS_Document::SMESHDS_Document()
{
}
class SMESHDS_EXPORT SMESHDS_Document
{
public:
- SMESHDS_Document(int UserID);
- ~SMESHDS_Document();
- SMESHDS_Mesh * NewMesh(bool theIsEmbeddedMode, int MeshID);
- void RemoveMesh(int MeshID);
- SMESHDS_Mesh * GetMesh(int MeshID);
- void AddHypothesis(SMESHDS_Hypothesis * H);
- void RemoveHypothesis(int HypID);
- SMESHDS_Hypothesis * GetHypothesis(int HypID);
- int NbMeshes();
- int NbHypothesis();
- void InitMeshesIterator();
- SMESHDS_Mesh * NextMesh();
- bool MoreMesh();
- void InitHypothesisIterator();
- SMESHDS_Hypothesis * NextHypothesis();
- bool MoreHypothesis();
+ SMESHDS_Document();
+ ~SMESHDS_Document();
+ SMESHDS_Mesh * NewMesh(bool theIsEmbeddedMode, int MeshID);
+ void RemoveMesh(int MeshID);
+ SMESHDS_Mesh * GetMesh(int MeshID);
+ void AddHypothesis(SMESHDS_Hypothesis * H);
+ void RemoveHypothesis(int HypID);
+ SMESHDS_Hypothesis * GetHypothesis(int HypID);
+ int NbMeshes();
+ int NbHypothesis();
+ void InitMeshesIterator();
+ SMESHDS_Mesh * NextMesh();
+ bool MoreMesh();
+ void InitHypothesisIterator();
+ SMESHDS_Hypothesis * NextHypothesis();
+ bool MoreHypothesis();
private:
- int myUserID;
- std::map<int,SMESHDS_Mesh*> myMeshes;
- std::map<int,SMESHDS_Hypothesis*> myHypothesis;
- std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
- std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
+ std::map<int,SMESHDS_Mesh*> myMeshes;
+ std::map<int,SMESHDS_Hypothesis*> myHypothesis;
+ std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
+ std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
};
#endif
void ExportMeshToFile(int theCommandID);
- void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
+ void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap);
void SetDisplayEntity(int theCommandID);
if ( filenames.count() > 0 )
{
SUIT_OverrideCursor wc;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
QStringList errors;
QStringList anEntryList;
if ( selected.Extent() )
{
Handle(SALOME_InteractiveObject) anIObject = selected.First();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry());
if (aSObj) {
if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) {
}
}
- void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap)
+ void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
{
SALOME_ListIO selected;
SalomeApp_Application* app =
return;
}
- _PTR(Study) aStudy = appStudy->studyDS();
-
aSel->selectedObjects( selected );
if ( selected.Extent() >= 1 )
break;
}
- SMESHGUI_PropertiesDlg dlg( theMarkerMap[ aStudy->StudyId() ], SMESHGUI::desktop() );
+ SMESHGUI_PropertiesDlg dlg( theMarkerMap, SMESHGUI::desktop() );
// nodes: color, marker
dlg.setNodeColor( nodeColor );
if( markerType != VTK::MT_USER )
orientation3d = dlg.orientation3d();
shrinkCoef = dlg.shrinkCoef() / 100.;
- // store point markers map that might be changed by the user
- theMarkerMap[ aStudy->StudyId() ] = dlg.customMarkers();
+ // store point markers that might be changed by the user
+ theMarkerMap = dlg.customMarkers();
// set properties from dialog box to the presentations
SALOME_ListIteratorOfListIO It( selected );
anActor->SetMarkerStd( markerType, markerScale );
}
else {
- const VTK::MarkerMap& markerMap = theMarkerMap[ aStudy->StudyId() ];
- VTK::MarkerMap::const_iterator iter = markerMap.find( markerId );
- if ( iter != markerMap.end() )
+ VTK::MarkerMap::const_iterator iter = theMarkerMap.find( markerId );
+ if ( iter != theMarkerMap.end() )
anActor->SetMarkerTexture( markerId, iter->second.second );
}
// volumes: normal color, reversed color (delta)
void Control( int theCommandID )
{
SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
SALOME_ListIO selected;
if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
if ( !anIDSrc->_is_nil() ) {
SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
if (( !anActor && selected.Extent() == 1 ) &&
- ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
+ ( anActor = SMESH::CreateActor( anIO->getEntry() )))
{
anActor->SetControlMode( aControl );
SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
QString CheckTypeObject(const Handle(SALOME_InteractiveObject) & theIO)
{
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry());
if (aSObj) {
_PTR(SComponent) aSComp = aSObj->GetFatherComponent();
LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
_PTR(GenericAttribute) anAttr;
_PTR(AttributeIOR) anIOR;
smeshMod = dynamic_cast<SMESHGUI*>( module );
}
- if ( smeshMod && smeshMod->application() && smeshMod->application()->activeStudy() )
- {
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( smeshMod->application()->activeStudy() );
- if ( study )
- {
- _PTR(Study) aStudy = study->studyDS();
- if ( aStudy )
- GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
- }
- }
-
return smeshMod;
}
return true;
}
-//=============================================================================
/*!
- *
- */
-//=============================================================================
-static int isStudyLocked(_PTR(Study) theStudy){
- return theStudy->GetProperties()->IsLocked();
-}
-
-static bool checkLock(_PTR(Study) theStudy) {
- if (isStudyLocked(theStudy)) {
- SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
+ * \brief Verifies whether study of operation is locked
+ * \param theMess - specifies whether message box must be shown if study is locked
+ * \return State of study.
+*
+* Verifies whether study of operation is locked. If second parameter is TRUE and study
+* is locked when corresponding message box appears
+*/
+bool SMESHGUI::isStudyLocked( bool theMessage )
+{
+ if ( SMESH::getStudy()->GetProperties()->IsLocked() )
+ {
+ if ( theMessage )
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr( "WRN_WARNING" ),
+ QObject::tr( "WRN_STUDY_LOCKED" ) );
return true;
}
return false;
}
-//=======================================================================
-//function : CheckActiveStudyLocked
-//purpose :
-//=======================================================================
-
-bool SMESHGUI::isActiveStudyLocked()
-{
- _PTR(Study) aStudy = activeStudy()->studyDS();
- return checkLock( aStudy );
-}
-
//=============================================================================
/*!
*
if( !anApp )
return false;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
SUIT_ResourceMgr* mgr = resourceMgr();
if( !mgr )
return false;
- if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) {
- GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
- }
-
SUIT_ViewWindow* view = application()->desktop()->activeWindow();
SVTK_ViewWindow* vtkwnd = dynamic_cast<SVTK_ViewWindow*>( view );
switch (theCommandID) {
case SMESHOp::OpDelete:
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
OnEditDelete();
break;
case SMESHOp::OpImportDAT:
case SMESHOp::OpPopupImportSAUV:
case SMESHOp::OpPopupImportGMF:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
break;
}
case SMESHOp::OpUpdate:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
SUIT_OverrideCursor wc;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
}
// PAL13338 + PAL15161 -->
- if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
+ if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !isStudyLocked()) {
SMESH::UpdateView();
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
}
case SMESHOp::OpNode:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
break;
case SMESHOp::OpCopyMesh:
{
- if (checkLock(aStudy)) break;
+ if (isStudyLocked()) break;
EmitSignalDeactivateDialog();
( new SMESHGUI_CopyMeshDlg( this ) )->show();
}
break;
case SMESHOp::OpBuildCompoundMesh:
{
- if (checkLock(aStudy)) break;
+ if (isStudyLocked()) break;
EmitSignalDeactivateDialog();
( new SMESHGUI_BuildCompoundDlg( this ) )->show();
}
break;
}
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
/*Standard_Boolean aRes;
break;
}
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
EmitSignalDeactivateDialog();
}
case SMESHOp::OpSmoothing:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SmoothingDlg( this ) )->show();
}
case SMESHOp::OpExtrusion:
{
- if (checkLock(aStudy)) break;
+ if (isStudyLocked()) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionDlg ( this ) )->show();
}
case SMESHOp::OpExtrusionAlongAPath:
{
- if (checkLock(aStudy)) break;
+ if (isStudyLocked()) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
}
case SMESHOp::OpRevolution:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RevolutionDlg( this ) )->show();
}
case SMESHOp::OpPatternMapping:
{
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
if ( vtkwnd )
{
break;
}
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
EmitSignalDeactivateDialog();
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
break;
}
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
// check if submesh is selected
Handle(SALOME_InteractiveObject) IObject = selected.First();
if (IObject->hasEntry()) {
- _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
+ _PTR(SObject) aSObj = SMESH::getStudy()->FindObjectID(IObject->getEntry());
if( aSObj ) {
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
if (!aSubMesh->_is_nil()) {
break;
}
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
case SMESHOp::OpAddElemGroupPopup: // Add elements to group
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if (myState == 800) {
SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
if (aDlg) aDlg->onAdd();
case SMESHOp::OpRemoveElemGroupPopup: // Remove elements from group
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if (myState == 800) {
SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
if (aDlg) aDlg->onRemove();
break;
}
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
break;
}
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
EmitSignalDeactivateDialog();
case SMESHOp::OpGroupUnderlyingElem: // Create groups of entities from existing groups of superior dimensions
{
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
EmitSignalDeactivateDialog();
break;
}
- if ( checkLock( aStudy ) )
+ if ( isStudyLocked() )
break;
EmitSignalDeactivateDialog();
case SMESHOp::OpEditHypothesis:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected;
}
case SMESHOp::OpUnassign: // REMOVE HYPOTHESIS / ALGORITHMS
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
SUIT_OverrideCursor wc;
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
case SMESHOp::OpPyramid:
case SMESHOp::OpHexagonalPrism:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
SMDSAbs_EntityType type = SMDSEntity_Edge;
}
case SMESHOp::OpPolyhedron:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
case SMESHOp::OpQuadraticHexahedron:
case SMESHOp::OpTriQuadraticHexahedron:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
SMDSAbs_EntityType type = SMDSEntity_Last;
}
case SMESHOp::OpRemoveNodes:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RemoveNodesDlg( this ) )->show();
}
case SMESHOp::OpRemoveElements: // REMOVES ELEMENTS
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RemoveElementsDlg( this ) )->show();
}
case SMESHOp::OpClearMesh: {
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
SALOME_ListIO selected;
if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
SMESH::ModifiedMesh( aMeshSObj, false, true);
// hide groups and submeshes
_PTR(ChildIterator) anIter =
- SMESH::GetActiveStudyDocument()->NewChildIterator( aMeshSObj );
+ SMESH::getStudy()->NewChildIterator( aMeshSObj );
for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
{
_PTR(SObject) so = anIter->Value();
}
case SMESHOp::OpRemoveOrphanNodes:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
SALOME_ListIO selected;
if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
aSel->selectedObjects( selected );
}
case SMESHOp::OpRenumberingNodes:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
}
case SMESHOp::OpRenumberingElements:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
}
case SMESHOp::OpTranslation:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_TranslationDlg( this ) )->show();
}
case SMESHOp::OpRotation:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_RotationDlg( this ) )->show();
}
case SMESHOp::OpSymmetry:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SymmetryDlg( this ) )->show();
}
case SMESHOp::OpScale:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_ScaleDlg( this ) )->show();
case SMESHOp::OpSewing:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_SewingDlg( this ) )->show();
}
case SMESHOp::OpMergeNodes:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_MergeDlg( this, 0 ) )->show();
}
case SMESHOp::OpMergeElements:
{
- if (checkLock(aStudy)) break;
+ if (isStudyLocked()) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
( new SMESHGUI_MergeDlg( this, 1 ) )->show();
case SMESHOp::OpDuplicateNodes:
{
- if(checkLock(aStudy)) break;
+ if(isStudyLocked()) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
( new SMESHGUI_DuplicateNodesDlg( this ) )->show();
action(SMESHOp::OpDelete)->setEnabled(true); // Delete: Key_Delete
// 0020210. Make SMESH_Gen update meshes at switching GEOM->SMESH
- GetSMESHGen()->SetCurrentStudy(SALOMEDS::Study::_nil());
- if ( SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study )) {
- if ( _PTR(Study) aStudy = s->studyDS() )
- GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
- }
+ GetSMESHGen()->UpdateStudy();
// get all view currently opened in the study and connect their signals to
// the corresponding slots of the class.
{
if( !s )
return;
- SMESH::RemoveVisuData( s->id() );
+ SMESH::RemoveVisuData();
SalomeApp_Module::studyClosed( s );
}
SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
{
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
if ( CORBA::is_nil( myComponentSMESH ) )
- {
- SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
- if ( aStudy )
- aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
- return aGUI.myComponentSMESH;
- }
- if ( aStudy )
- myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
+ {
+ SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
+ return aGUI.myComponentSMESH;
+ }
return myComponentSMESH;
}
void SMESHGUI::switchToOperation(int id)
{
- if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() )
- activeStudy()->abortAllOperations();
+ activeStudy()->abortAllOperations();
startOperation( id );
}
savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
- // store map of custom markers
- const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
- if( !aMarkerMap.empty() )
+ // store custom markers
+ if( !myMarkerMap.empty() )
{
- VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
- for( ; anIter != aMarkerMap.end(); anIter++ )
+ VTK::MarkerMap::const_iterator anIter = myMarkerMap.begin();
+ for( ; anIter != myMarkerMap.end(); anIter++ )
{
int anId = anIter->first;
VTK::MarkerData aMarkerData = anIter->second;
savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
- // restore map of custom markers and map of clipping planes
- VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
+ // restore custom markers and map of clipping planes
TPlaneDataMap aPlaneDataMap;
std::vector<std::string> properties = ip->getProperties();
aMarkerTexture.push_back( aChar.digitValue() );
}
- aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
+ myMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
}
else if( aPropertyType == "ClippingPlane" )
{
aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
}
else if( data[0] == "custom" ) {
- VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
- if( markerIt != aMarkerMap.end() ) {
+ VTK::MarkerMap::const_iterator markerIt = myMarkerMap.find( aParam1 );
+ if( markerIt != myMarkerMap.end() ) {
VTK::MarkerData aMarkerData = markerIt->second;
aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
}
return false;
// check type to prevent renaming of inappropriate objects
- int aType = SMESHGUI_Selection::type(qPrintable(entry), SMESH::GetActiveStudyDocument());
+ int aType = SMESHGUI_Selection::type(qPrintable(entry));
if (aType == SMESH::MESH || aType == SMESH::GROUP ||
aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
if ( obj->FindAttribute(anAttr, "AttributeName") ) {
aName = anAttr;
// check type to prevent renaming of inappropriate objects
- int aType = SMESHGUI_Selection::type( qPrintable(entry), SMESH::GetActiveStudyDocument() );
+ int aType = SMESHGUI_Selection::type( qPrintable(entry));
if (aType == SMESH::MESH || aType == SMESH::GROUP ||
aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
class SMESH_Actor;
class SMESHGUI_FilterLibraryDlg;
-typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
-
namespace SMESH
{
class OrientedPlane;
static SUIT_ResourceMgr* resourceMgr();
static SUIT_Desktop* desktop();
static SalomeApp_Study* activeStudy();
-
- bool isActiveStudyLocked();
static bool automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
static bool automaticUpdate( SMESH::SMESH_IDSource_ptr, int*, bool*, int*, long* );
static void Modified( bool = true );
+ static bool isStudyLocked( bool = true );
+
virtual LightApp_Displayer* displayer();
virtual QString engineIOR() const;
virtual void initialize( CAM_Application* );
SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
- SMESHGUI_StudyId2MarkerMap myMarkerMap;
+ VTK::MarkerMap myMarkerMap;
SMESHGUI_ClippingPlaneInfoMap myClippingPlaneInfoMap;
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
_PTR(SObject) group0DRoot;
if ( meshSO && meshSO->FindSubObject( SMESH::Tag_0DElementsGroups, group0DRoot ))
{
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- _PTR(ChildIterator) group0DIter = aStudy->NewChildIterator( group0DRoot );
+ _PTR(ChildIterator) group0DIter = SMESH::getStudy()->NewChildIterator( group0DRoot );
for ( ; group0DIter->More(); group0DIter->Next() )
{
_PTR(SObject) groupSO = group0DIter->Value();
if( !isValid() )
return;
- if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
+ if (myNbOkNodes && !SMESHGUI::isStudyLocked()) {
myBusy = true;
QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
if( !isValid() )
return false;
- if ( mySMESHGUI->isActiveStudyLocked() || myBusy || !IsValid() )
+ if ( SMESHGUI::isStudyLocked() || myBusy || !IsValid() )
return false;
BusyLocker lock( myBusy );
QString aName = "";
// collect all object names of SMESH component
- SalomeApp_Study* appStudy =
- dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
- if ( !appStudy ) return aName;
- _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
std::set<std::string> aSet;
_PTR(SComponent) aMeshCompo (aStudy->FindComponent("SMESH"));
//=================================================================================
bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (!isValid())
SMESH::UpdateView();
_PTR(SObject) aSO = SMESH::FindSObject(aMesh.in());
- if ( SMESH_Actor* anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str()) ) {
+ if ( SMESH_Actor* anActor = SMESH::CreateActor( aSO->GetID().c_str()) ) {
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
SMESH::UpdateView();
}
{
ActorList->clear();
- SalomeApp_Study* anAppStudy = SMESHGUI::activeStudy();
- if( !anAppStudy )
- return;
-
- _PTR(Study) aStudy = anAppStudy->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
if( !aStudy )
return;
_PTR(SObject) so = SMESH::FindSObject(aMainShape);
if ( subShapeID == 1 || !so )
return so;
- _PTR(ChildIterator) it;
- if (_PTR(Study) study = SMESH::GetActiveStudyDocument())
- it = study->NewChildIterator(so);
+ _PTR(ChildIterator) it = SMESH::getStudy()->NewChildIterator(so);
_PTR(SObject) subSO;
if ( it ) {
for ( it->InitEx(true); !subSO && it->More(); it->Next() ) {
// NPAL16631: if ( !memoryLack )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID(myIObject->getEntry());
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID(myIObject->getEntry());
SMESH::ModifiedMesh( sobj,
!computeFailed && aHypErrors.isEmpty(),
myMesh->NbNodes() == 0);
{
toDisplay = true;
SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
- if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(),
- (*anIter).second->GetID().c_str(),
+ if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetID().c_str(),
/*clearLog =*/ true );
if ( anActor ) // actor is not created for an empty mesh
{
void SMESHGUI_BaseComputeOp::onPublishShape()
{
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
QStringList entryList;
if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
{
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
- SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, myMainShape,
+ SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape,
name.toLatin1().data(),
GEOM::GEOM_Object::_nil());
// look for myMainShape in the table
if ( curSub == 1 ) continue;
}
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
- SALOMEDS::SObject_wrap so = geomGen->AddInStudy( study, shape,
+ SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape,
name.toLatin1().data(), myMainShape);
if ( !so->_is_nil() ) {
CORBA::String_var name = so->GetName();
QList<int> modes;
QMap<int, int> modeMap;
- _PTR(SObject) pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( myIObject->getEntry() );
getAssignedAlgos( pMesh, modeMap );
if ( modeMap.contains( SMESH::DIM_3D ) )
{
int aPart = SMESH::Tag_RefOnAppliedAlgorithms;
if ( theMesh->FindSubObject( aPart, aHypFolder ))
{
- _PTR(ChildIterator) anIter =
- SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
+ _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
for ( ; anIter->More(); anIter->Next() )
{
_PTR(SObject) anObj = anIter->Value();
if ( !theMesh->FindSubObject( aPart, aHypFolder ))
continue;
- _PTR(ChildIterator) anIter =
- SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
+ _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
{
_PTR(SObject) anObj = anIter->Value();
try
{
QString anObjEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj ) return;
SMESH::SMESH_IDSource_var idSource =
QString aMess;
QString anObjEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj )
{
dlg()->show();
void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
{
QString anObjEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj ) return;
SMESH::SMESH_IDSource_var idSource =
bool SMESHGUI_CopyMeshDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if( !isValid() )
if( !isValid() )
return;
- if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked())
+ if ( myNbOkElements>0 && !SMESHGUI::isStudyLocked())
{
if(checkEditLine(false) == -1) {return;}
busy = true;
return false;
}
- return !mySMESHGUI->isActiveStudyLocked();
+ return !SMESHGUI::isStudyLocked();
}
//=================================================================================
const char* entry = myIObject->getEntry();
if ( !myActor ) {
- myActor = SMESH::CreateActor(SMESH::GetActiveStudyDocument(),
- entry, true);
+ myActor = SMESH::CreateActor(entry, true);
}
if( myEntityMode != myActor->GetEntityMode() ) {
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
if( !anActor )
- anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
+ anActor = SMESH::CreateActor( entry.toLatin1().data(), true );
if( anActor )
{
SMESH::DisplayActor( wnd, anActor );
if(viewer_type != SVTK_Viewer::Type())
return res;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
- if( !study )
- return res;
-
-
- _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry.toLatin1() );
+ _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( (const char*)entry.toLatin1() );
CORBA::Object_var anObj = SMESH::SObjectToObject( obj );
/*
*/
bool SMESHGUI_DuplicateNodesDlg::onApply()
{
- if ( mySMESHGUI->isActiveStudyLocked() || !isValid() )
+ if ( SMESHGUI::isStudyLocked() || !isValid() )
return false;
BusyLocker lock( myBusy );
//=================================================================================
bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if ( !SelectorWdg->IsAnythingSelected() || myPath->_is_nil() )
bool SMESHGUI_ExtrusionDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (!isValid())
myFields = & fields;
myTree->clear();
- _PTR(Study) study = SMESH::GetActiveStudyDocument();
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations( study->StudyId() );
+ GEOM::GEOM_IFieldOperations_wrap fieldOp = geomGen->GetIFieldOperations();
for ( int iM = 0; iM < meshes.count(); ++iM )
{
{
if ( strlen( theCriterion.ThresholdID ) > 0 ) // shape ID -> name
{
- _PTR(SObject) sobj =
- SMESH::GetActiveStudyDocument()->FindObjectID( theCriterion.ThresholdID.in() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( theCriterion.ThresholdID.in() );
if ( !sobj )
aTable->item( theRow, 2 )->setText( QString( theCriterion.ThresholdID ) );
else
QString aName;
myTable->GetThreshold(i, aName);
- std::vector<_PTR(SObject)> aList =
- SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
+ std::vector<_PTR(SObject)> aList = SMESH::getStudy()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
if (aList.size() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("BAD_SHAPE_NAME").arg(aName));
if (aList.Extent() == 1 && aList.First()->hasEntry())
{
Handle(SALOME_InteractiveObject) anIO = aList.First();
- _PTR(SObject) pObj = studyDS()->FindObjectID(anIO->getEntry());
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anIO->getEntry());
CORBA::Object_var anObj = SMESH::IObjectToObject( anIO );
newMeshEntry = anIO->getEntry();
SMESH::SMESH_IDSource_var aMeshOrPart = SMESH::SMESH_IDSource::_narrow(anObj);
if ( !aMeshShape->_is_nil() )
return aMeshShape;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (!aStudy)
- return aMeshShape;
-
- _PTR(ChildIterator) anIter (aStudy->NewChildIterator(theSO));
+ _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator(theSO));
for ( ; anIter->More(); anIter->Next()) {
_PTR(SObject) aSObject = anIter->Value();
_PTR(SObject) aRefSOClient;
if (!smeshSO)
return 0;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (!aStudy)
- return 0;
-
- _PTR(ChildIterator) anIter (aStudy->NewChildIterator( smeshSO ));
+ _PTR(ChildIterator) anIter (SMESH::getStudy()->NewChildIterator( smeshSO ));
for ( ; anIter->More(); anIter->Next()) {
_PTR(SObject) aSObject = anIter->Value();
_PTR(SObject) aRefSOClient;
long theID)
{
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (!aStudy || geomGen->_is_nil())
+ if (geomGen->_is_nil())
return GEOM::GEOM_Object::_nil();
GEOM::GEOM_IShapesOperations_wrap aShapesOp =
- geomGen->GetIShapesOperations(aStudy->StudyId());
+ geomGen->GetIShapesOperations();
if (aShapesOp->_is_nil())
return GEOM::GEOM_Object::_nil();
GEOM::GEOM_Object_wrap subShape = aShapesOp->GetSubShape (theMainShape,theID);
meshGeom.clear();
if ( hypIO.IsNull() ) return false;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if ( !aStudy ) return false;
-
- _PTR(SObject) hypSO = aStudy->FindObjectID( hypIO->getEntry() );
+ _PTR(SObject) hypSO = SMESH::getStudy()->FindObjectID( hypIO->getEntry() );
if ( !hypSO ) return false;
// Depth() is a number of fathers
QString aName = "";
// collect all object names of SMESH component
- SalomeApp_Study* appStudy =
- dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
- if ( !appStudy ) return aName;
- _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
std::set<std::string> aSet;
_PTR(SComponent) aMeshCompo (aStudy->FindComponent( "SMESH" ));
void SMESHGUI_GroupDlg::setDefaultName() const
{
QString aResName;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
int i=1;
QString aPrefix ="Group_";
_PTR(SObject) anObj;
do
{
aResName = aPrefix + QString::number( i++ );
- anObj = aStudy->FindObject( SMESH::toUtf8(aResName) );
+ anObj = SMESH::getStudy()->FindObject( SMESH::toUtf8(aResName) );
}
while ( anObj );
myName->setText(aResName);
else if ( grpType == 1 ) // group on geom
{
QString aShapeName( "" );
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape();
if (!aGroupShape->_is_nil())
{
//=================================================================================
bool SMESHGUI_GroupDlg::onApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (myName->text().trimmed().isEmpty())
if (myMesh->_is_nil() || !myGeomObjects->length())
return false;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
if (myGeomObjects->length() == 1) {
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
// create a geometry group
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (geomGen->_is_nil() || !aStudy)
+ if (geomGen->_is_nil())
return false;
- GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
if (op->_is_nil())
return false;
QString aNewGeomGroupName ( "Auto_group_for_" );
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
+ geomGen->AddInStudy(aGroupVar,
SMESH::toUtf8(aNewGeomGroupName), aMeshShape);
}
continue;
// Check if group constructed on the same shape as a mesh or on its child
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
// The main shape of the group
GEOM::GEOM_Object_var aGroupMainShape;
if (aGeomGroup->GetType() == 37) {
GEOM::GEOM_IGroupOperations_wrap anOp =
- SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+ SMESH::GetGEOMGen()->GetIGroupOperations();
aGroupMainShape = anOp->GetMainShape(aGeomGroup);
// aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
}
aGroupMainShape->Register();
}
_PTR(SObject) aGroupMainShapeSO =
- aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
+ SMESH::getStudy()->FindObjectID(aGroupMainShape->GetStudyEntry());
_PTR(SObject) anObj, aRef;
bool isRefOrSubShape = false;
onListSelectionChanged();
} else if (myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1) {
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
GEOM::GEOM_IGroupOperations_wrap aGroupOp =
- SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+ SMESH::GetGEOMGen()->GetIGroupOperations();
SMESH::ElementType aGroupType = SMESH::ALL;
switch(aGroupOp->GetType(myGeomObjects[0])) {
if (aGroupType == aType) {
_PTR(SObject) aGroupSO =
- //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup));
- aStudy->FindObjectID(myGeomObjects[0]->GetStudyEntry());
+ //SMESH::getStudy()->FindObjectIOR(SMESH::getStudy()->ConvertObjectToIOR(myGeomGroup));
+ SMESH::getStudy()->FindObjectID(myGeomObjects[0]->GetStudyEntry());
// Construct filter
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
SMESH::Filter_var aFilter = aFilterMgr->CreateFilter();
if ( !aGeomVar->_is_nil() )
{
QString ID = aGeomVar->GetStudyEntry();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
+ if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
SALOME_ListIO anIOList;
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
case GEOM::COMPOUND: break;
default: return SMESH::ALL;
}
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
GEOM::GEOM_IShapesOperations_wrap aShapeOp =
- SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());
+ SMESH::GetGEOMGen()->GetIShapesOperations();
if ( geom->GetType() == 37 ) { // geom group
GEOM::GEOM_IGroupOperations_wrap aGroupOp =
- SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+ SMESH::GetGEOMGen()->GetIGroupOperations();
if ( !aGroupOp->_is_nil() ) {
// mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
{
SUIT_OverrideCursor aWaitCursor;
- if (isStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
// study
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
if ( !aStudy ) return false;
// mesh
QStringList goodNames, goodIds;
if (nbSelected > 0) {
// study
- if (_PTR(Study) aStudy = SMESH::GetActiveStudyDocument()) {
+ if (_PTR(Study) aStudy = SMESH::getStudy()) {
// mesh
if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) {
// shape to mesh
*/
bool SMESHGUI_UnionGroupsDlg::onApply()
{
- if ( getSMESHGUI()->isActiveStudyLocked())
+ if ( SMESHGUI::isStudyLocked())
return false;
// Verify validity of group name
*/
bool SMESHGUI_IntersectGroupsDlg::onApply()
{
- if ( getSMESHGUI()->isActiveStudyLocked())
+ if ( SMESHGUI::isStudyLocked())
return false;
// Verify validity of group name
*/
bool SMESHGUI_CutGroupsDlg::onApply()
{
- if ( getSMESHGUI()->isActiveStudyLocked())
+ if ( SMESHGUI::isStudyLocked())
return false;
// Verify validity of group name
*/
bool SMESHGUI_DimGroupDlg::onApply()
{
- if ( getSMESHGUI()->isActiveStudyLocked())
+ if ( SMESHGUI::isStudyLocked())
return false;
// Verify validity of group name
case QVariant::String:
{
if((*anIt).isVariable) {
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
QString aVar = (*anIt).myValue.toString();
if(aStudy->IsInteger(aVar.toLatin1().constData())){
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
{
//remove just created hypothesis
_PTR(SObject) aHypSObject = SMESH::FindSObject( myHypo );
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
if( aStudy && !aStudy->GetProperties()->IsLocked() )
{
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
SUIT_OverrideCursor wc;
try {
- _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(Study) aStudy = getStudy();
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
if( aHypObj )
{
if (!AlgoOrHyp->_is_nil()) {
_PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
if (SO_Hypothesis) {
- SObjectList listSO =
- SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
+ SObjectList listSO = SMESH::getStudy()->FindDependances(SO_Hypothesis);
if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
for (unsigned int i = 0; i < listSO.size(); i++) {
bool isMesh = true;
for ( int i = 0; i < ids.count() && isMesh; ++i )
{
- _PTR(SObject) sobj =
- SMESHGUI::activeStudy()->studyDS()->FindObjectID( ids[i].toLatin1().constData() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toLatin1().constData() );
mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
//isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
}
for ( int i = 0; i < entries.count(); ++i )
{
SMESH::SMESH_GroupBase_var grp;
- if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
+ if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
grp = SMESH::SObjectToInterface<SMESH::SMESH_GroupBase>( sobj );
if ( grp->_is_nil() ) {
msg = tr( "SMESH_NOT_ONLY_GROUPS" );
for ( int i = 0; i < entries.count(); ++i )
{
SMESH::SMESH_IDSource_var idSource;
- if ( _PTR(SObject) sobj = SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() ))
+ if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ))
idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
if ( !idSource->_is_nil() ) {
SMESH::array_of_ElementType_var types = idSource->GetTypes();
groups->length( entries.count() );
for ( int i = 0; i < entries.count(); ++i )
{
- _PTR(SObject) sobj =
- SMESHGUI::activeStudy()->studyDS()->FindObjectID( entries[i].toLatin1().constData() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() );
SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
SMESH::array_of_ElementType_var types = grp->GetTypes();
if ( types->length() < 1 || types[0] != goodType )
bool SMESHGUI_Make2DFrom3DOp::onApply()
{
- if ( isStudyLocked() )
+ if ( SMESHGUI::isStudyLocked() )
return false;
QString msg;
bool SMESHGUI_MakeNodeAtPointOp::onApply()
{
- if( isStudyLocked() )
+ if( SMESHGUI::isStudyLocked() )
return false;
if ( !myMeshActor ) {
//=================================================================================
bool SMESHGUI_MergeDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
+ if (SMESHGUI::isStudyLocked() || myMesh->_is_nil())
return false;
try {
void SMESHGUI_MeshInfoDlg::dump()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
- if ( !appStudy ) return;
- _PTR( Study ) aStudy = appStudy->studyDS();
-
QStringList aFilters;
aFilters.append( tr( "TEXT_FILES" ));
*/
void SMESHGUI_CtrlInfoDlg::dump()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
- if ( !appStudy ) return;
- _PTR( Study ) aStudy = appStudy->studyDS();
-
QStringList aFilters;
aFilters.append( tr( "TEXT_FILES" ));
//================================================================================
bool SMESHGUI_MeshOp::onApply()
{
- if (isStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
QString aMess;
}
SMESHGUI_SelectionOp::startOperation();
// iterate through dimensions and get available algorithms, set them to the dialog
- _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
+ _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
{
SMESHGUI_MeshTab* aTab = myDlg->tab( i );
// mesh
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
if (!pMesh) return false;
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if (aGEOMs.count() > 0) {
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (geomGen->_is_nil() || !aStudy) return false;
+ if (geomGen->_is_nil()) return false;
- GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations(aStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
if (op->_is_nil()) return false;
// check all selected shapes
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+ _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
if (!pSubGeom) return false;
GEOM::GEOM_Object_var aSubGeomVar =
if ( aSubGeomVar->GetShapeType() == GEOM::COMPOUND )
{
// is aSubGeomVar a compound of sub-shapes?
- GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations(aStudy->StudyId());
+ GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations();
if (sop->_is_nil()) return false;
GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( aSubGeomVar,
GEOM::SHAPE,/*sorted=*/false);
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
if ( pMesh ) {
QStringList algoNames;
}
// GEOM::GEOM_Object_var geom;
-// if (_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() ))
+// if (_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ))
// geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
// if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well
{
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
if ( pMesh && pGeom ) {
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
if ( !geom->_is_nil() ) {
}
_PTR(GenericAttribute) anAttr;
_PTR(SObject) aSubmeshRoot;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
if ( pMesh->FindSubObject( tag, aSubmeshRoot ) )
{
_PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
//Check geometry for mesh
QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj);
- _PTR(SObject) pObj = studyDS()->FindObjectID(anObjEntry.toLatin1().data());
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anObjEntry.toLatin1().data());
if (pObj)
{
SMESH::SMESH_Mesh_var aMeshVar =
int iSubSh = 0;
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+ _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
if( pSubGeom ) {
SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom);
} else {
// get geometry by selected sub-mesh
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
if (!aGeomVar->_is_nil()) {
aSeq->length(1);
// enable/disable popup for choice of geom selection way
bool enable = false;
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+ if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() ) {
//rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
myDlg->activateObject(SMESHGUI_MeshDlg::Geom);
enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
{
QString aMeshEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+ if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
theMess = tr( "IMPORTED_MESH" );
}
return true;
}
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
{
theMess = tr( "GEOMETRY_OBJECT_IS_NULL" );
theMess = tr( "MESH_IS_NOT_DEFINED" );
return false;
}
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() )
{
theMess = tr( "MESH_IS_NULL" );
QString aCurrentGeomToSelect;
if ( !theMeshType.isEmpty() ) {
aCurrentGeomToSelect = myDlg->selectedObject( myToCreate ? SMESHGUI_MeshDlg::Geom : SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) so = studyDS()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
+ if ( _PTR(SObject) so = SMESH::getStudy()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) {
aGeomVar = SMESH::GetGeom( so );
}
if ( aCurrentGeomToSelect != myLastGeomToSelect )
if ( theFather->FindSubObject( aPart, aHypRoot ) )
{
- _PTR(ChildIterator) anIter =
- SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot );
+ _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypRoot );
for ( ; anIter->More(); anIter->Next() )
{
_PTR(SObject) anObj = anIter->Value();
{
anEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) pObj = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+ if ( _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
{
CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject();
if ( myToCreate ) // mesh and geom may be selected
{
aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj );
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+ if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
}
else // edition: sub-mesh may be selected
if ( !myToCreate ) // mesh to edit can be selected
{
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+ if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
{
aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if ( !aMeshVar->_is_nil() )
}
if ( aGeomVar->_is_nil() ) {
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
+ if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() ))
{
aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
}
aMeshEntry = aGeomEntry;
if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
- _PTR(SObject) pObj = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() );
}
if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
bool isMesh;
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
if ( !aGeomVar->_is_nil() )
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
// take geometry from submesh being created
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( pObj ) {
// if current object is sub-mesh
SMESH::SMESH_subMesh_var aSubMeshVar =
myDlg->setEnabled( true );
}
- _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+ _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent("SMESH");
int nbHyp = myExistingHyps[myDim][myType].count();
HypothesisData* algoData = hypData( myDim, Algo, currentHyp( myDim, Algo ));
// set hypotheses corresponding to the found algorithms
- _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+ _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
{
for ( int i = 0; it!=aList.end(); it++, ++i )
{
QString aGeomEntry = *it;
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar =
GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
// get mesh object
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() );
SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if (aMeshVar->_is_nil())
{
//QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
QString aGeomEntry = aGEOMs.first();
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() );
aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
}
else if (aGEOMs.count() > 1)
{
// create a GEOM group
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (!geomGen->_is_nil() && aStudy) {
+ if (!geomGen->_is_nil()) {
GEOM::GEOM_IGroupOperations_wrap op =
- geomGen->GetIGroupOperations(aStudy->StudyId());
+ geomGen->GetIGroupOperations();
if (!op->_is_nil()) {
// check and add all selected GEOM objects: they must be
// a sub-shapes of the main GEOM and must be of one type
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
+ _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data());
GEOM::GEOM_Object_var aSubGeomVar =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType();
// publish the GEOM group in study
QString aNewGeomGroupName ("Auto_group_for_");
aNewGeomGroupName += aName;
- SALOMEDS::Study_var aStudyVar = _CAST(Study, aStudy)->GetStudy();
SALOMEDS::SObject_wrap aNewGroupSO =
- geomGen->AddInStudy( aStudyVar, aGeomVar,
+ geomGen->AddInStudy( aGeomVar,
aNewGeomGroupName.toLatin1().data(), mainGeom);
}
}
{
QString aResName;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
int i = 1;
QString aPrefix = thePrefix;
QString aHypName = dataList[ aHypIndex ]->TypeName;
// get existing algorithms
- _PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
+ _PTR(SObject) pObj = SMESH::getStudy()->FindComponent("SMESH");
QStringList tmp;
existingHyps( theDim, Algo, pObj, tmp, myExistingHyps[ theDim ][ Algo ]);
delete aCreator;
}
QStringList tmpList;
- _PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
+ _PTR(SComponent) aFather = SMESH::getStudy()->FindComponent( "SMESH" );
existingHyps( theDim, Algo, aFather, tmpList, myExistingHyps[ theDim ][ Algo ] );
}
void SMESHGUI_MeshOp::readMesh()
{
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj )
return;
return false;
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj )
return false;
}
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
+ if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if ( !aMeshVar->_is_nil() ) {
if ( !aGeomVar->_is_nil() )
{
QString ID = SMESH::toQStr( aGeomVar->GetStudyEntry() );
- if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.toLatin1().data() )) {
+ if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) {
selectObject( aGeomSO );
selectionDone();
}
if (theListListIds.isEmpty() || myMesh->_is_nil())
return false;
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
if ( !aStudy || !aMeshSObj )
return false;
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
if (!anActor) {
- anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
+ anActor = SMESH::CreateActor(aSO->GetID().c_str());
if (anActor) {
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
SMESH::FitAll();
{
QString baseName = thePostfix.isEmpty() ?
theBaseName : theBaseName + "_" + thePostfix;
- if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
+ if ( _PTR(Study) aStudy = getStudy() ) {
QString name = baseName;
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
int nb = 0;
QString baseName = thePostfix.isEmpty() ?
theBaseName : theBaseName + "_" + thePostfix;
QString name = baseName;
- if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
+ if ( _PTR(Study) aStudy = getStudy() ) {
_PTR(SObject) p = theParent;
if ( !p ) p = aStudy->FindComponent( "SMESH" );
if ( p ) {
//=======================================================================
bool SMESHGUI_MultiEditDlg::onApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (!isValid(true))
return false;
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
aNodeId = aMeshEditor->AddNode( x, y, z );
- _PTR(Study) aStudy = GetActiveStudyDocument();
- CORBA::Long anId = aStudy->StudyId();
- if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
+ if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) {
aVisualObj->Update( true );
}
}
//=================================================================================
bool SMESHGUI_NodesDlg::ClickOnApply()
{
- if ( mySMESHGUI->isActiveStudyLocked() )
+ if ( SMESHGUI::isStudyLocked() )
return false;
if ( myMesh->_is_nil() ) {
tr( "NO_MODULE" ) );
return false;
}
- else if ( isStudyLocked() )
+ else if ( SMESHGUI::isStudyLocked() )
return false;
return true;
}
-//=======================================================================
-// name : studyDS
-// Purpose :
-//=======================================================================
-_PTR(Study) SMESHGUI_Operation::studyDS() const
-{
- SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study() );
- return s->studyDS();
-}
-
//=======================================================================
// name : onOk
// Purpose :
return myIsApplyAndClose;
}
-/*!
- * \brief Verifies whether study of operation is locked
- * \param theMess - specifies whether message box must be shown if study is locked
- * \return State of study.
-*
-* Verifies whether study of operation is locked. If second parameter is TRUE and study
-* is locked when corresponding message box appears
-*/
-bool SMESHGUI_Operation::isStudyLocked( const bool theMess ) const
-{
- if ( studyDS() )
- {
- if ( studyDS()->GetProperties()->IsLocked() )
- {
- if ( theMess )
- SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
- tr( "WRN_STUDY_LOCKED" ) );
- return true;
- }
- }
-
- return false;
-}
-
/*!
* \brief Verifies whether given operator is valid for this one
* \param theOtherOp - other operation
virtual void setDialogActive( const bool );
SMESHGUI* getSMESHGUI() const;
- bool isStudyLocked( const bool = true ) const;
-
- _PTR(Study) studyDS() const;
virtual bool isValid( SUIT_Operation* ) const;
//=================================================================================
void SMESHGUI_RemoveElementsDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return;
if (myNbOkElements)
//=================================================================================
void SMESHGUI_RemoveNodesDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return;
if (myNbOkNodes) {
//=================================================================================
void SMESHGUI_RenumberingDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return;
if (!myMesh->_is_nil()) {
bool SMESHGUI_ReorientFacesOp::onApply()
{
- if( isStudyLocked() )
+ if( SMESHGUI::isStudyLocked() )
return false;
QString msg;
{
// check object
QString objectEntry = myDlg->selectedObject( EObject );
- _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
+ _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
myObject = SMESH::SMESH_IDSource::_narrow( _CAST( SObject,pSObject )->GetObject() );
if ( myObject->_is_nil() )
{
if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME )
{
objectEntry = myDlg->selectedObject( EVolumes );
- _PTR(SObject) pSObject = studyDS()->FindObjectID( objectEntry.toLatin1().data() );
+ _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() );
myVolumeObj = SMESH::SObjectToInterface< SMESH::SMESH_IDSource>( pSObject );
if ( myVolumeObj->_is_nil() )
{
//=================================================================================
bool SMESHGUI_RevolutionDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (!isValid())
//=================================================================================
bool SMESHGUI_RotationDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if( !isValid() )
//=================================================================================
bool SMESHGUI_ScaleDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if( !isValid() )
#include <SMESH_ScalarBarActor.h>
// SALOME GUI includes
-#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
#include <LightApp_VTKSelector.h>
#include <SVTK_ViewWindow.h>
{
LightApp_Selection::init( client, mgr );
- if( mgr && study() )
+ if( mgr )
{
- SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
- if (!aSStudy)
- return;
- _PTR(Study) aStudy = aSStudy->studyDS();
-
for( int i=0, n=count(); i<n; i++ ) {
- myTypes.append( typeName( type( entry( i ), aStudy ) ) );
+ myTypes.append( typeName( type( entry( i ) ) ) );
myControls.append( controlMode( i ) );
}
}
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
if ( !CORBA::is_nil( idSrc ) )
{
bool SMESHGUI_Selection::isQuadratic( int ind ) const
{
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
if ( !so )
return false;
SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( so );
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
- SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
- if ( !CORBA::is_nil( mesh ) )
- return mesh->GetAutoColor();
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
+
+ if ( !CORBA::is_nil( obj ) ) {
+ SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
+ if ( !CORBA::is_nil( mesh ) )
+ return mesh->GetAutoColor();
+ }
}
return false;
}
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
if ( !CORBA::is_nil( obj ) ) {
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
int dim = -1;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
if ( !CORBA::is_nil( obj ) ) {
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
myTypes[ind].startsWith("Mesh " )))
{
QMap<int,int> modeMap;
- _PTR(SObject) meshSO = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
_PTR(SComponent) component = meshSO->GetFatherComponent();
if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
if ( maxDim < 2 ) // we can preview 1D or 2D
{
QMap<int,int> modeMap;
- _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
if ( modeMap.size() > 1 )
return (( modeMap.contains( SMESH::DIM_3D )) ||
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
return !shape->_is_nil();
}
bool isEditable = true;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" )
{
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface<SMESH::SMESH_Hypothesis>( so );
if ( !hyp->_is_nil() )
{
{
if ( ind >= 0 )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() );
if ( sobj )
- return SMESH::GetActiveStudyDocument()->GetUseCaseBuilder()->HasChildren( sobj );
+ return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj );
}
return false;
}
int nb = 0;
if ( ind >= 0 )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- if ( sobj && sobj->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
- _PTR(UseCaseIterator) it = sobj->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
+ _PTR(Study) study = SMESH::getStudy();
+ _PTR(SObject) sobj = study->FindObjectID( entry( ind ).toLatin1().data() );
+ if ( sobj && study->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
+ _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
for ( it->Init( false ); it->More(); it->Next() ) nb++;
}
}
//purpose :
//=======================================================================
-int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
+int SMESHGUI_Selection::type( const QString& entry )
{
int res = -1;
- _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().data() );
+ _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toLatin1().data() );
if ( obj ) {
_PTR(SObject) ref;
if ( obj->ReferencedObject( ref ) )
bool SMESHGUI_Selection::isImported( const int ind ) const
{
bool res = false;
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
if ( sobj )
{
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) );
QString SMESHGUI_Selection::groupType( int ind ) const
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().constData() );
+ _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() );
if ( sobj )
{
SMESH::SMESH_Group_var g = SMESH::SObjectToInterface<SMESH::SMESH_Group>( sobj );
SMESH_Actor* getActor( int ) const;
- static int type( const QString&, _PTR(Study) );
+ static int type( const QString& );
static QString typeName( const int );
static int guiState();
//=======================================================================
int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype ) const
{
- SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
- if( !_study )
- return -1;
-
- _PTR( Study ) st = _study->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
int res = -1;
if( objtype == Object )
{
- SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
- if( _study )
+ int t = SMESHGUI_Selection::type( str );
+ if( t<0 )
{
- int t = SMESHGUI_Selection::type( str, _study->studyDS() );
- if( t<0 )
+ //try to get GEOM type
+ _PTR( SObject ) sobj = aStudy->FindObjectID( str.toLatin1().data() );
+ if( sobj )
{
- //try to get GEOM type
- _PTR( SObject ) sobj = st->FindObjectID( str.toLatin1().data() );
- if( sobj )
- {
- GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
- dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
- if( !CORBA::is_nil( obj ) )
- // as decoding of type id is not realized in LightApp_Dialog,
- //make all GEOM objects have same type id
- res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
- }
+ GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
+ dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
+ if( !CORBA::is_nil( obj ) )
+ // as decoding of type id is not realized in LightApp_Dialog,
+ //make all GEOM objects have same type id
+ res = SMESHGUI_Dialog::prefix( "GEOM" );// + obj->GetType();
}
- else
- res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
}
+ else
+ res = SMESHGUI_Dialog::prefix( "SMESH" ) + t;
}
else
{
int id = _id.toInt( &ok );
if( ok )
{
- _PTR( SObject ) sobj = st->FindObjectID( entry.toLatin1().data() );
+ _PTR( SObject ) sobj = aStudy->FindObjectID( entry.toLatin1().data() );
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow(
dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow(
QString id = anIt.Value()->getEntry();
ids.append( id );
types.append( typeById( id, Object ) );
- SalomeApp_Study* _study = dynamic_cast<SalomeApp_Study*>( study() );
- if( _study )
- {
- _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
- if( obj )
- names.append( QString( obj->GetName().c_str() ).trimmed() );
- }
+ _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( anIt.Value()->getEntry() );
+ if( obj )
+ names.append( QString( obj->GetName().c_str() ).trimmed() );
}
}
}
//=================================================================================
bool SMESHGUI_SewingDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
bool aResult = false;
else
{
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if (geomGen->_is_nil() || !aStudy)
+ if (geomGen->_is_nil())
return;
GEOM::GEOM_IShapesOperations_wrap aShapesOp =
- geomGen->GetIShapesOperations(aStudy->StudyId());
+ geomGen->GetIShapesOperations();
if (aShapesOp->_is_nil() )
return;
else if (aNumberOfGO > 1)
{
GEOM::GEOM_IGroupOperations_wrap aGroupOp =
- geomGen->GetIGroupOperations(aStudy->StudyId());
+ geomGen->GetIGroupOperations();
if(aGroupOp->_is_nil())
return;
// publish the GEOM object in study
QString aNewGeomGroupName ( myDlg->myGeomName->text() );
- SALOMEDS::Study_var aStudyVar = _CAST(Study,aStudy)->GetStudy();
SALOMEDS::SObject_wrap aNewGroupSO =
- geomGen->AddInStudy( aStudyVar, aGeomObject,
+ geomGen->AddInStudy( aGeomObject,
aNewGeomGroupName.toLatin1().data(), aMeshShape);
// get a GEOM_Object already published, which doesn't need UnRegister()
//=================================================================================
bool SMESHGUI_SingleEditDlg::onApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
// verify validity of input data
if (!isValid(true))
//=================================================================================
bool SMESHGUI_SmoothingDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if (!isValid())
int nbObj = 0;
for ( int i = 0; i < entries.count() ; ++i )
{
- _PTR(SObject) pObj = studyDS()->FindObjectID( entries[i].toLatin1().data() );
+ _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().data() );
SMESH::SMESH_IDSource_var obj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
if( !CORBA::is_nil( obj ))
{
//=================================================================================
bool SMESHGUI_SymmetryDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if( !isValid() )
//=================================================================================
bool SMESHGUI_TranslationDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if (SMESHGUI::isStudyLocked())
return false;
if( !isValid() )
return SUIT_Session::session()->resourceMgr();
}
- _PTR(Study)
- GetCStudy(const SalomeApp_Study* theStudy)
- {
- return theStudy->studyDS();
- }
-
CORBA::Object_var
DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner)
{
const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
if(!anIO.IsNull()){
if(anIO->hasEntry()){
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
- anObj = SObjectToObject(aSObj,aStudy);
+ _PTR(SObject) aSObj = getStudy()->FindObjectID(anIO->getEntry());
+ anObj = SObjectToObject(aSObj);
}
}
}
return NULL;
}
- _PTR(Study) GetActiveStudyDocument()
+ _PTR(Study) getStudy()
{
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(GetActiveStudy());
- if (aStudy)
- return aStudy->studyDS();
- else
- return _PTR(Study)();
+ static _PTR(Study) _study;
+ if(!_study)
+ _study = SalomeApp_Application::getStudy();
+ return _study;
}
_PTR(SObject) FindSObject (CORBA::Object_ptr theObject)
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
if (app && !CORBA::is_nil(theObject)) {
- if(_PTR(Study) aStudy = GetActiveStudyDocument()){
- CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
- if (strcmp(anIOR.in(), "") != 0)
- return aStudy->FindObjectIOR(anIOR.in());
- }
+ CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
+ if (strcmp(anIOR.in(), "") != 0)
+ return getStudy()->FindObjectIOR(anIOR.in());
}
return _PTR(SObject)();
}
void SetName (_PTR(SObject) theSObject, const QString& theName)
{
- _PTR(Study) aStudy = GetActiveStudyDocument();
- if (aStudy->GetProperties()->IsLocked())
+ if (getStudy()->GetProperties()->IsLocked())
return;
SMESHGUI::GetSMESHGen()->SetName(theSObject->GetIOR().c_str(), theName.toLatin1().data());
}
void SetValue (_PTR(SObject) theSObject, const QString& theValue)
{
- _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(Study) aStudy = getStudy();
if (aStudy->GetProperties()->IsLocked())
return;
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
void setFileName (_PTR(SObject) theSObject, const QString& theValue)
{
- _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(Study) aStudy = getStudy();
if (aStudy->GetProperties()->IsLocked())
return;
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
void setFileType (_PTR(SObject) theSObject, const QString& theValue)
{
- _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(Study) aStudy = getStudy();
if (aStudy->GetProperties()->IsLocked())
return;
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
aFileType->SetValue(theValue.toLatin1().data());
}
- CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
- _PTR(Study) /*theStudy*/)
+ CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject )
{
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
return CORBA::Object::_nil();
}
- CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject)
- {
- _PTR(Study) aStudy;// = GetActiveStudyDocument(); -- aStudy is not used
- return SObjectToObject(theSObject,aStudy);
- }
-
_PTR(SObject) ObjectToSObject( CORBA::Object_ptr theObject )
{
_PTR(SObject) res;
(SUIT_Session::session()->activeApplication());
if ( app ) {
CORBA::String_var ior = app->orb()->object_to_string( theObject );
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( study && strlen( ior ) > 0 )
- res = study->studyDS()->FindObjectIOR( ior.in() );
+ if ( strlen( ior ) > 0 )
+ res = getStudy()->FindObjectIOR( ior.in() );
}
return res;
}
{
if (!theIO.IsNull()) {
if (theIO->hasEntry()) {
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
- return SObjectToObject(anObj,aStudy);
+ _PTR(SObject) anObj = getStudy()->FindObjectID(theIO->getEntry());
+ return SObjectToObject(anObj);
}
}
return CORBA::Object::_nil();
void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNotModif, bool isEmptyMesh)
{
- _PTR(Study) aStudy = GetActiveStudyDocument();
- if ( !aStudy || aStudy->GetProperties()->IsLocked() )
+ _PTR(Study) aStudy = getStudy();
+ if ( !aStudy || aStudy->GetProperties()->IsLocked())
return;
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
aPixmap = anAttr;
std::string entry = aSObj1->GetID();
- int objType = SMESHGUI_Selection::type( entry.c_str(), aStudy );
+ int objType = SMESHGUI_Selection::type( entry.c_str() );
if ( objType == SMESH::HYPOTHESIS || objType == SMESH::ALGORITHM )
continue;
SMESHGUI_EXPORT
SUIT_ResourceMgr*
GetResourceMgr( const SalomeApp_Module* );
-
-SMESHGUI_EXPORT
- _PTR(Study)
- GetCStudy( const SalomeApp_Study* );
SMESHGUI_EXPORT
CORBA::Object_var DataOwnerToObject( const LightApp_DataOwnerPtr& );
SUIT_ViewWindow* GetActiveWindow();
SMESHGUI_EXPORT
- _PTR(Study) GetActiveStudyDocument();
+ _PTR(Study) getStudy();
SMESHGUI_EXPORT
_PTR(SObject) FindSObject( CORBA::Object_ptr );
void setFileType( _PTR(SObject), const QString& );
void setFileName( _PTR(SObject), const QString& );
-SMESHGUI_EXPORT
- CORBA::Object_var SObjectToObject( _PTR(SObject),
- _PTR(Study) );
-
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject) );
namespace SMESH
{
- typedef std::map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
+ typedef std::map<std::string,TVisualObjPtr> TVisualObjCont;
static TVisualObjCont VISUAL_OBJ_CONT;
//=============================================================================
}
}
- if (aViewManager ) {
- int aStudyId = aViewManager->study()->id();
- TVisualObjCont::key_type aKey(aStudyId,theEntry);
- TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
- if(anIter != VISUAL_OBJ_CONT.end()) {
- // for unknown reason, object destructor is not called, so clear object manually
- anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
- anIter->second->GetUnstructuredGrid()->SetPoints(0);
- }
- VISUAL_OBJ_CONT.erase(aKey);
+ TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
+ if(anIter != VISUAL_OBJ_CONT.end()) {
+ // for unknown reason, object destructor is not called, so clear object manually
+ anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+ anIter->second->GetUnstructuredGrid()->SetPoints(0);
}
+ VISUAL_OBJ_CONT.erase(theEntry);
if(actorRemoved)
aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
*/
//================================================================================
- void RemoveVisuData(int studyID)
+ void RemoveVisuData()
{
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
( SUIT_Session::session()->activeApplication() );
ViewManagerList viewMgrs = app->viewManagers();
for ( int iM = 0; iM < viewMgrs.count(); ++iM ) {
SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
- if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() &&
- aViewManager->study()->id() == studyID ) {
+ if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() ) {
QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
}
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.begin();
for ( ; anIter != VISUAL_OBJ_CONT.end(); ) {
- int curId = anIter->first.first;
- if ( curId == studyID ) {
- // for unknown reason, object destructor is not called, so clear object manually
- anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
- anIter->second->GetUnstructuredGrid()->SetPoints(0);
- VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
- }
- else {
- anIter++;
- }
+ // for unknown reason, object destructor is not called, so clear object manually
+ anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
+ anIter->second->GetUnstructuredGrid()->SetPoints(0);
+ VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
}
}
*/
//================================================================================
- TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry, bool nulData){
+ TVisualObjPtr GetVisualObj(const char* theEntry, bool nulData){
TVisualObjPtr aVisualObj;
- TVisualObjCont::key_type aKey(theStudyId,theEntry);
try{
OCC_CATCH_SIGNALS;
- TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
+ TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
if(anIter != VISUAL_OBJ_CONT.end()){
aVisualObj = anIter->second;
}else{
SalomeApp_Application* app =
dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
- _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
if(aSObj){
_PTR(GenericAttribute) anAttr;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
if(!aMesh->_is_nil()){
aVisualObj.reset(new SMESH_MeshObj(aMesh));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ TVisualObjCont::value_type aValue(theEntry,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
//Try narrow to SMESH_Group interface
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
- TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+ TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ TVisualObjCont::value_type aValue(theEntry,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
aFatherSObj = aFatherSObj->GetFather();
if(!aFatherSObj) return aVisualObj;
CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
- TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+ TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ TVisualObjCont::value_type aValue(theEntry,aVisualObj);
VISUAL_OBJ_CONT.insert(aValue);
}
}
return NULL;
if(!CORBA::is_nil(theObject)){
- _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(Study) aStudy = getStudy();
CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
_PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
if(aSObject){
}
- SMESH_Actor* CreateActor(_PTR(Study) theStudy,
- const char* theEntry,
+ SMESH_Actor* CreateActor(const char* theEntry,
int theIsClear)
{
SMESH_Actor *anActor = NULL;
- CORBA::Long anId = theStudy->StudyId();
- if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
- _PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
+ if(TVisualObjPtr aVisualObj = GetVisualObj(theEntry)){
+ _PTR(SObject) aSObj = getStudy()->FindObjectID(theEntry);
if(aSObj){
_PTR(GenericAttribute) anAttr;
if(aSObj->FindAttribute(anAttr,"AttributeName")){
Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
if(anIO->hasEntry()){
std::string anEntry = anIO->getEntry();
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
- int aStudyId = aStudy->id();
- TVisualObjCont::key_type aKey(aStudyId,anEntry);
- VISUAL_OBJ_CONT.erase(aKey);
+ VISUAL_OBJ_CONT.erase(anEntry);
}
}
theActor->Delete();
{
//MESSAGE("---");
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
- _PTR(Study) aDocument = aStudy->studyDS();
- // Pass non-visual objects (hypotheses, etc.), return true in this case
- CORBA::Long anId = aDocument->StudyId();
TVisualObjPtr aVisualObj;
- if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
+ if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
{
- if ((anActor = CreateActor(aDocument,theEntry,true))) {
+ if ((anActor = CreateActor(theEntry,true))) {
bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
DisplayActor(theWnd,anActor);
anActor->SetVisibility(true);
bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{
//MESSAGE("Update");
- _PTR(Study) aStudy = GetActiveStudyDocument();
- CORBA::Long anId = aStudy->StudyId();
- if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
+ if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry())) {
if ( theDisplay )
UpdateView(SMESH::eDisplay,theIO->getEntry());
return true;
bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
{
//MESSAGE("UpdateNulData");
- _PTR(Study) aStudy = GetActiveStudyDocument();
- CORBA::Long anId = aStudy->StudyId();
- if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
+ if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry(), true)) {
if ( theDisplay )
UpdateView(SMESH::eDisplay,theIO->getEntry());
return true;
namespace SMESH
{
//----------------------------------------------------------------------------
- typedef std::pair<int,std::string> TKeyOfVisualObj;
SMESHGUI_EXPORT
- TVisualObjPtr GetVisualObj( int, const char*, bool nulData =false );
+ TVisualObjPtr GetVisualObj( const char*, bool nulData =false );
SMESHGUI_EXPORT
void OnVisuException(); // PAL16631
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- SMESH_Actor* CreateActor( _PTR(Study), const char*, int = false );
+ SMESH_Actor* CreateActor( const char*, int = false );
SMESHGUI_EXPORT
void DisplayActor( SUIT_ViewWindow*, SMESH_Actor* );
SMESHGUI_EXPORT
void RemoveActor( SUIT_ViewWindow*, SMESH_Actor* );
SMESHGUI_EXPORT
- void RemoveVisuData( int );
+ void RemoveVisuData();
//----------------------------------------------------------------------------
enum EDisplaing { eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll };
text << "import salome, SMESH\n";
text << "salome.salome_init()\n";
text << "from salome.smesh import smeshBuilder\n";
- text << "smesh = smeshBuilder.New(salome.myStudy)\n";
+ text << "smesh = smeshBuilder.New()\n";
text << "m=smesh.Mesh()\n";
for ( size_t iE = 0; iE < bndSegsPerEdge.size(); ++iE )
{
${KERNEL_SalomeGenericObj}
${KERNEL_SalomeIDLKERNEL}
${KERNEL_SALOMELocalTrace}
+ ${KERNEL_SalomeKernelHelpers}
${CAS_TKCDF}
${CAS_TKBO}
${CAS_TKShHealing}
Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
std::set< TCollection_AsciiString >& theRemovedObjIDs,
- SALOMEDS::Study_ptr& theStudy,
const bool theToKeepAllCommands)
{
std::list< TCollection_AsciiString >::iterator lineIt;
theGen = new _pyGen( theEntry2AccessorMethod,
theObjectNames,
theRemovedObjIDs,
- theStudy,
theToKeepAllCommands );
for ( lineIt = theScriptLines.begin(); lineIt != theScriptLines.end(); ++lineIt )
set<_pyID> createdObjects;
createdObjects.insert( "smeshBuilder" );
createdObjects.insert( "smesh" );
- createdObjects.insert( "theStudy" );
for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd )
{
#ifdef DUMP_CONVERSION
_pyGen::_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
std::set< TCollection_AsciiString >& theRemovedObjIDs,
- SALOMEDS::Study_ptr& theStudy,
const bool theToKeepAllCommands)
: _pyObject( new _pyCommand( "", 0 )),
myNbCommands( 0 ),
myRemovedObjIDs( theRemovedObjIDs ),
myNbFilters( 0 ),
myToKeepAllCommands( theToKeepAllCommands ),
- myStudy( SALOMEDS::Study::_duplicate( theStudy )),
myGeomIDNb(0), myGeomIDIndex(-1)
{
// make that GetID() to return TPythonDump::SMESHGenName()
GetCreationCmd()->GetString() += "=";
// Find 1st digit of study entry by which a GEOM object differs from a SMESH object
- if ( !theObjectNames.IsEmpty() && !CORBA::is_nil( theStudy ))
+ if ( !theObjectNames.IsEmpty() )
{
// find a GEOM entry
_pyID geomID;
- SALOMEDS::SComponent_wrap geomComp = theStudy->FindComponent("GEOM");
+ SALOMEDS::SComponent_wrap geomComp = SMESH_Gen_i::getStudyServant()->FindComponent("GEOM");
if ( geomComp->_is_nil() ) return;
CORBA::String_var entry = geomComp->GetID();
geomID = entry.in();
static TStringSet smeshpyMethods;
if ( smeshpyMethods.empty() ) {
const char * names[] =
- { "SetEmbeddedMode","IsEmbeddedMode","SetCurrentStudy","GetCurrentStudy",
+ { "SetEmbeddedMode","IsEmbeddedMode","UpdateStudy","GetStudy",
"GetPattern","GetSubShapesId",
"" }; // <- mark of array end
smeshpyMethods.Insert( names );
// either the SMESH object is not in study or it is a GEOM object
if ( IsGeomObject( theObjID ))
{
- SALOMEDS::SObject_wrap so = myStudy->FindObjectID( theObjID.ToCString() );
+ SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( theObjID.ToCString() );
if ( so->_is_nil() ) return true;
CORBA::Object_var obj = so->GetObject();
return CORBA::is_nil( obj );
const char * names[] =
{ "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents",
"GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
- "ClearLog","GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
+ "ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
"NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",
"NbTrianglesOfOrder","NbQuadrangles","NbQuadranglesOfOrder","NbPolygons","NbVolumes",
"NbVolumesOfOrder","NbTetras","NbTetrasOfOrder","NbHexas","NbHexasOfOrder",
_pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
std::set< TCollection_AsciiString >& theRemovedObjIDs,
- SALOMEDS::Study_ptr& theStudy,
const bool theToKeepAllCommands);
Handle(_pyCommand) AddCommand( const _AString& theCommand );
void ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) theCmd2 );
Handle(_pyCommand) myLastCommand;
int myNbFilters;
bool myToKeepAllCommands;
- SALOMEDS::Study_var myStudy;
int myGeomIDNb, myGeomIDIndex;
std::map< _AString, ExportedMeshData > myFile2ExportedMesh;
Handle( _pyHypothesisReader ) myHypReader;
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
std::string aString = myStream.str();
TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- if(!aStudy->_is_nil() && !aCollection.IsEmpty())
+ if(!aCollection.IsEmpty())
{
const std::string & objEntry = SMESH_Gen_i::GetSMESHGen()->GetLastObjEntry();
if ( !objEntry.empty() )
aCollection += (TVar::ObjPrefix() + objEntry ).c_str();
- aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
+ aSMESHGen->AddToPythonScript(aCollection);
if(MYDEBUG) MESSAGE(aString);
// prevent misuse of already treated variables
aSMESHGen->UpdateParameters(CORBA::Object_var().in(),"");
operator<<(CORBA::Object_ptr theArg)
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+ SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
if(!aSObject->_is_nil()) {
CORBA::String_var id = aSObject->GetID();
myStream << id;
TPythonDump::
operator<<(SMESH::SMESH_Hypothesis_ptr theArg)
{
- SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
- SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+ SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
if(aSObject->_is_nil() && !CORBA::is_nil(theArg))
myStream << "hyp_" << theArg->GetId();
else
if ( CORBA::is_nil( theArg ) )
return *this << "None";
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
+ SALOMEDS::SObject_wrap aSObject = SMESH_Gen_i::ObjectToSObject(theArg);
if(!aSObject->_is_nil())
{
return *this << aSObject;
SMESH::long_array_var anElementsId = theArg->GetIDs();
SMESH::array_of_ElementType_var types = theArg->GetTypes();
SMESH::ElementType type = types->length() ? types[0] : SMESH::ALL;
- SALOMEDS::SObject_wrap meshSO = SMESH_Gen_i::ObjectToSObject(aStudy,mesh);
+ SALOMEDS::SObject_wrap meshSO = SMESH_Gen_i::ObjectToSObject(mesh);
if ( meshSO->_is_nil() ) // don't waste memory for dumping not published objects
return *this << mesh << ".GetIDSource([], " << type << ")";
else
//function : DumpPython
//purpose :
//=======================================================================
-Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+Engines::TMPFile* SMESH_Gen_i::DumpPython (CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
- SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
+ SALOMEDS::Study_var aStudy = getStudyServant();
if (CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
// Add trace of API methods calls and replace study entries by names
TCollection_AsciiString aScript;
- aScript += DumpPython_impl(aStudy, aMap, aMapNames, isPublished, isMultiFile,
+ aScript += DumpPython_impl(aMap, aMapNames, isPublished, isMultiFile,
myIsHistoricalPythonDump, isValidScript, aSavedTrace);
int aLen = aScript.Length();
* AddToPythonScript
*/
//=============================================================================
-void SMESH_Gen_i::AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString)
+void SMESH_Gen_i::AddToPythonScript (const TCollection_AsciiString& theString)
{
- if (myPythonScripts.find(theStudyID) == myPythonScripts.end()) {
- myPythonScripts[theStudyID] = new TColStd_HSequenceOfAsciiString;
+ if (myPythonScript.IsNull()) {
+ myPythonScript = new TColStd_HSequenceOfAsciiString;
}
- myPythonScripts[theStudyID]->Append(theString);
+ myPythonScript->Append(theString);
}
//=============================================================================
* RemoveLastFromPythonScript
*/
//=============================================================================
-void SMESH_Gen_i::RemoveLastFromPythonScript (int theStudyID)
+void SMESH_Gen_i::RemoveLastFromPythonScript()
{
- if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
- int aLen = myPythonScripts[theStudyID]->Length();
- myPythonScripts[theStudyID]->Remove(aLen);
+ if (!myPythonScript.IsNull()) {
+ int aLen = myPythonScript->Length();
+ myPythonScript->Remove(aLen);
}
}
//function : SavePython
//purpose :
//=======================================================================
-void SMESH_Gen_i::SavePython (SALOMEDS::Study_ptr theStudy)
+void SMESH_Gen_i::SavePython()
{
// Dump trace of API methods calls
- TCollection_AsciiString aScript = GetNewPythonLines(theStudy->StudyId());
+ TCollection_AsciiString aScript = GetNewPythonLines();
// Check contents of PythonObject attribute
CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SObject_wrap aSO = theStudy->FindComponent( compDataType.in() );
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::SObject_wrap aSO = getStudyServant()->FindComponent( compDataType.in() );
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute(aSO, "AttributePythonObject");
pyAttr->SetObject(oldScript.ToCString(), 1);
// Clean trace of API methods calls
- CleanPythonTrace(theStudy->StudyId());
+ CleanPythonTrace();
}
//================================================================================
/*!
* \brief Createa a Dump Python script
- * \param [in] theStudy - the study to dump
* \param [in,out] theObjectNames - map of an entry to a study and python name
* \param [in] theNames - - map of an entry to a study name
* \param [in] isPublished - \c true if dump of object publication in study is needed
//================================================================================
TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
- (SALOMEDS::Study_ptr theStudy,
- Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+ (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
Resource_DataMapOfAsciiStringAsciiString& theNames,
bool isPublished,
bool isMultiFile,
TCollection_AsciiString& theSavedTrace)
{
SMESH_TRY;
- const int aStudyID = theStudy->StudyId();
const TCollection_AsciiString aSmeshpy ( SMESH_2smeshpy::SmeshpyName() );
const TCollection_AsciiString aSMESHGen( SMESH_2smeshpy::GenName() );
std::list< TCollection_AsciiString >::iterator linesIt;
if ( isPublished )
- lines.push_back( aSMESHGen + " = smeshBuilder.New(theStudy)" );
+ lines.push_back( aSMESHGen + " = smeshBuilder.New()" );
else
- lines.push_back( aSMESHGen + " = smeshBuilder.New(None)" );
+ lines.push_back( aSMESHGen + " = smeshBuilder.New(False)" );
lines.push_back( helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()" );
lines.push_back( helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()" );
}
// Add new dump trace of API methods calls to script lines
- if (myPythonScripts.find( aStudyID ) != myPythonScripts.end())
+ if (!myPythonScript.IsNull())
{
- Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[ aStudyID ];
+ Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
Standard_Integer istr, aLen = aPythonScript->Length();
for (istr = 1; istr <= aLen; istr++)
lines.push_back( aPythonScript->Value( istr ));
if ( !getenv("NO_2smeshpy_conversion"))
SMESH_2smeshpy::ConvertScript( lines, anEntry2AccessorMethod,
theObjectNames, aRemovedObjIDs,
- theStudy, isHistoricalDump );
+ isHistoricalDump );
bool importGeom = false;
GEOM::GEOM_Gen_ptr geom = GetGeomEngine();
}
if ( isMultiFile )
- initPart += "def RebuildData(theStudy):";
+ initPart += "def RebuildData():";
initPart += "\n";
anUpdatedScript.Prepend( initPart );
TCollection_AsciiString removeObjPart;
if ( !mapRemoved.IsEmpty() ) {
removeObjPart += nt + "## some objects were removed";
- removeObjPart += nt + "aStudyBuilder = theStudy.NewBuilder()";
+ removeObjPart += nt + "aStudyBuilder = salome.myStudy.NewBuilder()";
Resource_DataMapIteratorOfDataMapOfAsciiStringAsciiString mapRemovedIt;
for ( mapRemovedIt.Initialize( mapRemoved ); mapRemovedIt.More(); mapRemovedIt.Next() ) {
aName = mapRemovedIt.Value(); // python name
anEntry = mapRemovedIt.Key();
- removeObjPart += nt + "SO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(";
+ removeObjPart += nt + "SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(";
removeObjPart += aName;
// for object wrapped by class of smeshBuilder.py
if ( anEntry2AccessorMethod.IsBound( anEntry ) )
{
//Output the script that sets up the visual parameters.
CORBA::String_var compDataType = ComponentDataType();
- CORBA::String_var script = theStudy->GetDefaultScript( compDataType.in(), tab.ToCString() );
+ CORBA::String_var script = getStudyServant()->GetDefaultScript( compDataType.in(), tab.ToCString() );
if ( script.in() && script.in()[0] ) {
visualPropertiesPart += nt + "### Store presentation parameters of displayed objects\n";
visualPropertiesPart += script.in();
"\nif __name__ == '__main__':"
"\n\tSMESH_RebuildData = RebuildData"
"\n\texec('import '+re.sub('SMESH$','GEOM',thisModule)+' as GEOM_dump')"
- "\n\tGEOM_dump.RebuildData( salome.myStudy )"
+ "\n\tGEOM_dump.RebuildData()"
"\n\texec('from '+re.sub('SMESH$','GEOM',thisModule)+' import * ')"
- "\n\tSMESH_RebuildData( salome.myStudy )";
+ "\n\tSMESH_RebuildData()";
}
anUpdatedScript += "\n";
* GetNewPythonLines
*/
//=============================================================================
-TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines (int theStudyID)
+TCollection_AsciiString SMESH_Gen_i::GetNewPythonLines()
{
TCollection_AsciiString aScript;
// Dump trace of API methods calls
- if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
- Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScripts[theStudyID];
+ if (!myPythonScript.IsNull()) {
+ Handle(TColStd_HSequenceOfAsciiString) aPythonScript = myPythonScript;
Standard_Integer istr, aLen = aPythonScript->Length();
for (istr = 1; istr <= aLen; istr++) {
aScript += "\n";
* CleanPythonTrace
*/
//=============================================================================
-void SMESH_Gen_i::CleanPythonTrace (int theStudyID)
+void SMESH_Gen_i::CleanPythonTrace()
{
TCollection_AsciiString aScript;
// Clean trace of API methods calls
- if (myPythonScripts.find(theStudyID) != myPythonScripts.end()) {
- myPythonScripts[theStudyID]->Clear();
+ if (!myPythonScript.IsNull()) {
+ myPythonScript->Clear();
}
}
if ( theName != 0 )
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- if ( !aStudy->_is_nil() )
+ SALOMEDS::Study::ListOfSObject_var aList = SMESH_Gen_i::getStudyServant()->FindObjectByName( theName, "GEOM" );
+ if ( aList->length() > 0 )
{
- SALOMEDS::Study::ListOfSObject_var aList = aStudy->FindObjectByName( theName, "GEOM" );
- if ( aList->length() > 0 )
- {
- CORBA::Object_var anObj = aList[ 0 ]->GetObject();
- GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
- TopoDS_Shape shape = aSMESHGen->GeomObjectToShape( aGeomObj );
- SALOME::UnRegister( aList ); // UnRegister() objects in aList
- return shape;
- }
+ CORBA::Object_var anObj = aList[ 0 ]->GetObject();
+ GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( anObj );
+ TopoDS_Shape shape = aSMESHGen->GeomObjectToShape( aGeomObj );
+ SALOME::UnRegister( aList ); // UnRegister() objects in aList
+ return shape;
}
}
return TopoDS_Shape();
{
if ( theID && strlen( theID ) > 0 ) {
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
- if ( !aSObj->_is_nil() ) {
- CORBA::Object_var obj = aSObj->GetObject();
- GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
- return aSMESHGen->GeomObjectToShape( aGeomObj );
- }
+ SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
+ if ( !aSObj->_is_nil() ) {
+ CORBA::Object_var obj = aSObj->GetObject();
+ GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+ return aSMESHGen->GeomObjectToShape( aGeomObj );
}
}
return TopoDS_Shape();
// static std::string getShapeNameByID (const char* theID)
// {
// if ( theID && strlen( theID ) > 0 ) {
-// SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
-// SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
-// if ( !aStudy->_is_nil() ) {
-// SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
-// if ( !aSObj->_is_nil() ) {
-// CORBA::String_var name = aSObj->GetName();
-// return name.in();
-// }
+// SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID(theID);
+// if ( !aSObj->_is_nil() ) {
+// CORBA::String_var name = aSObj->GetName();
+// return name.in();
// }
// }
// return "";
}
else if ( strncmp( "0:", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
{
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID( myID.c_str() );
- if ( !aSObj->_is_nil() ) {
- CORBA::Object_var obj = aSObj->GetObject();
- SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
- }
+ SALOMEDS::SObject_wrap aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( myID.c_str() );
+ if ( !aSObj->_is_nil() ) {
+ CORBA::Object_var obj = aSObj->GetObject();
+ SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
}
}
else if ( !myID.empty() ) // persistent mode
{
// search for a group in a current study
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- if ( StudyContext* sc = aSMESHGen->GetCurrentStudyContext() )
+ if ( StudyContext* sc = aSMESHGen->GetStudyContext() )
{
int id = 1;
std::string ior;
}
case SMESH::ConnectedElements::VERTEX: // get a VERTEX by its entry /////////////////
{
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
- if ( study->_is_nil() )
- THROW_SALOME_CORBA_EXCEPTION
- ( "ConnectedElements_i::SetThreshold(): NULL current study", SALOME::BAD_PARAM );
- SALOMEDS::SObject_wrap sobj = study->FindObjectID( threshold );
+ SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( threshold );
if ( sobj->_is_nil() )
THROW_SALOME_CORBA_EXCEPTION
( "ConnectedElements_i::SetThreshold(): invalid vertex study entry", SALOME::BAD_PARAM );
_thisObj = this ;
_id = myPoa->activate_object( _thisObj );
+ myStudyContext = new StudyContext;
+
myIsEmbeddedMode = false;
+ myIsEnablePublish = true;
myShapeReader = NULL; // shape reader
mySMESHGen = this;
myIsHistoricalPythonDump = true;
myHypCreatorMap.clear();
// Clear study contexts data
- map<int, StudyContext*>::iterator it;
- for ( it = myStudyContextMap.begin(); it != myStudyContextMap.end(); ++it ) {
- delete it->second;
- }
- myStudyContextMap.clear();
+ delete myStudyContext;
+
// delete shape reader
if ( myShapeReader )
delete myShapeReader;
getHypothesisCreator(theHypName, theLibName, aPlatformLibName);
// create a new hypothesis object, store its ref. in studyContext
- myHypothesis_i = aCreator->Create(myPoa, GetCurrentStudyID(), &myGen);
+ myHypothesis_i = aCreator->Create(myPoa, &myGen);
if (myHypothesis_i)
{
myHypothesis_i->SetLibName( aPlatformLibName.c_str() ); // for persistency assurance
// Get or create the GEOM_Client instance
try {
// create a new mesh object servant, store it in a map in study context
- SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this, GetCurrentStudyID() );
+ SMESH_Mesh_i* meshServant = new SMESH_Mesh_i( GetPOA(), this );
// create a new mesh object
if(MYDEBUG) MESSAGE("myIsEmbeddedMode " << myIsEmbeddedMode);
- meshServant->SetImpl( myGen.CreateMesh( GetCurrentStudyID(), myIsEmbeddedMode ));
+ meshServant->SetImpl( myGen.CreateMesh( myIsEmbeddedMode ));
// activate the CORBA servant of Mesh
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( meshServant->_this() );
//=============================================================================
/*!
- * SMESH_Gen_i::SetCurrentStudy
+ * SMESH_Gen_i::SetEnablePublish
*
- * Set current study
+ * Set enable publishing in the study
*/
//=============================================================================
-
-void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
+void SMESH_Gen_i::SetEnablePublish( CORBA::Boolean theIsEnablePublish )
{
- setCurrentStudy( theStudy );
+ myIsEnablePublish = theIsEnablePublish;
}
-void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
- bool theStudyIsBeingClosed)
+//=============================================================================
+/*!
+ * SMESH_Gen_i::IsEnablePublish
+ *
+ * Check enable publishing
+ */
+//=============================================================================
+
+CORBA::Boolean SMESH_Gen_i::IsEnablePublish()
{
- int curStudyId = GetCurrentStudyID();
- myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
- // create study context, if it doesn't exist and set current study
- int studyId = GetCurrentStudyID();
- if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() )
- myStudyContextMap[ studyId ] = new StudyContext;
-
- // myCurrentStudy may be nil
- if ( !theStudyIsBeingClosed && !CORBA::is_nil( myCurrentStudy ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
- SALOMEDS::SComponent_wrap GEOM_var = myCurrentStudy->FindComponent( "GEOM" );
- if( !GEOM_var->_is_nil() )
- aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
- // NPAL16168, issue 0020210
- // Let meshes update their data depending on GEOM groups that could change
- if ( curStudyId != studyId )
- {
- CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() );
- if ( !me->_is_nil() ) {
- SALOMEDS::ChildIterator_wrap anIter = myCurrentStudy->NewChildIterator( me );
- for ( ; anIter->More(); anIter->Next() ) {
- SALOMEDS::SObject_wrap so = anIter->Value();
- CORBA::Object_var ior = SObjectToObject( so );
- if ( SMESH_Mesh_i* mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
- mesh->CheckGeomModif();
- }
- }
- }
- }
+ return myIsEnablePublish;
}
//=============================================================================
/*!
- * SMESH_Gen_i::GetCurrentStudy
+ * SMESH_Gen_i::UpdateStudy
*
- * Get current study
+ * Update study (needed at switching GEOM->SMESH)
*/
//=============================================================================
-SALOMEDS::Study_ptr SMESH_Gen_i::GetCurrentStudy()
+void SMESH_Gen_i::UpdateStudy()
{
- if(MYDEBUG) MESSAGE( "SMESH_Gen_i::GetCurrentStudy: study Id = " << GetCurrentStudyID() );
- if ( GetCurrentStudyID() < 0 )
- return SALOMEDS::Study::_nil();
- return SALOMEDS::Study::_duplicate( myCurrentStudy );
+ if ( !myStudyContext )
+ myStudyContext = new StudyContext;
+
+ SALOMEDS::Study_var aStudy = getStudyServant();
+ if ( !CORBA::is_nil( aStudy ) ) {
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::SComponent_wrap GEOM_var = aStudy->FindComponent( "GEOM" );
+ if( !GEOM_var->_is_nil() )
+ aStudyBuilder->LoadWith( GEOM_var, GetGeomEngine() );
+ // NPAL16168, issue 0020210
+ // Let meshes update their data depending on GEOM groups that could change
+ CORBA::String_var compDataType = ComponentDataType();
+ SALOMEDS::SComponent_wrap me = aStudy->FindComponent( compDataType.in() );
+ if ( !me->_is_nil() ) {
+ SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( me );
+ for ( ; anIter->More(); anIter->Next() ) {
+ SALOMEDS::SObject_wrap so = anIter->Value();
+ CORBA::Object_var ior = SObjectToObject( so );
+ if ( SMESH_Mesh_i* mesh = SMESH::DownCast<SMESH_Mesh_i*>( ior ))
+ mesh->CheckGeomModif();
+ }
+ }
+ }
}
//=============================================================================
/*!
- * SMESH_Gen_i::GetCurrentStudyContext
+ * SMESH_Gen_i::GetStudyContext
*
- * Get current study context
+ * Get study context
*/
//=============================================================================
-StudyContext* SMESH_Gen_i::GetCurrentStudyContext()
+StudyContext* SMESH_Gen_i::GetStudyContext()
{
- if ( !CORBA::is_nil( myCurrentStudy ) &&
- myStudyContextMap.find( GetCurrentStudyID() ) != myStudyContextMap.end() )
- return myStudyContextMap[ myCurrentStudy->StudyId() ];
- else
- return 0;
+ return myStudyContext;
}
//=============================================================================
// Publish hypothesis/algorithm in the study
if ( CanPublishInStudy( hyp ) ) {
- SALOMEDS::SObject_wrap aSO = PublishHypothesis( myCurrentStudy, hyp );
+ SALOMEDS::SObject_wrap aSO = PublishHypothesis( hyp );
if ( !aSO->_is_nil() ) {
// Update Python script
TPythonDump() << aSO << " = " << this << ".CreateHypothesis('"
SMESH::SMESH_Mesh_out theMesh,
GEOM::GEOM_Object_out theShape)
{
- if ( GetCurrentStudyID() < 0 || CORBA::is_nil( theHyp ))
+ if ( CORBA::is_nil( theHyp ))
return false;
// get Mesh component SO
CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SComponent_wrap comp = myCurrentStudy->FindComponent( compDataType.in() );
+ SALOMEDS::SComponent_wrap comp = getStudyServant()->FindComponent( compDataType.in() );
if ( CORBA::is_nil( comp ))
return false;
SMESH::SMESH_Mesh_var foundMesh;
TopoDS_Shape foundShape;
bool isSole = true;
- SALOMEDS::ChildIterator_wrap meshIter = myCurrentStudy->NewChildIterator( comp );
+ SALOMEDS::ChildIterator_wrap meshIter = getStudyServant()->NewChildIterator( comp );
for ( ; meshIter->More() && isSole; meshIter->Next() )
{
SALOMEDS::SObject_wrap curSO = meshIter->Value();
// publish mesh in the study
if ( CanPublishInStudy( mesh ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
+ SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
// publish mesh in the study
if ( CanPublishInStudy( mesh ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, mesh.in() );
+ SALOMEDS::SObject_wrap aSO = PublishMesh( mesh.in() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
string aFileName;
// publish mesh in the study
if ( CanPublishInStudy( aMesh ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- SALOMEDS::SObject_wrap aSO = PublishMesh( myCurrentStudy, aMesh.in(), aFileName.c_str() );
+ SALOMEDS::SObject_wrap aSO = PublishMesh( aMesh.in(), aFileName.c_str() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
if (theStatus == SMESH::DRS_OK) {
SALOMEDS::StudyBuilder_var aStudyBuilder;
- if ( GetCurrentStudyID() > -1 )
- {
- aStudyBuilder = myCurrentStudy->NewBuilder();
- aStudyBuilder->NewCommand(); // There is a transaction
- }
+ aStudyBuilder = getStudyServant()->NewBuilder();
+ aStudyBuilder->NewCommand(); // There is a transaction
+
aResult->length( aNames.size() );
int i = 0;
// little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV
// - as names of meshes are stored in MED file, we use them for data publishing
// - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data
- aSO = PublishMesh( myCurrentStudy, mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
+ aSO = PublishMesh( mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() );
// Python Dump
if ( !aSO->_is_nil() ) {
#endif
// publish mesh in the study
if ( CanPublishInStudy( aMesh ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- SALOMEDS::SObject_wrap aSO = PublishInStudy
- ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
+ SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
if (theStatus == SMESH::DRS_OK)
{
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
int i = 0;
// publish mesh in the study
SALOMEDS::SObject_wrap aSO;
if ( CanPublishInStudy( mesh ) )
- aSO = PublishMesh( myCurrentStudy, mesh.in(), meshName.c_str() );
+ aSO = PublishMesh( mesh.in(), meshName.c_str() );
// Python Dump
if ( !aSO->_is_nil() ) {
#endif
// publish mesh in the study
if ( CanPublishInStudy( aMesh ) ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
- SALOMEDS::SObject_wrap aSO = PublishInStudy
- ( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
+ SALOMEDS::SObject_wrap aSO = PublishInStudy( SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
SALOMEDS::SObject_ptr SMESH_Gen_i::GetAlgoSO(const ::SMESH_Algo* algo)
{
if ( algo ) {
- if ( !myCurrentStudy->_is_nil() ) {
+ SALOMEDS::Study_var aStudy = getStudyServant();
+ if ( !aStudy->_is_nil() ) {
// find algo in the study
CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SComponent_wrap father = myCurrentStudy->FindComponent( compDataType.in() );
+ SALOMEDS::SComponent_wrap father = aStudy->FindComponent( compDataType.in() );
if ( !father->_is_nil() ) {
- SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( father );
+ SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( father );
for ( ; itBig->More(); itBig->Next() ) {
SALOMEDS::SObject_wrap gotBranch = itBig->Value();
if ( gotBranch->Tag() == GetAlgorithmsRootTag() ) {
- SALOMEDS::ChildIterator_wrap algoIt = myCurrentStudy->NewChildIterator( gotBranch );
+ SALOMEDS::ChildIterator_wrap algoIt = aStudy->NewChildIterator( gotBranch );
for ( ; algoIt->More(); algoIt->Next() ) {
SALOMEDS::SObject_wrap algoSO = algoIt->Value();
CORBA::Object_var algoIOR = SObjectToObject( algoSO );
GEOM::GEOM_Gen_ptr geomGen = GetGeomEngine();
// try to find the corresponding SObject
- SALOMEDS::SObject_wrap SObj = ObjectToSObject( myCurrentStudy, geom.in() );
+ SALOMEDS::SObject_wrap SObj = ObjectToSObject( geom.in() );
if ( SObj->_is_nil() ) // submesh can be not found even if published
{
// try to find published submesh
GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
if ( !geom->IsMainShape() && list->length() == 1 ) {
- SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
+ SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
SALOMEDS::ChildIterator_wrap it;
if ( !mainSO->_is_nil() ) {
- it = myCurrentStudy->NewChildIterator( mainSO );
+ it = getStudyServant()->NewChildIterator( mainSO );
}
if ( !it->_is_nil() ) {
for ( it->InitEx(true); it->More(); it->Next() ) {
}
}
if ( SObj->_is_nil() ) // publish a new subshape
- SObj = geomGen->AddInStudy( myCurrentStudy, geom, theGeomName, mainShape );
+ SObj = geomGen->AddInStudy( geom, theGeomName, mainShape );
// return only published geometry
if ( !SObj->_is_nil() ) {
GEOM::GEOM_Object_var geom = ShapeToGeomObject( meshDS->IndexToShape( shapeID ));
if ( geom->_is_nil() ) {
// try to find a published sub-shape
- SALOMEDS::SObject_wrap mainSO = ObjectToSObject( myCurrentStudy, mainShape );
+ SALOMEDS::SObject_wrap mainSO = ObjectToSObject( mainShape );
SALOMEDS::ChildIterator_wrap it;
if ( !mainSO->_is_nil() ) {
- it = myCurrentStudy->NewChildIterator( mainSO );
+ it = getStudyServant()->NewChildIterator( mainSO );
}
if ( !it->_is_nil() ) {
for ( it->InitEx(true); it->More(); it->Next() ) {
}
if ( geom->_is_nil() ) {
// explode
- GEOM::GEOM_IShapesOperations_wrap op =
- geomGen->GetIShapesOperations( GetCurrentStudyID() );
+ GEOM::GEOM_IShapesOperations_wrap op = geomGen->GetIShapesOperations();
if ( !op->_is_nil() )
geom = op->GetSubShape( mainShape, shapeID );
}
int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
}
string groupName = "Gr";
- SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, theMeshesArray[i] );
+ SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( theMeshesArray[i] );
if ( aMeshSObj ) {
CORBA::String_var name = aMeshSObj->GetName();
groupName += name;
}
// IPAL21468 Change icon of compound because it need not be computed.
- SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( myCurrentStudy, aNewMesh );
+ SALOMEDS::SObject_wrap aMeshSObj = ObjectToSObject( aNewMesh );
SetPixMap( aMeshSObj, "ICON_SMESH_TREE_MESH" );
if (aNewMeshDS)
SMESH_Mesh_i* newMesh_i = SMESH::DownCast<SMESH_Mesh_i*>( newMesh );
if ( !newMesh_i )
THROW_SALOME_CORBA_EXCEPTION( "can't create a mesh", SALOME::INTERNAL_ERROR );
- SALOMEDS::SObject_wrap meshSO = ObjectToSObject(myCurrentStudy, newMesh );
+ SALOMEDS::SObject_wrap meshSO = ObjectToSObject( newMesh );
if ( !meshSO->_is_nil() )
{
SetName( meshSO, meshName, "Mesh" );
const char* theURL,
bool isMultiFile )
{
- // ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() )
- // san -- in case <myCurrentStudy> differs from theComponent's study,
- // use that of the component
- if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
- SetCurrentStudy( theComponent->GetStudy() );
+ if (!myStudyContext)
+ UpdateStudy();
// Store study contents as a set of python commands
- SavePython(myCurrentStudy);
+ SavePython();
- StudyContext* myStudyContext = GetCurrentStudyContext();
+ SALOMEDS::Study_var aStudy = getStudyServant();
// Declare a byte stream
SALOMEDS::TMPFile_var aStreamFile;
( isMultiFile ) ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str();
// Create a sequence of files processed
- SALOMEDS::ListOfFileNames_var aFileSeq = new SALOMEDS::ListOfFileNames;
- aFileSeq->length( NUM_TMP_FILES );
+ SALOMEDS_Tool::ListOfFiles aFileSeq;
+ aFileSeq.reserve( NUM_TMP_FILES );
TCollection_AsciiString aStudyName( "" );
if ( isMultiFile )
- aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( myCurrentStudy->URL() ).c_str() );
+ aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( aStudy->URL() ).c_str() );
// Set names of temporary files
TCollection_AsciiString filename =
aStudyName + TCollection_AsciiString( "_SMESH.hdf" ); // for SMESH data itself
TCollection_AsciiString meshfile =
aStudyName + TCollection_AsciiString( "_SMESH_Mesh.med" ); // for mesh data to be stored in MED file
- aFileSeq[ 0 ] = CORBA::string_dup( filename.ToCString() );
- aFileSeq[ 1 ] = CORBA::string_dup( meshfile.ToCString() );
+ aFileSeq.push_back(CORBA::string_dup( filename.ToCString() ));
+ aFileSeq.push_back(CORBA::string_dup( meshfile.ToCString() ));
filename = tmpDir + filename;
meshfile = tmpDir + meshfile;
// SetStoreName() to groups before storing hypotheses to let them refer to
// groups using "store name", which is "Group <group_persistent_id>"
{
- SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
+ SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
for ( ; itBig->More(); itBig->Next() ) {
SALOMEDS::SObject_wrap gotBranch = itBig->Value();
if ( gotBranch->Tag() > GetAlgorithmsRootTag() ) {
aFile->CreateOnDisk();
// --> iterator for top-level objects
- SALOMEDS::ChildIterator_wrap itBig = myCurrentStudy->NewChildIterator( theComponent );
+ SALOMEDS::ChildIterator_wrap itBig = aStudy->NewChildIterator( theComponent );
for ( ; itBig->More(); itBig->Next() ) {
SALOMEDS::SObject_wrap gotBranch = itBig->Value();
aTopGroup->CreateOnDisk();
// iterator for all hypotheses
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySObject = it->Value();
CORBA::Object_var anObject = SObjectToObject( mySObject );
aTopGroup->CreateOnDisk();
// iterator for all algorithms
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( gotBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( gotBranch );
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySObject = it->Value();
CORBA::Object_var anObject = SObjectToObject( mySObject );
SALOMEDS::SObject_wrap myHypBranch;
found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
if ( found && !shapeRefFound && hasShape) { // remove applied hyps
- myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
+ aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
}
if ( found && (shapeRefFound || !hasShape) ) {
aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup );
aGroup->CreateOnDisk();
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myHypBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myHypBranch );
int hypNb = 0;
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySObject = it->Value();
found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(),
myAlgoBranch.inout() );
if ( found && !shapeRefFound && hasShape) { // remove applied algos
- myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
+ aStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
}
if ( found && (shapeRefFound || !hasShape)) {
aGroup = new HDFgroup( "Applied Algorithms", aTopGroup );
aGroup->CreateOnDisk();
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myAlgoBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myAlgoBranch );
int algoNb = 0;
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySObject = it->Value();
{
bool hasShapeRef = false;
SALOMEDS::ChildIterator_wrap itSM =
- myCurrentStudy->NewChildIterator( mySubmeshBranch );
+ aStudy->NewChildIterator( mySubmeshBranch );
for ( ; itSM->More(); itSM->Next() ) {
SALOMEDS::SObject_wrap mySubRef, myShape, mySObject = itSM->Value();
if ( mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef.inout() ))
}
}
}
- myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
+ aStudy->NewBuilder()->RemoveObjectWithChildren( mySObject );
}
} // loop on submeshes of a type
if ( !shapeRefFound || !hasShapeRef ) { // remove the whole submeshes branch
- myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
+ aStudy->NewBuilder()->RemoveObjectWithChildren( mySubmeshBranch );
found = false;
}
} // end check if there is shape reference in submeshes
aGroup->CreateOnDisk();
// iterator for all submeshes of given type
- SALOMEDS::ChildIterator_wrap itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch );
+ SALOMEDS::ChildIterator_wrap itSM = aStudy->NewChildIterator( mySubmeshBranch );
for ( ; itSM->More(); itSM->Next() ) {
SALOMEDS::SObject_wrap mySObject = itSM->Value();
CORBA::Object_var anSubObject = SObjectToObject( mySObject );
aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup );
aSubSubGroup->CreateOnDisk();
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( mySubHypBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( mySubHypBranch );
int hypNb = 0;
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySubSObject = it->Value();
aSubSubGroup->CreateOnDisk();
SALOMEDS::ChildIterator_wrap it =
- myCurrentStudy->NewChildIterator( mySubAlgoBranch );
+ aStudy->NewChildIterator( mySubAlgoBranch );
int algoNb = 0;
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySubSObject = it->Value();
aGroup = new HDFgroup( name_group, aTopGroup );
aGroup->CreateOnDisk();
- SALOMEDS::ChildIterator_wrap it = myCurrentStudy->NewChildIterator( myGroupsBranch );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( myGroupsBranch );
for ( ; it->More(); it->Next() ) {
SALOMEDS::SObject_wrap mySObject = it->Value();
CORBA::Object_var aSubObject = SObjectToObject( mySObject );
delete aFile;
// Convert temporary files to stream
- aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq.in(), isMultiFile );
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream( tmpDir.ToCString(), aFileSeq, isMultiFile );
// Remove temporary files and directory
if ( !isMultiFile )
- SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
+ SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
return aStreamFile._retn();
}
if ( theCompRoot->_is_nil() )
return;
- SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theCompRoot->GetStudy() );
- if ( aStudy->_is_nil() )
- return;
-
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->LoadWith( theCompRoot, GetGeomEngine() );
}
const char* theURL,
bool isMultiFile )
{
- if ( theComponent->GetStudy()->StudyId() != GetCurrentStudyID() )
- SetCurrentStudy( theComponent->GetStudy() );
-
+ if (!myStudyContext)
+ UpdateStudy();
+ SALOMEDS::Study_var aStudy = getStudyServant();
/* if( !theComponent->_is_nil() )
{
- //SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theComponent->GetStudy() );
- if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
- loadGeomData( myCurrentStudy->FindComponent( "GEOM" ) );
+ if( !aStudy->FindComponent( "GEOM" )->_is_nil() )
+ loadGeomData( aStudy->FindComponent( "GEOM" ) );
}*/
- StudyContext* myStudyContext = GetCurrentStudyContext();
-
// Get temporary files location
TCollection_AsciiString tmpDir =
( char* )( isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir().c_str() );
// Convert the stream into sequence of files to process
- SALOMEDS::ListOfFileNames_var aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
- tmpDir.ToCString(),
- isMultiFile );
+ SALOMEDS_Tool::ListOfFiles aFileSeq = SALOMEDS_Tool::PutStreamToFiles( theStream,
+ tmpDir.ToCString(),
+ isMultiFile );
TCollection_AsciiString aStudyName( "" );
if ( isMultiFile ) {
- CORBA::String_var url = myCurrentStudy->URL();
+ CORBA::String_var url = aStudy->URL();
aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( url.in() ).c_str();
}
// Set names of temporary files
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
if ( strlen( refFromFile ) > 0 ) {
- SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
+ SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
// Make sure GEOM data are loaded first
//loadGeomData( shapeSO->GetFatherComponent() );
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
// san - it is impossible to recover applied algorithms using their entries within Load() method
- //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
+ //SALOMEDS::SObject_wrap hypSO = aStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
delete [] refFromFile;
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
// san - it is impossible to recover applied hypotheses using their entries within Load() method
- //SALOMEDS::SObject_wrap hypSO = myCurrentStudy->FindObjectID( refFromFile );
+ //SALOMEDS::SObject_wrap hypSO = myStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
delete [] refFromFile;
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
if ( strlen( refFromFile ) > 0 ) {
- SALOMEDS::SObject_wrap subShapeSO = myCurrentStudy->FindObjectID( refFromFile );
+ SALOMEDS::SObject_wrap subShapeSO = aStudy->FindObjectID( refFromFile );
CORBA::Object_var subShapeObject = SObjectToObject( subShapeSO );
if ( !CORBA::is_nil( subShapeObject ) ) {
aSubShapeObject = GEOM::GEOM_Object::_narrow( subShapeObject );
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
if ( strlen( refFromFile ) > 0 ) {
- SALOMEDS::SObject_wrap shapeSO = myCurrentStudy->FindObjectID( refFromFile );
+ SALOMEDS::SObject_wrap shapeSO = aStudy->FindObjectID( refFromFile );
CORBA::Object_var shapeObject = SObjectToObject( shapeSO );
if ( !CORBA::is_nil( shapeObject ) ) {
aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject );
SMESH_File meshFile( meshfile.ToCString() );
if ( !meshFile ) // no meshfile exists
{
- SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq.in(), true );
+ SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.ToCString(), aFileSeq, true );
}
else
{
// creation of tree nodes for all data objects in the study
// to support tree representation customization and drag-n-drop:
- SALOMEDS::Study_var study = theComponent->GetStudy();
- SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = study->GetUseCaseBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
if ( !useCaseBuilder->IsUseCaseNode( theComponent ) ) {
useCaseBuilder->SetRootCurrent();
useCaseBuilder->Append( theComponent ); // component object is added as the top level item
- SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent );
+ SALOMEDS::ChildIterator_wrap it = aStudy->NewChildIterator( theComponent );
for (it->InitEx(true); it->More(); it->Next()) {
useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() );
}
{
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
- // set correct current study
- SALOMEDS::Study_var study = theComponent->GetStudy();
- if ( study->StudyId() != GetCurrentStudyID())
- setCurrentStudy( study, /*IsBeingClosed=*/true );
-
// Clear study contexts data
- int studyId = GetCurrentStudyID();
- if ( myStudyContextMap.find( studyId ) != myStudyContextMap.end() ) {
- delete myStudyContextMap[ studyId ];
- myStudyContextMap.erase( studyId );
- }
+ delete myStudyContext;
+ myStudyContext = 0;
// remove the tmp files meshes are loaded from
SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
- myCurrentStudy = SALOMEDS::Study::_nil();
return;
}
CORBA::Boolean /*isASCII*/ )
{
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
- StudyContext* myStudyContext = GetCurrentStudyContext();
if ( myStudyContext && strcmp( IORString, "" ) != 0 ) {
int anId = myStudyContext->findId( IORString );
CORBA::Boolean /*isASCII*/ )
{
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LocalPersistentIDToIOR(): id = " << aLocalPersistentID );
- StudyContext* myStudyContext = GetCurrentStudyContext();
if ( myStudyContext && strcmp( aLocalPersistentID, "" ) != 0 ) {
int anId = atoi( aLocalPersistentID );
int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
{
- StudyContext* myStudyContext = GetCurrentStudyContext();
if ( myStudyContext && !CORBA::is_nil( theObject )) {
CORBA::String_var iorString = GetORB()->object_to_string( theObject );
return myStudyContext->addObject( string( iorString.in() ) );
CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
- StudyContext* myStudyContext = GetCurrentStudyContext();
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
return myStudyContext->findId( iorString );
{
if ( theIOR && strcmp( theIOR, "" ) ) {
CORBA::Object_var anObject = GetORB()->string_to_object( theIOR );
- SALOMEDS::SObject_wrap aSO = ObjectToSObject( myCurrentStudy, anObject );
+ SALOMEDS::SObject_wrap aSO = ObjectToSObject( anObject );
if ( !aSO->_is_nil() ) {
SetName( aSO, theName );
}
}
}
-int SMESH_Gen_i::GetCurrentStudyID()
-{
- return myCurrentStudy->_is_nil() || myCurrentStudy->_non_existent() ? -1 : myCurrentStudy->StudyId();
-}
-
// Version information
char* SMESH_Gen_i::getVersion()
{
{
if ( CORBA::is_nil( where ) ) return;
- SALOMEDS::Study_var study = where->GetStudy();
- SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
- SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
+ SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder();
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
SALOMEDS::SComponent_var father = where->GetFatherComponent();
std::string dataType = father->ComponentDataType();
if ( dataType != "SMESH" ) return; // not a SMESH component
// Get CORBA object corresponding to the SALOMEDS::SObject
static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
// Get the SALOMEDS::SObject corresponding to a CORBA object
- static SALOMEDS::SObject_ptr ObjectToSObject(SALOMEDS::Study_ptr theStudy,
- CORBA::Object_ptr theObject);
+ static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
+ // Get the SALOMEDS::Study from naming service
+ static SALOMEDS::Study_ptr getStudyServant();
// Get GEOM Object correspoding to TopoDS_Shape
GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
// Get TopoDS_Shape correspoding to GEOM_Object
//GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
- // Set current study
+ // Set embedded mode
void SetEmbeddedMode( CORBA::Boolean theMode );
- // Get current study
+ // Check embedded mode
CORBA::Boolean IsEmbeddedMode();
- // Set current study
- void SetCurrentStudy( SALOMEDS::Study_ptr theStudy );
- // Get current study
- SALOMEDS::Study_ptr GetCurrentStudy();
+ // Set enable publishing in the study
+ void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
+
+ // Check enable publishing
+ CORBA::Boolean IsEnablePublish();
+
+ // Update study
+ void UpdateStudy();
// Create hypothesis/algorothm of given type
SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
// Returns true if object can be published in the study
bool CanPublishInStudy( CORBA::Object_ptr theIOR );
// Publish object in the study
- SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+ SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject,
const char* theName )
throw ( SALOME::SALOME_Exception );
// Dump python
// ============
- virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+ virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript);
- void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
+ void AddToPythonScript (const TCollection_AsciiString& theString);
- void RemoveLastFromPythonScript (int theStudyID);
+ void RemoveLastFromPythonScript();
- void SavePython (SALOMEDS::Study_ptr theStudy);
+ void SavePython();
- TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy,
- Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+ TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
Resource_DataMapOfAsciiStringAsciiString& theNames,
bool isPublished,
bool isMultiFile,
bool& aValidScript,
TCollection_AsciiString& theSavedTrace);
- TCollection_AsciiString GetNewPythonLines (int theStudyID);
+ TCollection_AsciiString GetNewPythonLines();
- void CleanPythonTrace (int theStudyID);
+ void CleanPythonTrace();
// *****************************************
// Internal methods
static long GetBallElementsGroupsTag();
// publishing methods
- SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
- SALOMEDS::SObject_ptr PublishMesh (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ SALOMEDS::SComponent_ptr PublishComponent();
+ SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
const char* theName = 0);
- SALOMEDS::SObject_ptr PublishHypothesis (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Hypothesis_ptr theHyp,
+ SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
const char* theName = 0);
- SALOMEDS::SObject_ptr PublishSubMesh (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
SMESH::SMESH_subMesh_ptr theSubMesh,
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName = 0);
- SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
SMESH::SMESH_GroupBase_ptr theGroup,
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName = 0);
- bool AddHypothesisToShape(SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject,
SMESH::SMESH_Hypothesis_ptr theHyp);
- bool RemoveHypothesisFromShape(SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject,
SMESH::SMESH_Hypothesis_ptr theHyp);
- SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShape);
static void SetName(SALOMEDS::SObject_ptr theSObject,
const char* theName,
const char* thePixMap);
// Get study context
- StudyContext* GetCurrentStudyContext();
+ StudyContext* GetStudyContext();
// Register an object in a StudyContext; return object id
int RegisterObject(CORBA::Object_ptr theObject);
template<class TInterface>
typename TInterface::_var_type GetObjectByOldId( const int oldID )
{
- if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
+ if ( myStudyContext ) {
std::string ior = myStudyContext->getIORbyOldId( oldID );
if ( !ior.empty() )
return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
return TInterface::_nil();
}
- // Get current study ID
- int GetCurrentStudyID();
-
/*!
* \brief Find SObject for an algo
*/
const char* theCommandNameForPython,
const char* theFileNameForPython);
- void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
- bool theStudyIsBeingClosed=false);
-
std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
SMESH::ElementType theElemType,
TopoDS_Shape& aShape,
// hypotheses managing
std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
- std::map<int, StudyContext*> myStudyContextMap; // Map of study context objects
+ StudyContext* myStudyContext; // study context
GEOM_Client* myShapeReader; // Shape reader
- SALOMEDS::Study_var myCurrentStudy; // Current study
CORBA::Boolean myIsEmbeddedMode; // Current mode
+ CORBA::Boolean myIsEnablePublish; // Enable publishing
// Default color of groups
std::string myDefaultGroupColor;
bool myToForgetMeshDataOnHypModif;
// Dump Python: trace of API methods calls
- std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
- bool myIsHistoricalPythonDump;
- std::vector< int > myLastParamIndex;
- std::vector< std::string > myLastParameters;
- std::string myLastObj;
+ Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
+ bool myIsHistoricalPythonDump;
+ std::vector< int > myLastParamIndex;
+ std::vector< std::string > myLastParameters;
+ std::string myLastObj;
};
#include <Utils_ExceptHandlers.hxx>
#include <SALOMEDS_wrap.hxx>
#include <SALOMEDS_Attributes_wrap.hxx>
+#include <SALOME_KernelServices.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopoDS_Solid.hxx>
bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
{
- if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(myCurrentStudy));
- if( GetCurrentStudyID() < 0 )
- return false;
+ if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(getStudyServant()));
+ if( !myIsEnablePublish )
+ return false;
+
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
if( !aMesh->_is_nil() )
return true;
//purpose : Put a result into a SALOMEDS::SObject_wrap or call UnRegister()!
//=======================================================================
-SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(SALOMEDS::Study_ptr theStudy,
- CORBA::Object_ptr theObject)
+SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject)
{
SALOMEDS::SObject_wrap aSO;
- if ( !CORBA::is_nil( theStudy ) && !CORBA::is_nil( theObject ))
+ if ( !CORBA::is_nil( theObject ))
{
CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject );
- aSO = theStudy->FindObjectIOR( objStr.in() );
+ aSO = getStudyServant()->FindObjectIOR( objStr.in() );
}
return aSO._retn();
}
+//=======================================================================
+//function : GetStudyPtr
+//purpose : Get study from naming service
+//=======================================================================
+SALOMEDS::Study_ptr SMESH_Gen_i::getStudyServant()
+{
+ return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant());
+}
+
//=======================================================================
//function : objectToServant
//purpose :
//purpose :
//=======================================================================
-static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy,
- CORBA::Object_ptr theIOR,
+static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR,
SALOMEDS::SObject_ptr theFatherObject,
const int theTag = 0,
const char* thePixMap = 0,
const bool theSelectable = true)
{
- SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR );
+ SALOMEDS::Study_var theStudy = SMESH_Gen_i::getStudyServant();
+ SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theIOR );
SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
bool isNewSO = false, isInUseCaseTree = false;
const char* theDefaultName)
{
if ( !theSObject->_is_nil() ) {
- SALOMEDS::Study_var aStudy = theSObject->GetStudy();
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
{
if ( !theSObject->_is_nil() && thePixMap && strlen( thePixMap ))
{
- SALOMEDS::Study_var aStudy = theSObject->GetStudy();
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributePixMap" );
SALOMEDS::AttributePixMap_wrap aPMAttr = anAttr;
//purpose :
//=======================================================================
-static void addReference (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+static void addReference (SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theToObject,
int theTag = 0)
{
- SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theStudy, theToObject );
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
+ SALOMEDS::SObject_wrap aToObjSO = SMESH_Gen_i::ObjectToSObject( theToObject );
if ( !aToObjSO->_is_nil() && !theSObject->_is_nil() ) {
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::SObject_wrap aReferenceSO;
if ( !theTag ) {
// check if the reference to theToObject already exists
// and find a free label for the reference object
bool isReferred = false;
int tag = 1;
- SALOMEDS::ChildIterator_wrap anIter = theStudy->NewChildIterator( theSObject );
+ SALOMEDS::ChildIterator_wrap anIter = aStudy->NewChildIterator( theSObject );
for ( ; !isReferred && anIter->More(); anIter->Next(), ++tag ) {
SALOMEDS::SObject_wrap curSO = anIter->Value();
if ( curSO->ReferencedObject( aReferenceSO.inout() )) {
// add reference to the use case tree
// (to support tree representation customization and drag-n-drop)
- SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
SALOMEDS::UseCaseIterator_wrap useCaseIter = useCaseBuilder->GetUseCaseIterator(theSObject);
for ( ; useCaseIter->More(); useCaseIter->Next() )
{
*/
//=============================================================================
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theIOR,
const char* theName)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
SALOMEDS::SObject_wrap aSO;
- if ( CORBA::is_nil( theStudy ) || CORBA::is_nil( theIOR ))
+ if ( CORBA::is_nil( theIOR ))
return aSO._retn();
if(MYDEBUG) MESSAGE("PublishInStudy");
// Publishing a mesh
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( theIOR );
if( !aMesh->_is_nil() )
- aSO = PublishMesh( theStudy, aMesh, theName );
+ aSO = PublishMesh( aMesh, theName );
// Publishing a sub-mesh
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( theIOR );
if( aSO->_is_nil() && !aSubMesh->_is_nil() ) {
GEOM::GEOM_Object_var aShapeObject = aSubMesh->GetSubShape();
aMesh = aSubMesh->GetFather();
- aSO = PublishSubMesh( theStudy, aMesh, aSubMesh, aShapeObject, theName );
+ aSO = PublishSubMesh( aMesh, aSubMesh, aShapeObject, theName );
}
// Publishing a hypothesis or algorithm
SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( theIOR );
if ( aSO->_is_nil() && !aHyp->_is_nil() )
- aSO = PublishHypothesis( theStudy, aHyp );
+ aSO = PublishHypothesis( aHyp );
// Publishing a group
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(theIOR);
if ( aSO->_is_nil() && !aGroup->_is_nil() ) {
GEOM::GEOM_Object_var aShapeObject;
aMesh = aGroup->GetMesh();
- aSO = PublishGroup( theStudy, aMesh, aGroup, aShapeObject, theName );
+ aSO = PublishGroup( aMesh, aGroup, aShapeObject, theName );
}
if(MYDEBUG) MESSAGE("PublishInStudy_END");
//purpose :
//=======================================================================
-SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent(SALOMEDS::Study_ptr theStudy)
+SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
{
- if ( CORBA::is_nil( theStudy ))
- return SALOMEDS::SComponent::_nil();
if(MYDEBUG) MESSAGE("PublishComponent");
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
- SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
CORBA::String_var compDataType = ComponentDataType();
- SALOMEDS::SComponent_wrap father = theStudy->FindComponent( compDataType.in() );
+ SALOMEDS::SComponent_wrap father = getStudyServant()->FindComponent( compDataType.in() );
if ( !CORBA::is_nil( father ) ) {
// check that the component is added to the use case browser
if ( !useCaseBuilder->IsUseCaseNode( father ) ) {
//purpose :
//=======================================================================
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
const char* theName)
{
- if ( CORBA::is_nil( theStudy ) ||
- CORBA::is_nil( theMesh ))
+ if ( CORBA::is_nil( theMesh ))
return SALOMEDS::SComponent::_nil();
if(MYDEBUG) MESSAGE("PublishMesh--IN");
// find or publish a mesh
- SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+ SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
if ( aMeshSO->_is_nil() )
{
- SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
+ SALOMEDS::SComponent_wrap father = PublishComponent();
if ( father->_is_nil() )
return aMeshSO._retn();
else
aTag++;
- aMeshSO = publish (theStudy, theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
+ aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" );
if ( aMeshSO->_is_nil() )
return aMeshSO._retn();
}
GEOM::GEOM_Object_var aShapeObject = theMesh->GetShapeToMesh();
if ( !CORBA::is_nil( aShapeObject )) {
- addReference( theStudy, aMeshSO, aShapeObject, GetRefOnShapeTag() );
+ addReference( aMeshSO, aShapeObject, GetRefOnShapeTag() );
// Publish global hypotheses
for ( CORBA::ULong i = 0; i < hypList->length(); i++ )
{
SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
- SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
- AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
+ SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
+ AddHypothesisToShape( theMesh, aShapeObject, aHyp );
}
}
SMESH::SMESH_subMesh_ptr aSubMesh = (*subIt).second->_this();
if ( !CORBA::is_nil( aSubMesh )) {
aShapeObject = aSubMesh->GetSubShape();
- SALOMEDS::SObject_wrap( PublishSubMesh( theStudy, theMesh, aSubMesh, aShapeObject ));
+ SALOMEDS::SObject_wrap( PublishSubMesh( theMesh, aSubMesh, aShapeObject ));
}
}
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGroup );
if ( !aGeomGroup->_is_nil() )
aShapeObj = aGeomGroup->GetShape();
- SALOMEDS::SObject_wrap( PublishGroup( theStudy, theMesh, aGroup, aShapeObj ));
+ SALOMEDS::SObject_wrap( PublishGroup( theMesh, aGroup, aShapeObj ));
}
}
//purpose :
//=======================================================================
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
SMESH::SMESH_subMesh_ptr theSubMesh,
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName)
{
- if (theStudy->_is_nil() || theMesh->_is_nil() ||
- theSubMesh->_is_nil() || theShapeObject->_is_nil() )
+ if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() )
return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theStudy, theSubMesh );
+ SALOMEDS::SObject_wrap aSubMeshSO = ObjectToSObject( theSubMesh );
if ( aSubMeshSO->_is_nil() )
{
- SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+ SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
if ( aMeshSO->_is_nil() ) {
- aMeshSO = PublishMesh( theStudy, theMesh );
+ aMeshSO = PublishMesh( theMesh );
if ( aMeshSO->_is_nil())
return SALOMEDS::SObject::_nil();
}
}
// Find or create submesh root
- SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
- aMeshSO, aRootTag, 0, false );
+ SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
+ aMeshSO, aRootTag, 0, false );
if ( aRootSO->_is_nil() )
return aSubMeshSO._retn();
SMESH::array_of_ElementType_var elemTypes = theSubMesh->GetTypes();
const int isEmpty = ( elemTypes->length() == 0 );
const char* pm[2] = { "ICON_SMESH_TREE_MESH", "ICON_SMESH_TREE_MESH_WARN" };
- aSubMeshSO = publish (theStudy, theSubMesh, aRootSO, 0, pm[isEmpty] );
+ aSubMeshSO = publish ( theSubMesh, aRootSO, 0, pm[isEmpty] );
if ( aSubMeshSO->_is_nil() )
return aSubMeshSO._retn();
}
// Add reference to theShapeObject
- addReference( theStudy, aSubMeshSO, theShapeObject, 1 );
+ addReference( aSubMeshSO, theShapeObject, 1 );
// Publish hypothesis
SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( theShapeObject );
for ( CORBA::ULong i = 0; i < hypList->length(); i++ ) {
SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
- SALOMEDS::SObject_wrap so = PublishHypothesis( theStudy, aHyp );
- AddHypothesisToShape( theStudy, theMesh, theShapeObject, aHyp );
+ SALOMEDS::SObject_wrap so = PublishHypothesis( aHyp );
+ AddHypothesisToShape( theMesh, theShapeObject, aHyp );
}
return aSubMeshSO._retn();
//purpose :
//=======================================================================
-SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
SMESH::SMESH_GroupBase_ptr theGroup,
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName)
{
- if (theStudy->_is_nil() || theMesh->_is_nil() || theGroup->_is_nil() )
+ if (theMesh->_is_nil() || theGroup->_is_nil() )
return SALOMEDS::SObject::_nil();
- SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theStudy, theGroup );
+ SALOMEDS::SObject_wrap aGroupSO = ObjectToSObject( theGroup );
if ( aGroupSO->_is_nil() )
{
- SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+ SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
if ( aMeshSO->_is_nil() ) {
- aMeshSO = PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), theMesh, "");
+ aMeshSO = PublishInStudy( SALOMEDS::SObject::_nil(), theMesh, "");
if ( aMeshSO->_is_nil())
return SALOMEDS::SObject::_nil();
}
long aRootTag = GetNodeGroupsTag() + aType - 1;
// Find or create groups root
- SALOMEDS::SObject_wrap aRootSO = publish (theStudy, CORBA::Object::_nil(),
- aMeshSO, aRootTag, 0, false );
+ SALOMEDS::SObject_wrap aRootSO = publish ( CORBA::Object::_nil(),
+ aMeshSO, aRootTag, 0, false );
if ( aRootSO->_is_nil() ) return SALOMEDS::SObject::_nil();
if ( aType < sizeof(aRootNames)/sizeof(char*) )
isEmpty = ( allElemTypes[i] != theGroup->GetType() );
}
}
- aGroupSO = publish (theStudy, theGroup, aRootSO, 0, pm[isEmpty].c_str() );
+ aGroupSO = publish ( theGroup, aRootSO, 0, pm[isEmpty].c_str() );
}
if ( aGroupSO->_is_nil() )
return aGroupSO._retn();
//Add reference to geometry
if ( !theShapeObject->_is_nil() )
- addReference( theStudy, aGroupSO, theShapeObject, 1 );
+ addReference( aGroupSO, theShapeObject, 1 );
return aGroupSO._retn();
}
//=======================================================================
SALOMEDS::SObject_ptr
- SMESH_Gen_i::PublishHypothesis (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Hypothesis_ptr theHyp,
+ SMESH_Gen_i::PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
const char* theName)
{
if(MYDEBUG) MESSAGE("PublishHypothesis")
- if (theStudy->_is_nil() || theHyp->_is_nil())
+ if (theHyp->_is_nil())
return SALOMEDS::SObject::_nil();
CORBA::String_var hypType = theHyp->GetName();
- SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
+ SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
if ( aHypSO->_is_nil() )
{
- SALOMEDS::SComponent_wrap father = PublishComponent( theStudy );
+ SALOMEDS::SComponent_wrap father = PublishComponent();
if ( father->_is_nil() )
return aHypSO._retn();
bool isAlgo = ( !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil() );
int aRootTag = isAlgo ? GetAlgorithmsRootTag() : GetHypothesisRootTag();
SALOMEDS::SObject_wrap aRootSO =
- publish (theStudy, CORBA::Object::_nil(),father, aRootTag,
+ publish (CORBA::Object::_nil(),father, aRootTag,
isAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
SetName( aRootSO, isAlgo ? "Algorithms" : "Hypotheses" );
string pluginName = myHypCreatorMap[ hypType.in() ]->GetModuleName();
if ( pluginName != "StdMeshers" )
aPmName = pluginName + "::" + aPmName;
- aHypSO = publish( theStudy, theHyp, aRootSO, 0, aPmName.c_str() );
+ aHypSO = publish( theHyp, aRootSO, 0, aPmName.c_str() );
}
SetName( aHypSO, theName, hypType.in() );
//=======================================================================
SALOMEDS::SObject_ptr
- SMESH_Gen_i::GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+ SMESH_Gen_i::GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShape)
{
if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape")
if ( !aShape.IsNull() && mesh_i && mesh_i->GetImpl().GetMeshDS() ) {
SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
if ( aShape.IsSame( meshDS->ShapeToMesh() ))
- aMeshOrSubMesh = ObjectToSObject( theStudy, theMesh );
+ aMeshOrSubMesh = ObjectToSObject( theMesh );
else {
int shapeID = meshDS->ShapeToIndex( aShape );
SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
if ( !aSubMesh->_is_nil() )
- aMeshOrSubMesh = ObjectToSObject( theStudy, aSubMesh );
+ aMeshOrSubMesh = ObjectToSObject( aSubMesh );
}
}
if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape--END")
//purpose :
//=======================================================================
-bool SMESH_Gen_i::AddHypothesisToShape(SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+bool SMESH_Gen_i::AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShape,
SMESH::SMESH_Hypothesis_ptr theHyp)
{
if(MYDEBUG) MESSAGE("AddHypothesisToShape")
- if (theStudy->_is_nil() || theMesh->_is_nil() ||
+ if (theMesh->_is_nil() ||
theHyp->_is_nil() || (theShape->_is_nil()
&& theMesh->HasShapeToMesh()) )
return false;
- SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theStudy, theMesh );
+ SALOMEDS::SObject_wrap aMeshSO = ObjectToSObject( theMesh );
if ( aMeshSO->_is_nil() )
- aMeshSO = PublishMesh( theStudy, theMesh );
- SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theStudy, theHyp );
+ aMeshSO = PublishMesh( theMesh );
+ SALOMEDS::SObject_wrap aHypSO = PublishHypothesis( theHyp );
if ( aMeshSO->_is_nil() || aHypSO->_is_nil())
return false;
// Find a mesh or submesh referring to theShape
SALOMEDS::SObject_wrap aMeshOrSubMesh =
- GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
+ GetMeshOrSubmeshByShape( theMesh, theShape );
if ( aMeshOrSubMesh->_is_nil() )
{
// publish submesh
SMESHDS_Mesh* meshDS = mesh_i->GetImpl().GetMeshDS();
int shapeID = meshDS->ShapeToIndex( aShape );
SMESH::SMESH_subMesh_var aSubMesh = mesh_i->getSubMesh(shapeID);
- aMeshOrSubMesh = PublishSubMesh( theStudy, theMesh, aSubMesh, theShape );
+ aMeshOrSubMesh = PublishSubMesh( theMesh, aSubMesh, theShape );
}
if ( aMeshOrSubMesh->_is_nil() )
return false;
//Find or Create Applied Hypothesis root
bool aIsAlgo = !SMESH::SMESH_Algo::_narrow( theHyp )->_is_nil();
SALOMEDS::SObject_wrap AHR =
- publish (theStudy, CORBA::Object::_nil(), aMeshOrSubMesh,
+ publish (CORBA::Object::_nil(), aMeshOrSubMesh,
aIsAlgo ? GetRefOnAppliedAlgorithmsTag() : GetRefOnAppliedHypothesisTag(),
aIsAlgo ? "ICON_SMESH_TREE_ALGO" : "ICON_SMESH_TREE_HYPO", false);
SetName( AHR, aIsAlgo ? "Applied algorithms" : "Applied hypotheses" );
- addReference( theStudy, AHR, theHyp );
+ addReference( AHR, theHyp );
if(MYDEBUG) MESSAGE("AddHypothesisToShape--END")
return true;
//purpose :
//=======================================================================
-bool SMESH_Gen_i::RemoveHypothesisFromShape(SALOMEDS::Study_ptr theStudy,
- SMESH::SMESH_Mesh_ptr theMesh,
+bool SMESH_Gen_i::RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShape,
SMESH::SMESH_Hypothesis_ptr theHyp)
{
- if (theStudy->_is_nil() || theMesh->_is_nil() ||
+ if (theMesh->_is_nil() ||
theHyp->_is_nil() || (theShape->_is_nil()
&& theMesh->HasShapeToMesh()))
return false;
- SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theStudy, theHyp );
+ SALOMEDS::SObject_wrap aHypSO = ObjectToSObject( theHyp );
if ( aHypSO->_is_nil() )
return false;
// Find a mesh or sub-mesh referring to theShape
SALOMEDS::SObject_wrap aMeshOrSubMesh =
- GetMeshOrSubmeshByShape( theStudy, theMesh, theShape );
+ GetMeshOrSubmeshByShape( theMesh, theShape );
if ( aMeshOrSubMesh->_is_nil() )
return false;
// Find and remove a reference to aHypSO
SALOMEDS::SObject_wrap aRef, anObj;
- SALOMEDS::ChildIterator_wrap it = theStudy->NewChildIterator( aMeshOrSubMesh );
+ SALOMEDS::ChildIterator_wrap it = getStudyServant()->NewChildIterator( aMeshOrSubMesh );
bool found = false;
for ( it->InitEx( true ); ( it->More() && !found ); it->Next() ) {
anObj = it->Value();
}
if ( found )
{
- SALOMEDS::StudyBuilder_var builder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var builder = getStudyServant()->NewBuilder();
builder->RemoveObject( anObj );
}
}
void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters)
{
- SALOMEDS::Study_var aStudy = GetCurrentStudy();
- if ( aStudy->_is_nil() )
- return;
-
// find variable names within theParameters
myLastObj.clear();
if ( prevPos < pos )
{
string val( theParameters + prevPos, theParameters + pos );
- if ( !aStudy->IsVariable( val.c_str() ))
+ if ( !getStudyServant()->IsVariable( val.c_str() ))
val.clear();
myLastParameters.push_back( val );
nbVars += (! myLastParameters.back().empty() );
// (2) indices of found variables in myLastParamIndex.
// remember theObject
- SALOMEDS::SObject_wrap aSObj = ObjectToSObject(aStudy,theObject);
+ SALOMEDS::SObject_wrap aSObj = ObjectToSObject(theObject);
if ( aSObj->_is_nil() )
return;
CORBA::String_var anObjEntry = aSObj->GetID();
myLastObj = anObjEntry.in();
// get a string of variable names
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
std::vector< std::string > SMESH_Gen_i::GetAllParameters(const std::string& theObjectEntry) const
{
std::vector< std::string > varNames;
- if ( myCurrentStudy->_is_nil() )
- return varNames;
- SALOMEDS::SObject_wrap aSObj = myCurrentStudy->FindObjectID( theObjectEntry.c_str() );
- if ( myCurrentStudy->_is_nil() )
- return varNames;
+ SALOMEDS::SObject_wrap aSObj = getStudyServant()->FindObjectID( theObjectEntry.c_str() );
// get a string of variable names
- SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( aSObj, "AttributeString" );
SALOMEDS::AttributeString_wrap aStringAttr = anAttr;
// //const char* aParameters = theParameters;
// // const char* aParameters = CORBA::string_dup(theParameters);
// TCollection_AsciiString anInputParams;
-// SALOMEDS::Study_var aStudy = GetCurrentStudy();
+// SALOMEDS::Study_var aStudy = getStudyServant();
// if( !aStudy->_is_nil() ) {
// // SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(theParameters);
// // for(int j=0;j<aSections->length();j++) {
{
CORBA::String_var aResult("");
- SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy, theObject );
+ SALOMEDS::SObject_wrap aSObj = ObjectToSObject( theObject );
if ( !aSObj->_is_nil() )
{
SALOMEDS::GenericAttribute_wrap attr;
// Update group name in a study
SMESH_Gen_i* aGen = myMeshServant->GetGen();
- SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy();
SMESH::SMESH_GroupBase_var aGrp = _this();
- SALOMEDS::SObject_var anSO = aGen->ObjectToSObject( aStudy, aGrp );
+ SALOMEDS::SObject_var anSO = aGen->ObjectToSObject( aGrp );
if ( !anSO->_is_nil() )
{
aGen->SetName( anSO, theName );
bool res = false;
if ( SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen())
{
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( study, _this());
+ SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( _this());
res = !SO->_is_nil();
}
return res;
public:
// Create a hypothesis
virtual SMESH_Hypothesis_i* Create(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl) = 0;
virtual ~GenericHypothesisCreator_i() {}
{
public:
virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
{
- return new T (thePOA, theStudyId, theGenImpl);
+ return new T (thePOA, theGenImpl);
};
};
SMDSAbs_ElementType myPreviewType; // type to show
//!< Constructor
TPreviewMesh(SMDSAbs_ElementType previewElements = SMDSAbs_All) {
- _isShapeToMesh = (_id =_studyId = 0);
+ _isShapeToMesh = (_id = 0);
_myMeshDS = new SMESHDS_Mesh( _id, true );
myPreviewType = previewElements;
}
{
SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
SMESH::SMESH_Mesh_var mesh = gen->CreateEmptyMesh();
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( study, mesh );
+ SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh );
gen->SetName( meshSO, theMeshName, "Mesh" );
gen->SetPixMap( meshSO, "ICON_SMESH_TREE_MESH_IMPORTED");
//=============================================================================
SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
- SMESH_Gen_i* gen_i,
- CORBA::Long studyId )
+ SMESH_Gen_i* gen_i )
: SALOME::GenericObj_i( thePOA )
{
_impl = NULL;
_gen_i = gen_i;
_id = _idGenerator++;
- _studyId = studyId;
_editor = NULL;
_previewEditor = NULL;
_preMeshInfo = NULL;
for ( ; data != _geomGroupData.end(); ++data )
if ( data->_smeshObject->_is_equivalent( _this() ))
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- if ( study->_is_nil() ) break;
- SALOMEDS::SObject_wrap so = study->FindObjectID( data->_groupEntry.c_str() );
+ SALOMEDS::SObject_wrap so = SMESH_Gen_i::getStudyServant()->FindObjectID( data->_groupEntry.c_str() );
CORBA::Object_var obj = _gen_i->SObjectToObject( so );
aShapeObj = GEOM::GEOM_Object::_narrow( obj );
break;
std::string name = _impl->STLToMesh( theFileName );
if ( !name.empty() )
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( study, _this() );
+ SALOMEDS::SObject_wrap meshSO = _gen_i->ObjectToSObject( _this() );
_gen_i->SetName( meshSO, name.c_str() );
}
SMESH::SMESH_Mesh_var mesh( _this() );
if ( !SMESH_Hypothesis::IsStatusFatal(status) )
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- _gen_i->AddHypothesisToShape( study, mesh, aSubShape, anHyp );
+ _gen_i->AddHypothesisToShape( mesh, aSubShape, anHyp );
}
if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
if ( !SMESH_Hypothesis::IsStatusFatal(status) )
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- _gen_i->RemoveHypothesisFromShape( study, mesh, aSubShape, anHyp );
+ _gen_i->RemoveHypothesisFromShape( mesh, aSubShape, anHyp );
}
// Update Python script
if(_impl->HasShapeToMesh())
subMesh = createSubMesh( aSubShape );
if ( _gen_i->CanPublishInStudy( subMesh ))
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
SALOMEDS::SObject_wrap aSO =
- _gen_i->PublishSubMesh( study, aMesh, subMesh, aSubShape, theName );
+ _gen_i->PublishSubMesh( aMesh, subMesh, aSubShape, theName );
if ( !aSO->_is_nil()) {
// Update Python script
TPythonDump() << aSO << " = " << aMesh << ".GetSubMesh( "
return;
GEOM::GEOM_Object_var aSubShape;
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- // Remove submesh's SObject
- SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( aStudy, theSubMesh );
- if ( !anSO->_is_nil() ) {
- long aTag = SMESH_Gen_i::GetRefOnShapeTag();
- SALOMEDS::SObject_wrap anObj, aRef;
- if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
- anObj->ReferencedObject( aRef.inout() ))
- {
- CORBA::Object_var obj = aRef->GetObject();
- aSubShape = GEOM::GEOM_Object::_narrow( obj );
- }
- // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
- // aSubShape = theSubMesh->GetSubShape();
+ // Remove submesh's SObject
+ SALOMEDS::SObject_wrap anSO = _gen_i->ObjectToSObject( theSubMesh );
+ if ( !anSO->_is_nil() ) {
+ long aTag = SMESH_Gen_i::GetRefOnShapeTag();
+ SALOMEDS::SObject_wrap anObj, aRef;
+ if ( anSO->FindSubObject( aTag, anObj.inout() ) &&
+ anObj->ReferencedObject( aRef.inout() ))
+ {
+ CORBA::Object_var obj = aRef->GetObject();
+ aSubShape = GEOM::GEOM_Object::_narrow( obj );
+ }
+ // if ( aSubShape->_is_nil() ) // not published shape (IPAL13617)
+ // aSubShape = theSubMesh->GetSubShape();
- SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
- builder->RemoveObjectWithChildren( anSO );
+ SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
+ builder->RemoveObjectWithChildren( anSO );
- // Update Python script
- TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
- }
+ // Update Python script
+ TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )";
}
if ( removeSubMesh( theSubMesh, aSubShape.in() ))
if ( _gen_i->CanPublishInStudy( aNewGroup ) )
{
SMESH::SMESH_Mesh_var mesh = _this();
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
SALOMEDS::SObject_wrap aSO =
- _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
+ _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName);
if ( !aSO->_is_nil())
// Update Python script
TPythonDump() << aSO << " = " << mesh << ".CreateGroup( "
if ( _gen_i->CanPublishInStudy( aNewGroup ) )
{
SMESH::SMESH_Mesh_var mesh = _this();
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
SALOMEDS::SObject_wrap aSO =
- _gen_i->PublishGroup( study, mesh, aNewGroup, theGeomObj, theName );
+ _gen_i->PublishGroup( mesh, aNewGroup, theGeomObj, theName );
if ( !aSO->_is_nil())
TPythonDump() << aSO << " = " << mesh << ".CreateGroupFromGEOM( "
<< theElemType << ", '" << theName << "', " << theGeomObj << " )";
if ( _gen_i->CanPublishInStudy( aNewGroup ) )
{
SMESH::SMESH_Mesh_var mesh = _this();
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
SALOMEDS::SObject_wrap aSO =
- _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
+ _gen_i->PublishGroup( mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName );
if ( !aSO->_is_nil())
pd << aSO << " = " << mesh << ".CreateGroupFromFilter( "
if ( !aGroup )
return;
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
- if ( !aStudy->_is_nil() )
+ SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( theGroup );
+ if ( !aGroupSO->_is_nil() )
{
- SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
- if ( !aGroupSO->_is_nil() )
- {
- // Update Python script
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
+ // Update Python script
+ TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )";
- // Remove group's SObject
- SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder();
- builder->RemoveObjectWithChildren( aGroupSO );
- }
+ // Remove group's SObject
+ SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
+ builder->RemoveObjectWithChildren( aGroupSO );
}
aGroup->Modified(/*removed=*/true); // notify dependent Filter with FT_BelongToMeshGroup criterion
if ( CORBA::is_nil( theGeomObj ) || theGeomObj->GetType() != GEOM_GROUP )
return;
// group SO
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study, theGeomObj );
+ SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( theGeomObj );
if ( groupSO->_is_nil() )
return;
// group indices
GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
GEOM::GEOM_IGroupOperations_wrap groupOp =
- geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
+ geomGen->GetIGroupOperations();
GEOM::ListOfLong_var ids = groupOp->GetObjects( theGeomObj );
// store data
TopoDS_Shape newShape;
// get geom group
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- if ( study->_is_nil() ) return newShape; // means "not changed"
- SALOMEDS::SObject_wrap groupSO = study->FindObjectID( groupData._groupEntry.c_str() );
+ SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( groupData._groupEntry.c_str() );
if ( !groupSO->_is_nil() )
{
CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
set<int> curIndices;
GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
GEOM::GEOM_IGroupOperations_wrap groupOp =
- geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
+ geomGen->GetIGroupOperations();
GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
for ( CORBA::ULong i = 0; i < ids->length(); ++i )
curIndices.insert( ids[i] );
{
if ( !_impl->HasShapeToMesh() ) return;
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- if ( study->_is_nil() ) return;
-
GEOM::GEOM_Object_var mainGO = _gen_i->ShapeToGeomObject( _impl->GetShapeToMesh() );
//if ( mainGO->_is_nil() ) return;
{
if ( !_impl->HasShapeToMesh() ) return;
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- if ( study->_is_nil() ) return;
-
CORBA::Long nbEntities = NbNodes() + NbElements();
// Check if group contents changed
if ( _mapGroups.find( oldID ) == _mapGroups.end() )
continue;
// get group name
- SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study,_mapGroups[oldID] );
+ SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( _mapGroups[oldID] );
CORBA::String_var name = groupSO->GetName();
// update
SMESH_GroupBase_i* group_i = SMESH::DownCast<SMESH_GroupBase_i*>(_mapGroups[oldID] );
if ( newNbEntities != nbEntities )
{
// Add all SObjects with icons to soToUpdateIcons
- soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, _this() )); // mesh
+ soToUpdateIcons.push_back( _gen_i->ObjectToSObject( _this() )); // mesh
for (map<int, SMESH::SMESH_subMesh_ptr>::iterator i_sm = _mapSubMeshIor.begin();
i_sm != _mapSubMeshIor.end(); ++i_sm ) // submeshes
- soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_sm->second ));
+ soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_sm->second ));
for ( map<int, SMESH::SMESH_GroupBase_ptr>::iterator i_gr = _mapGroups.begin();
i_gr != _mapGroups.end(); ++i_gr ) // groups
- soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_gr->second ));
+ soToUpdateIcons.push_back( _gen_i->ObjectToSObject( i_gr->second ));
}
list< SALOMEDS::SObject_wrap >::iterator so = soToUpdateIcons.begin();
SALOMEDS::StudyBuilder_var builder;
SALOMEDS::SObject_wrap aGroupSO;
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
if ( !aStudy->_is_nil() ) {
builder = aStudy->NewBuilder();
- aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
+ aGroupSO = _gen_i->ObjectToSObject( theGroup );
if ( !aGroupSO->_is_nil() )
{
// remove reference to geometry
return _id;
}
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
-{
- return _studyId;
-}
-
//=============================================================================
namespace
{
// Perform Export
PrepareForWriting(file, overwrite);
string aMeshName = "Mesh";
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( aStudy, _this() );
+ SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( _this() );
if ( !aMeshSO->_is_nil() ) {
CORBA::String_var name = aMeshSO->GetName();
aMeshName = name;
<< ".ExportSTL( r'" << file << "', " << isascii << " )";
CORBA::String_var name;
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, _this() );
+ SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( _this() );
if ( !so->_is_nil() )
name = so->GetName();
PrepareForWriting(file, overwrite);
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
- if ( !SO->_is_nil() ) {
- CORBA::String_var name = SO->GetName();
- aMeshName = name;
- }
+ SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( meshPart );
+ if ( !SO->_is_nil() ) {
+ CORBA::String_var name = SO->GetName();
+ aMeshName = name;
}
+
SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
_impl->ExportMED( file, aMeshName.c_str(), auto_groups,
version, partDS, autoDimension, /*addODOnVertices=*/have0dField);
PrepareForWriting(file);
CORBA::String_var name;
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
+ SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
if ( !so->_is_nil() )
name = so->GetName();
PrepareForWriting(file,overwrite);
std::string meshName("");
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
- SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( study, meshPart );
+ SALOMEDS::SObject_wrap so = _gen_i->ObjectToSObject( meshPart );
if ( !so->_is_nil() )
{
CORBA::String_var name = so->GetName();
groups[ ++iG ] = createGroup( SMESH::ElementType(i), theGroupName );
if ( _gen_i->CanPublishInStudy( groups[ iG ] ))
{
- SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
SMESH::SMESH_Mesh_var mesh = _this();
SALOMEDS::SObject_wrap aSO =
- _gen_i->PublishGroup( study, mesh, groups[ iG ],
+ _gen_i->PublishGroup( mesh, groups[ iG ],
GEOM::GEOM_Object::_nil(), theGroupName);
}
SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( groups[ iG ]);
void SMESH_Mesh_i::CreateGroupServants()
{
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
SMESH::SMESH_Mesh_var aMesh = _this();
set<int> addedIDs;
else { nextId = 0; } // avoid "unused variable" warning in release mode
// publishing the groups in the study
- if ( !aStudy->_is_nil() ) {
- GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
- _gen_i->PublishGroup( aStudy, aMesh, groupVar, shapeVar, group->GetName());
- }
+ GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
+ _gen_i->PublishGroup( aMesh, groupVar, shapeVar, group->GetName());
}
if ( !addedIDs.empty() )
{
int nbGrp = NbGroups();
if ( !nbGrp )
return;
-
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
- if ( aStudy->_is_nil() )
- return; // nothing to do
SMESH::ListOfGroups* grpList = 0;
// avoid dump of "GetGroups"
SMESH::SMESH_GroupBase_ptr aGrp = (*grpList)[ gIndx ];
if ( !aGrp )
continue;
- SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aStudy, aGrp );
+ SALOMEDS::SObject_wrap aGrpSO = _gen_i->ObjectToSObject( aGrp );
if ( aGrpSO->_is_nil() )
continue;
// correct name of the mesh group if necessary
SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
if(gen) {
CORBA::String_var aParameters = GetParameters();
- SALOMEDS::Study_var aStudy = gen->GetCurrentStudy();
- if ( !aStudy->_is_nil()) {
- SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters);
- if ( aSections->length() > 0 ) {
- SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
- aResult->length( aVars.length() );
- for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
- aResult[i] = CORBA::string_dup( aVars[i] );
- }
+ SALOMEDS::ListOfListOfStrings_var aSections = SMESH_Gen_i::getStudyServant()->ParseVariables(aParameters);
+ if ( aSections->length() > 0 ) {
+ SALOMEDS::ListOfStrings aVars = aSections[ aSections->length() - 1 ];
+ aResult->length( aVars.length() );
+ for ( CORBA::ULong i = 0;i < aVars.length(); i++ )
+ aResult[i] = CORBA::string_dup( aVars[i] );
}
}
return aResult._retn();
SMESH_Mesh_i(const SMESH_Mesh_i&);
public:
SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
- SMESH_Gen_i* myGen_i,
- CORBA::Long studyId );
+ SMESH_Gen_i* myGen_i );
virtual ~SMESH_Mesh_i();
CORBA::Long GetId() throw (SALOME::SALOME_Exception);
- CORBA::Long GetStudyId() throw (SALOME::SALOME_Exception);
-
// --- C++ interface
void SetImpl(::SMESH_Mesh* impl);
::SMESH_Mesh* _impl; // :: force no namespace here
SMESH_Gen_i* _gen_i;
int _id; // id given by creator (unique within the creator instance)
- int _studyId;
std::map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
std::map<int, SMESH::SMESH_GroupBase_ptr> _mapGroups;
std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
// dumped calls due to the fix of
// issue 0021364:: Dump of netgen parameters has duplicate lines
SMESH_Gen_i * aGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy();
- SALOMEDS::SObject_wrap sobj = aStudy->FindObjectID( (*it).first.ToCString() );
+ SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( (*it).first.ToCString() );
CORBA::Object_var obj = aGen->SObjectToObject( sobj );
if ( SMESH_Hypothesis_i* h = SMESH::DownCast< SMESH_Hypothesis_i*>( obj ))
{
if(!aGen)
return;
- SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy();
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
if(aStudy->_is_nil())
return;
{
bool ok = false;
- SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
- if(!aGen)
- return ok;
-
- SALOMEDS::Study_ptr aStudy = aGen->GetCurrentStudy();
+ SALOMEDS::Study_ptr aStudy = SMESH_Gen_i::getStudyServant();
if(aStudy->_is_nil())
return ok;
{
enum { GroupOnFilter_OutOfDate = -1 };
- // a map to count not yet loaded meshes
- static std::map< int, int > theStudyIDToMeshCounter;
+ // count not yet loaded meshes
+ static int theMeshCounter = 0;
//================================================================================
/*!
void meshInfoLoaded( SMESH_Mesh_i* mesh )
{
- std::map< int, int >::iterator id2counter =
- theStudyIDToMeshCounter.insert( std::make_pair( (int) mesh->GetStudyId(), 0 )).first;
- id2counter->second++;
+ theMeshCounter++;
}
//================================================================================
/*!
std::string medFile,
std::string hdfFile)
{
- if ( --theStudyIDToMeshCounter[ (int) mesh->GetStudyId() ] == 0 )
+ if ( --theMeshCounter == 0 )
{
std::string tmpDir = SALOMEDS_Tool::GetDirFromPath( hdfFile );
- SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames;
- aFiles->length(2);
+ SALOMEDS_Tool::ListOfFiles aFiles;
+ aFiles.reserve(2);
medFile = SALOMEDS_Tool::GetNameFromPath( medFile ) + ".med";
hdfFile = SALOMEDS_Tool::GetNameFromPath( hdfFile ) + ".hdf";
- aFiles[0] = medFile.c_str();
- aFiles[1] = hdfFile.c_str();
+ aFiles.push_back(medFile.c_str());
+ aFiles.push_back(hdfFile.c_str());
- SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles.in(), true );
+ SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles, true );
}
}
SignalToGUI( SMESH_Mesh_i* mesh )
{
SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- if ( !study->_is_nil() && study->StudyId() == mesh->GetStudyId() )
+
+ SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject( mesh->_this() );
+ CORBA::Object_var obj = gen->GetNS()->Resolve( "/Kernel/Session" );
+ _session = SALOME::Session::_narrow( obj );
+ if ( !meshSO->_is_nil() && !_session->_is_nil() )
{
- SALOMEDS::SObject_wrap meshSO = gen->ObjectToSObject(study, mesh->_this() );
- CORBA::Object_var obj = gen->GetNS()->Resolve( "/Kernel/Session" );
- _session = SALOME::Session::_narrow( obj );
- if ( !meshSO->_is_nil() && !_session->_is_nil() )
- {
- CORBA::String_var meshEntry = meshSO->GetID();
- _messagePrefix = "SMESH/mesh_loading/";
- _messagePrefix += meshEntry.in();
+ CORBA::String_var meshEntry = meshSO->GetID();
+ _messagePrefix = "SMESH/mesh_loading/";
+ _messagePrefix += meshEntry.in();
- std::string msgToGUI = _messagePrefix + "/";
- msgToGUI += SMESH_Comment( mesh->NbNodes() );
- msgToGUI += "/";
- msgToGUI += SMESH_Comment( mesh->NbElements() );
+ std::string msgToGUI = _messagePrefix + "/";
+ msgToGUI += SMESH_Comment( mesh->NbNodes() );
+ msgToGUI += "/";
+ msgToGUI += SMESH_Comment( mesh->NbElements() );
- _session->emitMessageOneWay( msgToGUI.c_str());
- }
+ _session->emitMessageOneWay( msgToGUI.c_str());
}
}
void sendStop()
void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp)
{
- SALOMEDS::Study_var study = smeshComp->GetStudy();
- if ( theStudyIDToMeshCounter[ (int) study->StudyId() ] > 0 )
+ if ( theMeshCounter > 0 )
{
- SALOMEDS::ChildIterator_wrap itBig = study->NewChildIterator( smeshComp );
+ SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp );
for ( ; itBig->More(); itBig->Next() ) {
SALOMEDS::SObject_wrap gotBranch = itBig->Value();
CORBA::Object_var anObject = SMESH_Gen_i::SObjectToObject( gotBranch );
Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
std::set< TCollection_AsciiString >& theRemovedObjIDs,
- SALOMEDS::Study_ptr& theStudy,
const bool theHistoricalDump);
/*!
## This function updates the tools so that it works on the
# specified study.
- def updateStudy(self, studyId=None):
+ def updateStudy(self):
"""
This function updates the tools so that it works on the
specified study.
"""
- self.editor = getStudyEditor(studyId)
+ self.editor = getStudyEditor()
## Get the mesh item owning the mesh group \em meshGroupItem.
# \param meshGroupItem (SObject) mesh group belonging to the searched mesh.
return None
import SMESH
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(self.editor.study)
+ smesh = smeshBuilder.New()
meshObject=salome.IDToObject(entry)
return smesh.Mesh( meshObject )
def TEST_createBoxMesh():
- theStudy = helper.getActiveStudy()
import GEOM
from salome.geom import geomBuilder
- geompy = geomBuilder.New(theStudy)
+ geompy = geomBuilder.New()
box = geompy.MakeBoxDXDYDZ(200, 200, 200)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(theStudy)
+ smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
boxmesh = smesh.Mesh(box)
smesh.SetName(boxmesh.GetMesh(), 'boxmesh')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
#
# Definitions:
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
#-----------------------------GEOM----------------------------------------
ret = mesh.Compute()
print ret
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
#----------------------------------GEOM
# ---- udate object browser
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# create points to build two circles
mesh2.Compute()
# ---- update object browser
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
oldnodes = newnodes
pass
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
#anIds = CheckBelongToGeomFilterOld(smesh,mesh.GetMesh(),box,box,anElemType)
#print "anIds = ", anIds
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
## create a bottom box
Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
#end
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", SMESH.FACE)
aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", SMESH.EDGE)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
print "aGroupOnShell size =", aGroupOnShell.Size()
print "aGroupOnShell ids :", aGroupOnShell.GetListOfID()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
# Second way
mesh.MakeGroup("Group of faces lying on edge #2", SMESH.FACE, SMESH.FT_LyingOnGeom, edge)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import os
import math
print "Number of volumes : ", mesh.NbVolumes()
print "Number of tetrahedrons: ", mesh.NbTetras()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from math import sqrt
barier_height = 7.0
barier_radius = 5.6 / 2 # Rayon de la bariere
colis_radius = 1.0 / 2 # Rayon du colis
-colis_step = 2.0 # Distance s\89parant deux colis
+colis_step = 2.0 # Distance s�parant deux colis
cc_width = 0.11 # Epaisseur du complement de colisage
# --
else:
print "problem when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
my_hexa.Hexahedron()
my_hexa.Compute()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from salome import sg
box_mesh.Compute()
-sg.updateObjBrowser(True)
+sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define 2 boxes box1 and box2
else:
print "probleme when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define 3 boxes box1, box2 and box3
else:
print "probleme when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define a boxe
else:
print "probleme when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
mesh = SMESH_mechanic.mesh
# ---- Criterion : AREA > 100
#print anIds[ i ]
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
idEdgeZ.append(geompy.addToStudyInFather(vol,edgeZ[i],"EdgeZ"+str(i+1)))
### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# ---- init a Mesh with the volume
smesh.SetName(algo.GetSubMesh(), "SubMeshEdgeZ_"+str(i+1))
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
print "-------------------------- compute the mesh of the volume"
else:
print "problem when Computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
compshell = SMESH_fixation.compshell
idcomp = SMESH_fixation.idcomp
print " check status ", status
### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# ---- init a Mesh with the compshell
shape_mesh = salome.IDToObject( idcomp )
else:
print "problem when Computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
compshell = SMESH_fixation.compshell
idcomp = SMESH_fixation.idcomp
print " check status ", status
### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
print "-------------------------- create Mesh, algorithm, hypothesis"
else:
print "problem when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
compshell = SMESH_fixation.compshell
idcomp = SMESH_fixation.idcomp
print " check status ", status
### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# ---- init a Mesh with the compshell
else:
print "problem when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---------------------------- GEOM --------------------------------------
### ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# ---- init a Mesh with the shell
shape_mesh = salome.IDToObject( idShape )
else:
print "probleme when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Create box without one plane
aBox = salome.IDToObject( idbox )
# Create mesh
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
mesh = smesh.Mesh(aBox, "Mesh_freebord")
for i in range( len( anIds ) ):
print anIds[ i ]
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# -----------------------------------------------------------------------------
edgeGroups = geompy.Propagate( blob )
assert len( edgeGroups ) == 3
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
# -----------------------------------------------------------------------------
print "-------------------------- mesh"
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# ---- define a mesh on the geom shape 'blob'
mesh=smesh.Mesh(blob, "MeshBlob")
else:
print "problem when Computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name )
# ---------------------------- SMESH --------------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
# -- Init --
shape_mesh = salome.IDToObject( Id_mechanic )
print "Number of volumes : ", mesh.NbVolumes()
print "Number of tetrahedrons: ", mesh.NbTetras()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---------------------------- GEOM --------------------------------------
#9 reorientation of the submesh1
mesh.ReorientObject(submesh1)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---------------------------- GEOM --------------------------------------
else:
print "problem when computing the mesh"
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---------------------------- GEOM --------------------------------------
print "Number of volumes : ", mesh.NbVolumes()
print "Number of tetrahedrons: ", mesh.NbTetras()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
print name
idedge.append( geompy.addToStudyInFather(box, f, name) )
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
# ---- launch SMESH
smeshgui = salome.ImportComponentGUI("SMESH")
-smeshgui.Init(salome.myStudyId)
-smesh.SetCurrentStudy(salome.myStudy)
+smeshgui.Init()
+smesh.UpdateStudy()
# ---- Creating meshes
algo.MaxElementArea(2500)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define a box
# ---- SMESH
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
box = salome.IDToObject(idb)
mesh = smesh.Mesh(box, "Meshbox")
ii = ii+1
print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define a box
print name
idedge = geompy.addToStudyInFather(face, edge, name)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define a box
smesh.SetName(hypArea2, "MaxElementArea_500")
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- define a box
mesh.Compute()
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
sg = salome.ImportComponentGUI('SMESH')
if type(sg) != type(salome.salome_ComponentGUI):
for linelog in log:
print linelog
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
pi = math.pi
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# ---- GEOM
# ---- SMESH
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
mesh = smesh.Mesh(box, "Meshbox")
# Set 1D algorithm/hypotheses to mesh
group1.Add(faces[:int(len(faces)/2)])
group2.Add(faces[int(len(faces)/2):])
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import CORBA
import os
ConvertMED2UNV(aPath,aFileName)
#break
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
if not self.nbLayers is None:
self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
- study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
- self.mesh.smeshpyD.SetCurrentStudy( None )
+ self.mesh.smeshpyD.SetEnablePublish( False ) # prevents publishing own 1D hypothesis
hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
- self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
+ self.mesh.smeshpyD.SetEnablePublish( True ) # enables publishing
if not self.distribHyp:
self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
self.distribHyp.SetLayerDistribution( hyp )
self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
else:
self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
- study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
- self.mesh.smeshpyD.SetCurrentStudy( None )
+ self.mesh.smeshpyD.SetEnablePublish( False )
hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
- self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
+ self.mesh.smeshpyD.SetEnablePublish( True )
self.distribHyp.SetLayerDistribution( hyp )
return hyp
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometrie
# =========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometrie
# =========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometrie
# =========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometrie
# =========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Geometry
# ========
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
\ No newline at end of file
+salome.sg.updateObjBrowser()
\ No newline at end of file
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
geo = geompy
# Mesh the blocks with hexahedral
# -------------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
def discretize(x, y, z, n, s=blocks):
p = geompy.MakeVertex(x, y, z)
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import os
# Update the object browser
# -------------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
global Face_1
Face_1 = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( Face_1, "Face_1" )
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
from salome.StdMeshers import StdMeshersBuilder
pattern = smesh.GetPattern()
Mesh_1 = smesh.Mesh(Face_1)
# CutListOfGroups()
aCutGrp=Mesh_1.CutListOfGroups([aRedGroup],[aGreenGroup,aBlueGroup],"CutGrp")
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# Parameters
# ----------
# Define a mesh on a geometry
# ---------------------------
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
m = smesh.Mesh(cylinder)
# Update object browser
# ---------------------
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import math
global Box_1
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudy( Box_1, "Box_1" )
-smesh.SetCurrentStudy(salome.myStudy)
+smesh.UpdateStudy()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(Box_1)
Regular_1D = Mesh_1.Segment()
aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], SMESH.NODE, "Nodes" )
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
try:
# get instance of class smeshBuilder
engineSmesh = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" )
- smesh = smeshBuilder.New(salome.myStudy, engineSmesh)
+ smesh = smeshBuilder.New(True,engineSmesh)
except:
print "exception in smesh.py: instance creation failed"
smesh = None
-------
import smesh, SMESH
-smesh.SetCurrentStudy(theStudy)
with
----
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
you also need to modify some lines where smeshBuilder is used instead of smesh
except:
ior = None
if ior:
- # CORBA object
- studies = salome.myStudyManager.GetOpenStudies()
- for sname in studies:
- s = salome.myStudyManager.GetStudyByName(sname)
- if not s: continue
- sobj = s.FindObjectIOR(ior)
- if not sobj: continue
+ sobj = salome.myStudy.FindObjectIOR(ior)
+ if sobj:
return sobj.GetName()
if hasattr(obj, "GetName"):
# unknown CORBA object, having GetName() method
def AssureGeomPublished(mesh, geom, name=''):
if not isinstance( geom, geomBuilder.GEOM._objref_GEOM_Object ):
return
- if not geom.GetStudyEntry() and \
- mesh.smeshpyD.GetCurrentStudy():
- ## set the study
- studyID = mesh.smeshpyD.GetCurrentStudy()._get_StudyId()
- if studyID != mesh.geompyD.myStudyId:
- mesh.geompyD.init_geom( mesh.smeshpyD.GetCurrentStudy())
+ if not geom.GetStudyEntry():
## get a name
if not name and geom.GetShapeType() != geomBuilder.GEOM.COMPOUND:
# for all groups SubShapeName() return "Compound_-1"
## Dump component to the Python script
# This method overrides IDL function to allow default values for the parameters.
# @ingroup l1_auxiliary
- def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
- return SMESH._objref_SMESH_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
+ def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
+ return SMESH._objref_SMESH_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
## Set mode of DumpPython(), \a historical or \a snapshot.
# In the \a historical mode, the Python Dump script includes all commands
else: val = "false"
SMESH._objref_SMESH_Gen.SetOption(self, "historical_python_dump", val)
- ## Set the current study and Geometry component
+ ## Set Geometry component
# @ingroup l1_auxiliary
- def init_smesh(self,theStudy,geompyD = None):
+ def init_smesh(self,isPublished = True,geompyD = None):
#print "init_smesh"
- self.SetCurrentStudy(theStudy,geompyD)
- if theStudy:
+ self.UpdateStudy(geompyD)
+ if isPublished:
global notebook
- notebook.myStudy = theStudy
+ notebook.myStudy = salome.myStudy
## Create a mesh. This can be either an empty mesh, possibly having an underlying geometry,
# or a mesh wrapping a CORBA mesh given as a parameter.
# @ingroup l1_auxiliary
def IsEmbeddedMode(self):
return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self)
-
- ## Set the current study. Calling SetCurrentStudy( None ) allows to
- # switch OFF automatic pubilishing in the Study of mesh objects.
+
+ ## Update the current study. Calling UpdateStudy() allows to
+ # update meshes at switching GEOM->SMESH
# @ingroup l1_auxiliary
- def SetCurrentStudy( self, theStudy, geompyD = None ):
+ def UpdateStudy( self, geompyD = None ):
+ #self.UpdateStudy()
if not geompyD:
from salome.geom import geomBuilder
geompyD = geomBuilder.geom
pass
self.geompyD=geompyD
self.SetGeomEngine(geompyD)
- SMESH._objref_SMESH_Gen.SetCurrentStudy(self,theStudy)
- global notebook
- if theStudy:
- notebook = salome_notebook.NoteBook( theStudy )
- else:
- notebook = salome_notebook.NoteBook( salome_notebook.PseudoStudyForNoteBook() )
- if theStudy:
- sb = theStudy.NewBuilder()
- sc = theStudy.FindComponent("SMESH")
- if sc: sb.LoadWith(sc, self)
- pass
+ SMESH._objref_SMESH_Gen.UpdateStudy(self)
+ sb = salome.myStudy.NewBuilder()
+ sc = salome.myStudy.FindComponent("SMESH")
+ if sc: sb.LoadWith(sc, self)
pass
-
- ## Get the current study
+
+ ## Sets enable publishing in the study. Calling SetEnablePublish( false ) allows to
+ # switch OFF publishing in the Study of mesh objects.
# @ingroup l1_auxiliary
- def GetCurrentStudy(self):
- return SMESH._objref_SMESH_Gen.GetCurrentStudy(self)
+ def SetEnablePublish( self, theIsEnablePublish ):
+ #self.SetEnablePublish(theIsEnablePublish)
+ SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish)
+ global notebook
+ notebook = salome_notebook.NoteBook( theIsEnablePublish )
## Create a Mesh object importing data from the given UNV file
# @return an instance of Mesh class
raise ValueError, "Group type mismatches Element type"
aCriterion.ThresholdStr = aThreshold.GetName()
aCriterion.ThresholdID = salome.orb.object_to_string( aThreshold )
- study = self.GetCurrentStudy()
+ study = salome.myStudy
if study:
so = study.FindObjectIOR( aCriterion.ThresholdID )
if so:
# import salome
# salome.salome_init()
# from salome.smesh import smeshBuilder
-# smesh = smeshBuilder.New(salome.myStudy)
+# smesh = smeshBuilder.New()
# \endcode
-# @param study SALOME study, generally obtained by salome.myStudy.
+# @param isPublished If False, the notebool will not be used.
# @param instance CORBA proxy of SMESH Engine. If None, the default Engine is used.
# @return smeshBuilder instance
-def New( study, instance=None):
+def New( isPublished = True, instance=None):
"""
Create a new smeshBuilder instance.The smeshBuilder class provides the Python
interface to create or load meshes.
import salome
salome.salome_init()
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
Parameters:
- study SALOME study, generally obtained by salome.myStudy.
+ isPublished If False, the notebool will not be used.
instance CORBA proxy of SMESH Engine. If None, the default Engine is used.
Returns:
smeshBuilder instance
doLcc = True
smeshInst = smeshBuilder()
assert isinstance(smeshInst,smeshBuilder), "Smesh engine class is %s but should be smeshBuilder.smeshBuilder. Import salome.smesh.smeshBuilder before creating the instance."%smeshInst.__class__
- smeshInst.init_smesh(study)
+ smeshInst.init_smesh(isPublished)
return smeshInst
self.geom = obj
objHasName = True
# publish geom of mesh (issue 0021122)
- if not self.geom.GetStudyEntry() and smeshpyD.GetCurrentStudy():
+ if not self.geom.GetStudyEntry():
objHasName = False
- studyID = smeshpyD.GetCurrentStudy()._get_StudyId()
- if studyID != geompyD.myStudyId:
- geompyD.init_geom( smeshpyD.GetCurrentStudy())
- pass
+ geompyD.init_geom()
if name:
geo_name = name + " shape"
else:
print msg
print allReasons
pass
- if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+ if salome.sg.hasDesktop():
if not isinstance( refresh, list): # not a call from subMesh.Compute()
smeshgui = salome.ImportComponentGUI("SMESH")
- smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.Init()
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
- if refresh: salome.sg.updateObjBrowser(True)
+ if refresh: salome.sg.updateObjBrowser()
return ok
try:
shapeText = ""
mainIOR = salome.orb.object_to_string( self.GetShape() )
- for sname in salome.myStudyManager.GetOpenStudies():
- s = salome.myStudyManager.GetStudyByName(sname)
- if not s: continue
- mainSO = s.FindObjectIOR(mainIOR)
- if not mainSO: continue
+ s = salome.myStudy
+ mainSO = s.FindObjectIOR(mainIOR)
+ if mainSO:
if subShapeID == 1:
shapeText = '"%s"' % mainSO.GetName()
subIt = s.NewChildIterator(mainSO)
continue
if ids == subShapeID:
shapeText = '"%s"' % subSO.GetName()
- break
if not shapeText:
shape = self.geompyD.GetSubShape( self.GetShape(), [subShapeID])
if shape:
# @ingroup l2_construct
def Clear(self, refresh=False):
self.mesh.Clear()
- if ( salome.sg.hasDesktop() and
- salome.myStudyManager.GetStudyByID( self.mesh.GetStudyId() ) ):
+ if ( salome.sg.hasDesktop() ):
smeshgui = salome.ImportComponentGUI("SMESH")
- smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.Init()
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
- if refresh: salome.sg.updateObjBrowser(True)
+ if refresh: salome.sg.updateObjBrowser()
## Remove all nodes and elements of indicated shape
# @param refresh if @c True, Object browser is automatically updated (when running in GUI)
self.mesh.ClearSubMesh(geomId)
if salome.sg.hasDesktop():
smeshgui = salome.ImportComponentGUI("SMESH")
- smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.Init()
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
- if refresh: salome.sg.updateObjBrowser(True)
+ if refresh: salome.sg.updateObjBrowser()
## Compute a tetrahedral mesh using AutomaticLength + MEFISTO + Tetrahedron
# @param fineness [0.0,1.0] defines mesh fineness
def GetId(self):
return self.mesh.GetId()
- ## Get the study Id
- # @return integer value, which is the study Id of the mesh
- # @ingroup l1_auxiliary
- def GetStudyId(self):
- return self.mesh.GetStudyId()
-
## Check the group names for duplications.
# Consider the maximum group name length stored in MED file.
# @return True or False
ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
- if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+ if salome.sg.hasDesktop():
smeshgui = salome.ImportComponentGUI("SMESH")
- smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.Init()
smeshgui.SetMeshIcon( salome.ObjectToID( self ), ok, (self.GetNumberOfElements()==0) )
- if refresh: salome.sg.updateObjBrowser(True)
+ if refresh: salome.sg.updateObjBrowser()
pass
return ok
# Finds only the hypotheses created in smeshpyD engine.
# @return SMESH.SMESH_Hypothesis
def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):
- study = smeshpyD.GetCurrentStudy()
+ study = salome.myStudy
if not study: return None
#to do: find component by smeshpyD object, not by its data type
scomp = study.FindComponent(smeshpyD.ComponentDataType())
# Finds only the algorithms, which have been created in smeshpyD engine.
# @return SMESH.SMESH_Algo
def FindAlgorithm (self, algoname, smeshpyD):
- study = smeshpyD.GetCurrentStudy()
+ study = salome.myStudy
if not study: return None
#to do: find component by smeshpyD object, not by its data type
scomp = study.FindComponent(smeshpyD.ComponentDataType())
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import GEOM
SET(_link_LIBRARIES
${KERNEL_SalomeGenericObj}
${KERNEL_SALOMELocalTrace}
+ ${KERNEL_SalomeKernelHelpers}
${GUI_CAM}
${GUI_suit}
${GUI_qtx}
#include <Utils_ORB_INIT.hxx>
#include <Utils_SINGLETON.hxx>
#include <SALOMEDSClient_ClientFactory.hxx>
+#include <SALOME_KernelServices.hxx>
#include <utilities.h>
void
SetDomain(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder,
long theRefOnAppliedDomainTag,
const QString& theAppliedDomainMEN,
const QString& theAppliedDomainICON)
{
- SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
- SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
+ SALOMEDS::SObject_var aMeshOrSubMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshOrSubMeshEntry);
+ SALOMEDS::SObject_var aHypothesisSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){
//Find or Create Applied Hypothesis root
void
SetHypothesis(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
theDomainEntry,
- theStudy,
theStudyBuilder,
SMESH::Tag_RefOnAppliedHypothesis,
QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
void
SetAlgorithms(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
theDomainEntry,
- theStudy,
theStudyBuilder,
SMESH::Tag_RefOnAppliedAlgorithms,
QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
//===============================================================
void
-SMESH_Swig::Init(int theStudyID)
+SMESH_Swig::Init()
{
class TEvent: public SALOME_Event
{
- int myStudyID;
- SALOMEDS::Study_var& myStudy;
SALOMEDS::StudyBuilder_var& myStudyBuilder;
SALOMEDS::SComponent_var& mySComponentMesh;
public:
- TEvent(int theStudyID,
- SALOMEDS::Study_var& theStudy,
- SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ TEvent(SALOMEDS::StudyBuilder_var& theStudyBuilder,
SALOMEDS::SComponent_var& theSComponentMesh):
- myStudyID (theStudyID),
- myStudy (theStudy),
myStudyBuilder (theStudyBuilder),
mySComponentMesh(theSComponentMesh)
{}
SUIT_Application* anApplication = aSession->activeApplication();
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
- SALOME_NamingService* aNamingService = anApp->namingService();
- CORBA::Object_var anObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
- myStudy = aStudyMgr->GetStudyByID(myStudyID);
+ SALOMEDS::Study_var aStudy = KERNEL::getStudyServant();
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
- aSMESHGen->SetCurrentStudy( myStudy.in() );
- myStudyBuilder = myStudy->NewBuilder();
+ myStudyBuilder = aStudy->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
SALOMEDS::AttributePixMap_var aPixmap;
- SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
+ SALOMEDS::SComponent_var aSComponent = aStudy->FindComponent("SMESH");
if ( aSComponent->_is_nil() )
{
- bool aLocked = myStudy->GetProperties()->IsLocked();
+ bool aLocked = aStudy->GetProperties()->IsLocked();
if (aLocked)
- myStudy->GetProperties()->SetLocked(false);
+ aStudy->GetProperties()->SetLocked(false);
SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI();
//SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
aPixmap->UnRegister();
- SALOMEDS::UseCaseBuilder_var useCaseBuilder = myStudy->GetUseCaseBuilder();
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = KERNEL::getStudyServant()->GetUseCaseBuilder();
useCaseBuilder->SetRootCurrent();
useCaseBuilder->Append( aSComponent.in() );
myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
if (aLocked)
- myStudy->GetProperties()->SetLocked(true);
+ KERNEL::getStudyServant()->GetProperties()->SetLocked(true);
}
mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
//MESSAGE("Init");
- ProcessVoidEvent(new TEvent(theStudyID,
- myStudy,
- myStudyBuilder,
+ ProcessVoidEvent(new TEvent(myStudyBuilder,
mySComponentMesh));
}
{
// VSR: added temporarily - to be removed - objects are published automatically by engine
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
+ SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectIOR(theIOR);
if (aSObject->_is_nil())
{
//Find or Create Hypothesis root
void SMESH_Swig::SetShape(const char* theShapeEntry,
const char* theMeshEntry)
{
- SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
- SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry );
+ SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID( theShapeEntry );
+ SALOMEDS::SObject_var aMeshSO = KERNEL::getStudyServant()->FindObjectID( theMeshEntry );
if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
{
::SetHypothesis(theMeshOrSubMeshEntry,
theDomainEntry,
- myStudy,
myStudyBuilder);
}
{
::SetAlgorithms(theMeshOrSubMeshEntry,
theDomainEntry,
- myStudy,
myStudyBuilder);
}
void
SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
{
- SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry);
+ SALOMEDS::SObject_var aDomainSO = KERNEL::getStudyServant()->FindObjectID(theDomainEntry);
if(!aDomainSO->_is_nil())
myStudyBuilder->RemoveObject(aDomainSO);
}
const char* theSubMeshIOR,
int theShapeType)
{
- SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
+ SALOMEDS::SObject_var aMeshSO = KERNEL::getStudyServant()->FindObjectID(theMeshEntry);
if(!aMeshSO->_is_nil()) {
long aShapeTag;
QString aSubMeshName;
const char* theSubMeshIOR,
int ShapeType)
{
- SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
+ SALOMEDS::SObject_var aGeomShapeSO = KERNEL::getStudyServant()->FindObjectID(theGeomShapeEntry);
if(!aGeomShapeSO->_is_nil())
{
const char * aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType);
- SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry);
+ SALOMEDS::SObject_var aSubMeshSO = KERNEL::getStudyServant()->FindObjectID(aSubMeshEntry);
if ( !aSubMeshSO->_is_nil()) {
SetShape( theGeomShapeEntry, aSubMeshEntry );
CORBA::String_var aString = aSubMeshSO->GetID();
void SMESH_Swig::SetName(const char* theEntry,
const char* theName)
{
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
+ SALOMEDS::SObject_var aSObject = KERNEL::getStudyServant()->FindObjectID(theEntry);
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeName_var aName;
if(!aSObject->_is_nil()){
{
class TEvent: public SALOME_Event
{
- SALOMEDS::Study_var myStudy;
std::string myMeshEntry;
bool myIsComputed, myIsEmpty;
public:
- TEvent(const SALOMEDS::Study_var& theStudy,
- const std::string& theMeshEntry,
+ TEvent(const std::string& theMeshEntry,
const bool theIsComputed,
const bool isEmpty):
- myStudy (theStudy),
myMeshEntry (theMeshEntry),
myIsComputed(theIsComputed),
myIsEmpty (isEmpty)
void
Execute()
{
- SALOMEDS::SObject_ptr aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
+ SALOMEDS::SObject_ptr aMeshSO = KERNEL::getStudyServant()->FindObjectID(myMeshEntry.c_str());
if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
// aMeshSO->UnRegister(); ~aMesh() already called UnRegister()!
}
};
- ProcessVoidEvent(new TEvent(myStudy,
- theMeshEntry,
+ ProcessVoidEvent(new TEvent(theMeshEntry,
theIsComputed,
isEmpty));
}
SMESH_Swig();
~SMESH_Swig();
- void Init( int );
+ void Init();
const char* AddNewMesh( const char* );
void select( const char *id, int id1, bool append = false );
private:
- SALOMEDS::Study_var myStudy;
SALOMEDS::StudyBuilder_var myStudyBuilder;
SALOMEDS::SComponent_var mySComponentMesh;
};
SMESH_Swig();
~SMESH_Swig();
- void Init(int studyID);
+ void Init();
const char* AddNewMesh(const char* IOR);
const char* AddNewHypothesis(const char* IOR);
class AdaptiveAlgo : public StdMeshers_Regular_1D
{
public:
- AdaptiveAlgo(int hypId, int studyId, SMESH_Gen* gen);
+ AdaptiveAlgo(int hypId, SMESH_Gen* gen);
virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape );
virtual bool Evaluate(SMESH_Mesh & theMesh,
const TopoDS_Shape & theShape,
//function : StdMeshers_Adaptive1D
//purpose : Constructor
StdMeshers_Adaptive1D::StdMeshers_Adaptive1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
myMinSize = 1e-10;
myMaxSize = 1e+10;
if ( !myAlgo )
{
AdaptiveAlgo* newAlgo =
- new AdaptiveAlgo( _gen->GetANewId(), _studyId, _gen );
+ new AdaptiveAlgo( _gen->GetANewId(), _gen );
newAlgo->SetHypothesis( this );
((StdMeshers_Adaptive1D*) this)->myAlgo = newAlgo;
//================================================================================
AdaptiveAlgo::AdaptiveAlgo(int hypId,
- int studyId,
SMESH_Gen* gen)
- : StdMeshers_Regular_1D( hypId, studyId, gen ),
+ : StdMeshers_Regular_1D( hypId, gen ),
myHyp(NULL)
{
_name = "AdaptiveAlgo_1D";
class STDMESHERS_EXPORT StdMeshers_Adaptive1D : public SMESH_Hypothesis
{
public:
- StdMeshers_Adaptive1D(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_Adaptive1D(int hypId, SMESH_Gen * gen);
~StdMeshers_Adaptive1D();
/*!
*/
//=============================================================================
-StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Arithmetic1D::StdMeshers_Arithmetic1D(int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_begLength = 1.;
_endLength = 10.;
public SMESH_Hypothesis
{
public:
- StdMeshers_Arithmetic1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Arithmetic1D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Arithmetic1D();
void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
*/
//=============================================================================
-StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_AutomaticLength::StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_name = "AutomaticLength";
_param_algo_dim = 1; // is used by SMESH_Regular_1D
class STDMESHERS_EXPORT StdMeshers_AutomaticLength:public SMESH_Hypothesis
{
public:
- StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_AutomaticLength(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_AutomaticLength();
/*!
//=======================================================================
StdMeshers_CartesianParameters3D::StdMeshers_CartesianParameters3D(int hypId,
- int studyId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen),
+ : SMESH_Hypothesis(hypId, gen),
_sizeThreshold( 4.0 ), // default according to the customer specification
_toAddEdges( false )
{
{
public:
// Constructor
- StdMeshers_CartesianParameters3D( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_CartesianParameters3D( int hypId, SMESH_Gen * gen );
/*!
* Sets coordinates of node positions along an axis (countered from 0)
*/
//=============================================================================
-StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Cartesian_3D::StdMeshers_Cartesian_3D(int hypId, SMESH_Gen * gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "Cartesian_3D";
_shapeType = (1 << TopAbs_SOLID); // 1 bit /shape type
class STDMESHERS_EXPORT StdMeshers_Cartesian_3D : public SMESH_3D_Algo
{
public:
- StdMeshers_Cartesian_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Cartesian_3D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
*/
//================================================================================
-StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "CompositeHexa_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
class STDMESHERS_EXPORT StdMeshers_CompositeHexa_3D: public SMESH_3D_Algo
{
public:
- StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen);
//virtual ~StdMeshers_CompositeHexa_3D();
virtual bool Compute(SMESH_Mesh& aMesh,
//=============================================================================
StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :StdMeshers_Regular_1D(hypId, studyId, gen)
+ :StdMeshers_Regular_1D(hypId, gen)
{
_name = AlgoName();
}
class STDMESHERS_EXPORT StdMeshers_CompositeSegment_1D: public StdMeshers_Regular_1D
{
public:
- StdMeshers_CompositeSegment_1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_CompositeSegment_1D(int hypId, SMESH_Gen* gen);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
//=============================================================================
StdMeshers_Deflection1D::StdMeshers_Deflection1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_value = 1.;
_name = "Deflection1D";
class STDMESHERS_EXPORT StdMeshers_Deflection1D:public SMESH_Hypothesis
{
public:
- StdMeshers_Deflection1D(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_Deflection1D(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_Deflection1D();
void SetDeflection(double value) throw(SALOME_Exception);
*/
//=============================================================================
-StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, int studyId,
+StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_name = "FixedPoints1D";
_param_algo_dim = 1;
public SMESH_Hypothesis
{
public:
- StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_FixedPoints1D();
void SetPoints(std::vector<double>& listParams)
*/
//=============================================================================
-StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen * gen)
- :StdMeshers_Reversible1D(hypId, studyId, gen)
+StdMeshers_Geometric1D::StdMeshers_Geometric1D(int hypId, SMESH_Gen * gen)
+ :StdMeshers_Reversible1D(hypId, gen)
{
_begLength = 1.;
_ratio = 1.;
class STDMESHERS_EXPORT StdMeshers_Geometric1D: public StdMeshers_Reversible1D
{
public:
- StdMeshers_Geometric1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Geometric1D(int hypId, SMESH_Gen* gen);
void SetStartLength(double length) throw(SALOME_Exception);
void SetCommonRatio(double factor) throw(SALOME_Exception);
//purpose :
//=======================================================================
-StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_HexaFromSkin_3D::StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "HexaFromSkin_3D";
}
class STDMESHERS_EXPORT StdMeshers_HexaFromSkin_3D : public SMESH_3D_Algo
{
public:
- StdMeshers_HexaFromSkin_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_HexaFromSkin_3D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_HexaFromSkin_3D();
virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
*/
//=============================================================================
-StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Hexa_3D::StdMeshers_Hexa_3D(int hypId, SMESH_Gen * gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "Hexa_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
TopExp::MapShapes( aShape, TopAbs_FACE, FF);
if ( FF.Extent() != 6)
{
- static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), 0, _gen);
+ static StdMeshers_CompositeHexa_3D compositeHexa(_gen->GetANewId(), _gen);
if ( !compositeHexa.Compute( aMesh, aShape ))
return error( compositeHexa.GetComputeError() );
return true;
// ---------------------
FaceQuadStructPtr quad[ 6 ];
- StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), GetStudyId(), _gen);
+ StdMeshers_Quadrangle_2D quadAlgo( _gen->GetANewId(), _gen);
for ( int i = 0; i < 6; ++i )
{
if ( !( quad[i] = FaceQuadStructPtr( quadAlgo.CheckNbEdges( aMesh, FF( i+1 ),
}
if (meshFaces.size() != 6) {
//return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in a block");
- static StdMeshers_CompositeHexa_3D compositeHexa(-10, 0, aMesh.GetGen());
+ static StdMeshers_CompositeHexa_3D compositeHexa(-10, aMesh.GetGen());
return compositeHexa.Evaluate(aMesh, aShape, aResMap);
}
static StdMeshers_HexaFromSkin_3D * algo = 0;
if ( !algo ) {
SMESH_Gen* gen = aMesh.GetGen();
- algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), 0, gen );
+ algo = new StdMeshers_HexaFromSkin_3D( gen->GetANewId(), gen );
}
algo->InitComputeError();
algo->Compute( aMesh, aHelper );
static StdMeshers_Prism_3D * aPrism3D = 0;
if ( !aPrism3D ) {
SMESH_Gen* gen = aMesh.GetGen();
- aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
+ aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
}
SMESH_Hypothesis::Hypothesis_Status aStatus;
if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
static StdMeshers_Prism_3D * aPrism3D = 0;
if ( !aPrism3D ) {
SMESH_Gen* gen = aMesh.GetGen();
- aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), 0, gen );
+ aPrism3D = new StdMeshers_Prism_3D( gen->GetANewId(), gen );
}
SMESH_Hypothesis::Hypothesis_Status aStatus;
if ( aPrism3D->CheckHypothesis( aMesh, aShape, aStatus ) ) {
class STDMESHERS_EXPORT StdMeshers_Hexa_3D : public SMESH_3D_Algo
{
public:
- StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Hexa_3D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Hexa_3D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=============================================================================
StdMeshers_ImportSource1D::StdMeshers_ImportSource1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen),
+ :SMESH_Hypothesis(hypId, gen),
_toCopyMesh(false),
_toCopyGroups(false)
{
//=============================================================================
StdMeshers_ImportSource2D::StdMeshers_ImportSource2D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :StdMeshers_ImportSource1D(hypId, studyId, gen)
+ :StdMeshers_ImportSource1D(hypId, gen)
{
_name = "ImportSource2D";
_param_algo_dim = 2; // is used by StdMeshers_Import_2D;
{
// filter off deleted groups
vector<SMESH_Group*> okGroups = getValidGroups( _groups,
- _gen->GetStudyContext(_studyId),
+ _gen->GetStudyContext(),
loaded);
if ( okGroups.size() != _groups.size() )
((StdMeshers_ImportSource1D*)this)->_groups = okGroups;
vector<SMESH_Mesh*> meshes;
if ( !meshIDs.empty() )
{
- StudyContextStruct* studyContext = _gen->GetStudyContext(_studyId);
+ StudyContextStruct* studyContext = _gen->GetStudyContext();
for ( set<int>::iterator id = meshIDs.begin(); id != meshIDs.end(); ++id )
{
map<int, SMESH_Mesh*>::iterator itm = studyContext->mapMesh.begin();
int key1 = _resultGroupsStorage[i++];
int key2 = _resultGroupsStorage[i++];
pair<int, int> resMapKey( key1, key2 );
- SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext(_studyId));
+ SMESH_Mesh* mesh = getTgtMeshByKey( resMapKey, _gen->GetStudyContext());
// restore mesh ids at least
_resultGroups.insert( make_pair (resMapKey,vector<SMESH_Group*>() ));
if ( key2groups == _resultGroups.end() )
return 0;
vector<SMESH_Group*> vec = getValidGroups((*key2groups).second,
- _gen->GetStudyContext(_studyId) );
+ _gen->GetStudyContext() );
if ( vec.size() != key2groups->second.size())
key2groups->second = vec;
class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis
{
public:
- StdMeshers_ImportSource1D(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_ImportSource1D(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_ImportSource1D();
void SetGroups(const std::vector<SMESH_Group*>& groups);
class STDMESHERS_EXPORT StdMeshers_ImportSource2D : public StdMeshers_ImportSource1D
{
public:
- StdMeshers_ImportSource2D(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_ImportSource2D(int hypId, SMESH_Gen * gen);
};
#endif
*/
//=============================================================================
-StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_1D_Algo(hypId, studyId, gen), _sourceHyp(0)
+StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, SMESH_Gen * gen)
+ :SMESH_1D_Algo(hypId, gen), _sourceHyp(0)
{
_name = "Import_1D";
_shapeType = (1 << TopAbs_EDGE);
class STDMESHERS_EXPORT StdMeshers_Import_1D: public SMESH_1D_Algo
{
public:
- StdMeshers_Import_1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Import_1D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
*/
//=============================================================================
-StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_2D_Algo(hypId, studyId, gen), _sourceHyp(0)
+StdMeshers_Import_1D2D::StdMeshers_Import_1D2D(int hypId, SMESH_Gen * gen)
+ :SMESH_2D_Algo(hypId, gen), _sourceHyp(0)
{
_name = "Import_1D2D";
_shapeType = (1 << TopAbs_FACE);
class STDMESHERS_EXPORT StdMeshers_Import_1D2D: public SMESH_2D_Algo
{
public:
- StdMeshers_Import_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Import_1D2D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
*/
//=============================================================================
-StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId, int studyId,
+StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "LayerDistribution"; // used by RadialPrism_3D
_param_algo_dim = 3; // 3D
{
public:
// Constructor
- StdMeshers_LayerDistribution( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_LayerDistribution( int hypId, SMESH_Gen * gen );
// Destructor
virtual ~StdMeshers_LayerDistribution();
//=============================================================================
StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(int hypId,
- int studyId,
SMESH_Gen * gen)
- : StdMeshers_LayerDistribution(hypId, studyId, gen)
+ : StdMeshers_LayerDistribution(hypId, gen)
{
_name = "LayerDistribution2D"; // used by RadialQuadrangle_1D2D
_param_algo_dim = 2; // 2D
{
public:
// Constructor
- StdMeshers_LayerDistribution2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_LayerDistribution2D(int hypId, SMESH_Gen* gen);
// Destructor
virtual ~StdMeshers_LayerDistribution2D();
*/
//=============================================================================
-StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_LengthFromEdges::StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_mode =1;
_name = "LengthFromEdges";
public SMESH_Hypothesis
{
public:
- StdMeshers_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_LengthFromEdges(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_LengthFromEdges();
void SetMode(int mode)
*/
//=============================================================================
-StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_LocalLength::StdMeshers_LocalLength(int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_length = 1.;
_precision = Precision::Confusion();
class STDMESHERS_EXPORT StdMeshers_LocalLength: public SMESH_Hypothesis
{
public:
- StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_LocalLength(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_LocalLength();
void SetLength(double length) throw(SALOME_Exception);
*/
//=============================================================================
-StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen * gen):
- SMESH_2D_Algo(hypId, studyId, gen)
+StdMeshers_MEFISTO_2D::StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen * gen):
+ SMESH_2D_Algo(hypId, gen)
{
_name = "MEFISTO_2D";
_shapeType = (1 << TopAbs_FACE);
class STDMESHERS_EXPORT StdMeshers_MEFISTO_2D: public SMESH_2D_Algo
{
public:
- StdMeshers_MEFISTO_2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_MEFISTO_2D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_MEFISTO_2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*/
//=============================================================================
-StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxElementArea::StdMeshers_MaxElementArea(int hypId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_maxArea =1.;
_name = "MaxElementArea";
class STDMESHERS_EXPORT StdMeshers_MaxElementArea:public SMESH_Hypothesis
{
public:
- StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_MaxElementArea(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_MaxElementArea();
void SetMaxArea(double maxArea) throw(SALOME_Exception);
*/
//=============================================================================
-StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxElementVolume::StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_maxVolume = 1.;
_name = "MaxElementVolume";
public SMESH_Hypothesis
{
public:
- StdMeshers_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_MaxElementVolume(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_MaxElementVolume();
void SetMaxVolume(double maxVolume)
*/
//=============================================================================
-StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_MaxLength::StdMeshers_MaxLength(int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_length = 1.;
_preestimated = 0.;
class STDMESHERS_EXPORT StdMeshers_MaxLength: public SMESH_Hypothesis
{
public:
- StdMeshers_MaxLength(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_MaxLength(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_MaxLength();
void SetLength(double length) throw(SALOME_Exception);
*/
//=============================================================================
-StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_NotConformAllowed::StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "NotConformAllowed";
_param_algo_dim = -1;
public SMESH_Hypothesis
{
public:
- StdMeshers_NotConformAllowed(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_NotConformAllowed(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_NotConformAllowed();
virtual std::ostream & SaveTo(std::ostream & save);
*/
//=============================================================================
-StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId, int studyId,
+StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "NumberOfLayers"; // used by RadialPrism_3D
_param_algo_dim = 3; // 3D
{
public:
// Constructor
- StdMeshers_NumberOfLayers( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_NumberOfLayers( int hypId, SMESH_Gen * gen );
// Destructor
virtual ~StdMeshers_NumberOfLayers();
//=============================================================================
StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(int hypId,
- int studyId,
SMESH_Gen * gen)
- : StdMeshers_NumberOfLayers(hypId, studyId, gen)
+ : StdMeshers_NumberOfLayers(hypId, gen)
{
_name = "NumberOfLayers2D"; // used by RadialQuadrangle_1D2D
_param_algo_dim = 2; // 2D
{
public:
// Constructor
- StdMeshers_NumberOfLayers2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_NumberOfLayers2D(int hypId, SMESH_Gen* gen);
// Destructor
virtual ~StdMeshers_NumberOfLayers2D();
};
//=============================================================================
StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int hypId,
- int studyId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen),
+ : SMESH_Hypothesis(hypId, gen),
_numberOfSegments(15),//issue 19923
_distrType(DT_Regular),
_scaleFactor(1.),
public SMESH_Hypothesis
{
public:
- StdMeshers_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_NumberOfSegments(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_NumberOfSegments();
// Builds point distribution according to passed function
//=======================================================================
StdMeshers_PolygonPerFace_2D::StdMeshers_PolygonPerFace_2D(int hypId,
- int studyId,
SMESH_Gen* gen)
- :SMESH_2D_Algo(hypId, studyId, gen)
+ :SMESH_2D_Algo(hypId, gen)
{
_name = "PolygonPerFace_2D";
}
class STDMESHERS_EXPORT StdMeshers_PolygonPerFace_2D: public SMESH_2D_Algo
{
public:
- StdMeshers_PolygonPerFace_2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_PolygonPerFace_2D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
*/
struct TQuadrangleAlgo : public StdMeshers_Quadrangle_2D
{
- TQuadrangleAlgo(int studyId, SMESH_Gen* gen)
- : StdMeshers_Quadrangle_2D( gen->GetANewId(), studyId, gen)
+ TQuadrangleAlgo(SMESH_Gen* gen)
+ : StdMeshers_Quadrangle_2D( gen->GetANewId(), gen)
{
}
static StdMeshers_Quadrangle_2D* instance( SMESH_Algo* fatherAlgo,
SMESH_MesherHelper* helper=0)
{
- static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetStudyId(),
- fatherAlgo->GetGen() );
+ static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetGen() );
if ( helper &&
algo->myProxyMesh &&
algo->myProxyMesh->GetMesh() != helper->GetMesh() )
{
StdMeshers_ProjectionSource1D myHyp;
- TProjction1dAlgo(int studyId, SMESH_Gen* gen)
- : StdMeshers_Projection_1D( gen->GetANewId(), studyId, gen),
- myHyp( gen->GetANewId(), studyId, gen)
+ TProjction1dAlgo(SMESH_Gen* gen)
+ : StdMeshers_Projection_1D( gen->GetANewId(), gen),
+ myHyp( gen->GetANewId(), gen)
{
StdMeshers_Projection_1D::_sourceHypo = & myHyp;
}
static TProjction1dAlgo* instance( SMESH_Algo* fatherAlgo )
{
- static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetStudyId(),
- fatherAlgo->GetGen() );
+ static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetGen() );
return algo;
}
};
{
StdMeshers_ProjectionSource2D myHyp;
- TProjction2dAlgo(int studyId, SMESH_Gen* gen)
- : StdMeshers_Projection_1D2D( gen->GetANewId(), studyId, gen),
- myHyp( gen->GetANewId(), studyId, gen)
+ TProjction2dAlgo(SMESH_Gen* gen)
+ : StdMeshers_Projection_1D2D( gen->GetANewId(), gen),
+ myHyp( gen->GetANewId(), gen)
{
StdMeshers_Projection_2D::_sourceHypo = & myHyp;
}
static TProjction2dAlgo* instance( SMESH_Algo* fatherAlgo )
{
- static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetStudyId(),
- fatherAlgo->GetGen() );
+ static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetGen() );
return algo;
}
const NSProjUtils::TNodeNodeMap& GetNodesMap()
//purpose :
//=======================================================================
-StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "Prism_3D";
_shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
class STDMESHERS_EXPORT StdMeshers_Prism_3D: public SMESH_3D_Algo
{
public:
- StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Prism_3D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*/
//=============================================================================
-StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId, int studyId,
+StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "ProjectionSource1D"; // used by Projection_1D
_param_algo_dim = 1; // 1D
{
public:
// Constructor
- StdMeshers_ProjectionSource1D( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_ProjectionSource1D( int hypId, SMESH_Gen * gen );
// Destructor
virtual ~StdMeshers_ProjectionSource1D();
*/
//=============================================================================
-StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId, int studyId,
+StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "ProjectionSource2D"; // used by Projection_2D
_param_algo_dim = 2; // 2D
{
public:
// Constructor
- StdMeshers_ProjectionSource2D( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_ProjectionSource2D( int hypId, SMESH_Gen * gen );
// Destructor
virtual ~StdMeshers_ProjectionSource2D();
*/
//=============================================================================
-StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId, int studyId,
+StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "ProjectionSource3D"; // used by Projection_3D
_param_algo_dim = 3; // 3D
{
public:
// Constructor
- StdMeshers_ProjectionSource3D( int hypId, int studyId, SMESH_Gen * gen );
+ StdMeshers_ProjectionSource3D( int hypId, SMESH_Gen * gen );
// Destructor
virtual ~StdMeshers_ProjectionSource3D();
//purpose :
//=======================================================================
-StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_1D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen)
+ :SMESH_1D_Algo(hypId, gen)
{
_name = "Projection_1D";
_shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
class STDMESHERS_EXPORT StdMeshers_Projection_1D: public SMESH_1D_Algo
{
public:
- StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Projection_1D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Projection_1D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//purpose :
//=======================================================================
-StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen)
- :StdMeshers_Projection_2D(hypId, studyId, gen)
+StdMeshers_Projection_1D2D::StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen)
+ :StdMeshers_Projection_2D(hypId, gen)
{
_name = "Projection_1D2D";
_requireDiscreteBoundary = false;
class STDMESHERS_EXPORT StdMeshers_Projection_1D2D: public StdMeshers_Projection_2D
{
public:
- StdMeshers_Projection_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Projection_1D2D(int hypId, SMESH_Gen* gen);
virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
//purpose :
//=======================================================================
-StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_2D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen)
+ :SMESH_2D_Algo(hypId, gen)
{
_name = "Projection_2D";
_compatibleHypothesis.push_back("ProjectionSource2D");
class STDMESHERS_EXPORT StdMeshers_Projection_2D: public SMESH_2D_Algo
{
public:
- StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Projection_2D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Projection_2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//purpose :
//=======================================================================
-StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_Projection_3D::StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "Projection_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type
class STDMESHERS_EXPORT StdMeshers_Projection_3D: public SMESH_3D_Algo
{
public:
- StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Projection_3D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Projection_3D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*/
//=============================================================================
-StdMeshers_Propagation::StdMeshers_Propagation (int hypId, int studyId, SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Propagation::StdMeshers_Propagation (int hypId, SMESH_Gen * gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = GetName();
_param_algo_dim = -1; // 1D auxiliary
}
StdMeshers_PropagOfDistribution::StdMeshers_PropagOfDistribution (int hypId,
- int studyId,
SMESH_Gen * gen)
- : StdMeshers_Propagation(hypId, studyId, gen) { _name = GetName(); }
+ : StdMeshers_Propagation(hypId, gen) { _name = GetName(); }
StdMeshers_Propagation::~StdMeshers_Propagation() {}
string StdMeshers_Propagation::GetName () { return "Propagation"; }
string StdMeshers_PropagOfDistribution::GetName () { return "PropagOfDistribution"; }
class STDMESHERS_EXPORT StdMeshers_Propagation : public SMESH_Hypothesis
{
public:
- StdMeshers_Propagation(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_Propagation(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_Propagation();
virtual std::ostream & SaveTo(std::ostream & save);
class STDMESHERS_EXPORT StdMeshers_PropagOfDistribution: public StdMeshers_Propagation
{
public:
- StdMeshers_PropagOfDistribution(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_PropagOfDistribution(int hypId, SMESH_Gen * gen);
static std::string GetName();
};
class StdMeshers_QuadFromMedialAxis_1D2D::Algo1D : public StdMeshers_Regular_1D
{
public:
- Algo1D(int studyId, SMESH_Gen* gen):
- StdMeshers_Regular_1D( gen->GetANewId(), studyId, gen )
+ Algo1D(SMESH_Gen* gen):
+ StdMeshers_Regular_1D( gen->GetANewId(), gen )
{
}
void SetSegmentLength( double len )
//================================================================================
StdMeshers_QuadFromMedialAxis_1D2D::StdMeshers_QuadFromMedialAxis_1D2D(int hypId,
- int studyId,
SMESH_Gen* gen)
- : StdMeshers_Quadrangle_2D(hypId, studyId, gen),
+ : StdMeshers_Quadrangle_2D(hypId, gen),
_regular1D( 0 )
{
_name = "QuadFromMedialAxis_1D2D";
}
// cout << "from salome.geom import geomBuilder" << endl;
- // cout << "geompy = geomBuilder.New(salome.myStudy)" << endl;
+ // cout << "geompy = geomBuilder.New()" << endl;
Handle(TColgp_HArray1OfPnt) points = new TColgp_HArray1OfPnt(1, pnt.size());
for ( size_t i = 0; i < pnt.size(); ++i )
{
SMESH_MAT2d::MedialAxis ma( F, sinuFace._sinuEdges, minSegLen, /*ignoreCorners=*/true );
if ( !_regular1D )
- _regular1D = new Algo1D( _studyId, _gen );
+ _regular1D = new Algo1D( _gen );
_regular1D->SetSegmentLength( minSegLen );
vector<double> maParams;
class STDMESHERS_EXPORT StdMeshers_QuadFromMedialAxis_1D2D: public StdMeshers_Quadrangle_2D
{
public:
- StdMeshers_QuadFromMedialAxis_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_QuadFromMedialAxis_1D2D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_QuadFromMedialAxis_1D2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*
*/
//=============================================================================
-StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
+StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId,
SMESH_Gen * gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
+ : SMESH_Hypothesis(hypId, gen)
{
_name = "QuadrangleParams";
_param_algo_dim = 2;
class STDMESHERS_EXPORT StdMeshers_QuadrangleParams: public SMESH_Hypothesis
{
public:
- StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_QuadrangleParams(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_QuadrangleParams();
void SetTriaVertex (int id);
//=============================================================================
StdMeshers_QuadranglePreference::StdMeshers_QuadranglePreference(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_name = "QuadranglePreference";
_param_algo_dim = -2; // auxiliary used by NETGEN 2D
class STDMESHERS_EXPORT StdMeshers_QuadranglePreference:public SMESH_Hypothesis
{
public:
- StdMeshers_QuadranglePreference(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_QuadranglePreference(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_QuadranglePreference();
virtual std::ostream & SaveTo(std::ostream & save);
*/
//=============================================================================
-StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId, int studyId,
+StdMeshers_Quadrangle_2D::StdMeshers_Quadrangle_2D (int hypId,
SMESH_Gen* gen)
- : SMESH_2D_Algo(hypId, studyId, gen),
+ : SMESH_2D_Algo(hypId, gen),
myQuadranglePreference(false),
myTrianglePreference(false),
myTriaVertexID(-1),
class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo
{
public:
- StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Quadrangle_2D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Quadrangle_2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=============================================================================
StdMeshers_QuadraticMesh::StdMeshers_QuadraticMesh(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_name = "QuadraticMesh";
_param_algo_dim = -1; // it means auxiliary, dim = 1
class STDMESHERS_EXPORT StdMeshers_QuadraticMesh:public SMESH_Hypothesis
{
public:
- StdMeshers_QuadraticMesh(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_QuadraticMesh(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_QuadraticMesh();
virtual std::ostream & SaveTo(std::ostream & save);
//purpose :
//=======================================================================
-StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "RadialPrism_3D";
_shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
const int myID = -1000;
TNodeDistributor* myHyp = dynamic_cast<TNodeDistributor*>( aMesh.GetHypothesis( myID ));
if ( !myHyp )
- myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
+ myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
return myHyp;
}
// -----------------------------------------------------------------------------
}
protected:
// -----------------------------------------------------------------------------
- TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
- : StdMeshers_Regular_1D( hypId, studyId, gen)
+ TNodeDistributor( int hypId, SMESH_Gen* gen)
+ : StdMeshers_Regular_1D( hypId, gen)
{
}
// -----------------------------------------------------------------------------
class STDMESHERS_EXPORT StdMeshers_RadialPrism_3D: public SMESH_3D_Algo
{
public:
- StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_RadialPrism_3D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_RadialPrism_3D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=======================================================================
StdMeshers_RadialQuadrangle_1D2D::StdMeshers_RadialQuadrangle_1D2D(int hypId,
- int studyId,
SMESH_Gen* gen)
- :StdMeshers_Quadrangle_2D( hypId, studyId, gen )
+ :StdMeshers_Quadrangle_2D( hypId, gen )
{
_name = "RadialQuadrangle_1D2D";
_shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
const int myID = -1001;
TNodeDistributor* myHyp = dynamic_cast<TNodeDistributor*>( aMesh.GetHypothesis( myID ));
if ( !myHyp )
- myHyp = new TNodeDistributor( myID, 0, aMesh.GetGen() );
+ myHyp = new TNodeDistributor( myID, aMesh.GetGen() );
return myHyp;
}
// -----------------------------------------------------------------------------
}
protected:
// -----------------------------------------------------------------------------
- TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen)
- : StdMeshers_Regular_1D( hypId, studyId, gen)
+ TNodeDistributor( int hypId, SMESH_Gen* gen)
+ : StdMeshers_Regular_1D( hypId, gen)
{
}
// -----------------------------------------------------------------------------
class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public StdMeshers_Quadrangle_2D
{
public:
- StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_RadialQuadrangle_1D2D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_RadialQuadrangle_1D2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=============================================================================
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_1D_Algo( hypId, studyId, gen )
+ :SMESH_1D_Algo( hypId, gen )
{
_name = "Regular_1D";
_shapeType = (1 << TopAbs_EDGE);
double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
static StdMeshers_Regular_1D* auxAlgo = 0;
if ( !auxAlgo ) {
- auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _studyId, _gen );
+ auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _gen );
auxAlgo->_hypType = BEG_END_LENGTH;
}
auxAlgo->_value[ BEG_LENGTH_IND ] = Lm;
class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
{
public:
- StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Regular_1D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_Regular_1D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
*/
//=============================================================================
-StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+StdMeshers_Reversible1D::StdMeshers_Reversible1D(int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_param_algo_dim = 1;
}
class STDMESHERS_EXPORT StdMeshers_Reversible1D : public SMESH_Hypothesis
{
public:
- StdMeshers_Reversible1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_Reversible1D(int hypId, SMESH_Gen* gen);
void SetReversedEdges( const std::vector<int>& ids);
//=======================================================================
StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
- (int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_0D_Algo(hypId, studyId, gen)
+ (int hypId, SMESH_Gen* gen)
+ :SMESH_0D_Algo(hypId, gen)
{
_name = "SegmentAroundVertex_0D";
// it is assigned to vertices but influence a state of EDGE submeshes
class STDMESHERS_EXPORT StdMeshers_SegmentAroundVertex_0D: public SMESH_0D_Algo
{
public:
- StdMeshers_SegmentAroundVertex_0D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_SegmentAroundVertex_0D(int hypId, SMESH_Gen* gen);
virtual ~StdMeshers_SegmentAroundVertex_0D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
//=============================================================================
StdMeshers_SegmentLengthAroundVertex::StdMeshers_SegmentLengthAroundVertex
- (int hypId, int studyId, SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ (int hypId, SMESH_Gen * gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_length = 1.;
_name = "SegmentLengthAroundVertex";
class STDMESHERS_EXPORT StdMeshers_SegmentLengthAroundVertex:public SMESH_Hypothesis
{
public:
- StdMeshers_SegmentLengthAroundVertex(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_SegmentLengthAroundVertex(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_SegmentLengthAroundVertex();
void SetLength(double length) throw(SALOME_Exception);
//=============================================================================
StdMeshers_StartEndLength::StdMeshers_StartEndLength(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_Hypothesis(hypId, studyId, gen)
+ :SMESH_Hypothesis(hypId, gen)
{
_begLength = 1.;
_endLength = 10.;
class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
{
public:
- StdMeshers_StartEndLength(int hypId, int studyId, SMESH_Gen * gen);
+ StdMeshers_StartEndLength(int hypId, SMESH_Gen * gen);
virtual ~ StdMeshers_StartEndLength();
void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
//=======================================================================
StdMeshers_UseExisting_1D::StdMeshers_UseExisting_1D
- (int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_1D_Algo(hypId, studyId, gen)
+ (int hypId, SMESH_Gen* gen)
+ :SMESH_1D_Algo(hypId, gen)
{
_name = "UseExisting_1D";
_shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
//=======================================================================
StdMeshers_UseExisting_2D::StdMeshers_UseExisting_2D
- (int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_2D_Algo(hypId, studyId, gen)
+ (int hypId, SMESH_Gen* gen)
+ :SMESH_2D_Algo(hypId, gen)
{
_name = "UseExisting_2D";
_shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
class STDMESHERS_EXPORT StdMeshers_UseExisting_2D: public SMESH_2D_Algo
{
public:
- StdMeshers_UseExisting_2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_UseExisting_2D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
class STDMESHERS_EXPORT StdMeshers_UseExisting_1D: public SMESH_1D_Algo
{
public:
- StdMeshers_UseExisting_1D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_UseExisting_1D(int hypId, SMESH_Gen* gen);
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
//================================================================================
// StdMeshers_ViscousLayers hypothesis
//
-StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_Hypothesis(hypId, studyId, gen),
+StdMeshers_ViscousLayers::StdMeshers_ViscousLayers(int hypId, SMESH_Gen* gen)
+ :SMESH_Hypothesis(hypId, gen),
_isToIgnoreShapes(1), _nbLayers(1), _thickness(1), _stretchFactor(1),
_method( SURF_OFFSET_SMOOTH )
{
py = _pyStream = new ofstream(fname);
*py << "import SMESH" << endl
<< "from salome.smesh import smeshBuilder" << endl
- << "smesh = smeshBuilder.New(salome.myStudy)" << endl
- << "meshSO = smesh.GetCurrentStudy().FindObjectID('0:1:2:" << tag <<"')" << endl
+ << "smesh = smeshBuilder.New()" << endl
+ << "meshSO = salome.myStudy.FindObjectID('0:1:2:" << tag <<"')" << endl
<< "mesh = smesh.Mesh( meshSO.GetObject() )"<<endl;
theNbPyFunc = 0;
}
class STDMESHERS_EXPORT StdMeshers_ViscousLayers : public SMESH_Hypothesis
{
public:
- StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_ViscousLayers(int hypId, SMESH_Gen* gen);
// Set boundary shapes (faces in 3D, edges in 2D) either to exclude from
// treatment or to make the Viscous Layers on
//================================================================================
// StdMeshers_ViscousLayers hypothesis
//
-StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D(int hypId, int studyId, SMESH_Gen* gen)
- :StdMeshers_ViscousLayers(hypId, studyId, gen)
+StdMeshers_ViscousLayers2D::StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen)
+ :StdMeshers_ViscousLayers(hypId, gen)
{
_name = StdMeshers_ViscousLayers2D::GetHypType();
_param_algo_dim = -2; // auxiliary hyp used by 2D algos
// --------------------------------------------------------------------------------
void StdMeshers_ViscousLayers2D::RestoreListeners() const
{
- StudyContextStruct* sc = _gen->GetStudyContext( _studyId );
+ StudyContextStruct* sc = _gen->GetStudyContext();
std::map < int, SMESH_Mesh * >::iterator i_smesh = sc->mapMesh.begin();
for ( ; i_smesh != sc->mapMesh.end(); ++i_smesh )
{
class STDMESHERS_EXPORT StdMeshers_ViscousLayers2D : public StdMeshers_ViscousLayers
{
public:
- StdMeshers_ViscousLayers2D(int hypId, int studyId, SMESH_Gen* gen);
+ StdMeshers_ViscousLayers2D(int hypId, SMESH_Gen* gen);
/*!
* \brief Computes temporary 2D mesh to be used by 2D algorithm.
* Return SMESH_ProxyMesh for the given FACE, or NULL in case of error
${QWT_LIBRARY}
SalomeIDLSMESH
SMESHFiltersSelection
+ SMESHEngine
SMESH
SMESHObject
)
SMESH::SMESH_Gen_var gen = mySMESHGUI->GetSMESHGen();
// avoid publishing a new 1D hyp
- gen->SetCurrentStudy( SALOMEDS::Study::_nil() );
+ gen->SetEnablePublish( false );
// create a hyp
HypothesisData* aHypData = 0;
}
// restore current study
- mySMESHGUI->GetSMESHGen();
+ gen->SetEnablePublish( true );
onEdit();
}
for ( unsigned i = 0; i < objects->length(); ++i )
{
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
_PTR(SObject) aSObj = aStudy->FindObjectID(objects[i].in());
- CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
+ CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
if ( !CORBA::is_nil( anObj )) {
std::string name = aSObj->GetName();
QString text = myObjNameLineEdit->text();
GEOM::GEOM_Object_var face = w->GetObject< GEOM::GEOM_Object >();
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ _PTR(Study) aStudy = SMESH::getStudy();
GEOM::GEOM_IShapesOperations_wrap shapeOp;
if ( !geomGen->_is_nil() && aStudy )
- shapeOp = geomGen->GetIShapesOperations( aStudy->StudyId() );
+ shapeOp = geomGen->GetIShapesOperations();
if ( !shapeOp->_is_nil() )
{
GEOM::ListOfLong_var vertices =
GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry )
{
GEOM::GEOM_Object_var aGeomObj;
- SALOMEDS::Study_var aStudy = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
- if ( !aStudy->_is_nil() )
+ SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.toLatin1().data() );
+ if (!aSObj->_is_nil() )
{
- SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( theEntry.toLatin1().data() );
- if (!aSObj->_is_nil() )
- {
- CORBA::Object_var obj = aSObj->GetObject();
- aGeomObj = GEOM::GEOM_Object::_narrow(obj);
- aSObj->UnRegister();
- }
+ CORBA::Object_var obj = aSObj->GetObject();
+ aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+ aSObj->UnRegister();
}
return aGeomObj._retn();
}
//=======================================================================
StdMeshers_Adaptive1D_i::StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Adaptive1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Adaptive1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Adaptive1D_i();
//=============================================================================
StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Arithmetic1D_i();
//=============================================================================
StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_AutomaticLength( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_AutomaticLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_AutomaticLength_i();
StdMeshers_CartesianParameters3D_i::
StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_CartesianParameters3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_CartesianParameters3D_i();
//=============================================================================
StdMeshers_Cartesian_3D_i::StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Cartesian_3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Cartesian_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
StdMeshers_CompositeSegment_1D_i::StdMeshers_CompositeSegment_1D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_CompositeSegment_1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_CompositeSegment_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_CompositeSegment_1D_i();
//=============================================================================
StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Deflection1D_i();
//=============================================================================
StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_FixedPoints1D_i();
//=============================================================================
StdMeshers_Geometric1D_i::StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
StdMeshers_Reversible1D_i( this )
{
myBaseImpl = new ::StdMeshers_Geometric1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Geometric1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
void SetStartLength(CORBA::Double length) throw(SALOME::SALOME_Exception);
//=============================================================================
StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Hexa_3D_i();
//=============================================================================
StdMeshers_ImportSource1D_i::StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ImportSource1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
_groupEntries = new SMESH::string_array();
}
{
std::vector<SMESH_Group*> smesh_groups;
std::vector<string> entries;
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
for ( CORBA::ULong i = 0; i < groups.length(); ++i )
if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
{
THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
smesh_groups.push_back( gp_i->GetSmeshGroup() );
- SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
+ SALOMEDS::SObject_wrap so = SMESH_Gen_i::ObjectToSObject(groups[i]);
if ( !so->_is_nil())
{
CORBA::String_var entry = so->GetID();
std::ostringstream os;
os << " " << _groupEntries->length();
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
for ( size_t i = 0; i < _groupEntries->length(); ++i )
{
// entry
os << " " << _groupEntries[i];
// id
- SALOMEDS::SObject_wrap groupSO = study->FindObjectID( _groupEntries[i] );
+ SALOMEDS::SObject_wrap groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
CORBA::Object_var groupObj;
if ( !groupSO->_is_nil() )
groupObj = groupSO->GetObject();
public:
// Constructor
StdMeshers_ImportSource1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ImportSource1D_i();
//=============================================================================
StdMeshers_ImportSource2D_i::StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ImportSource2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
_groupEntries = new SMESH::string_array();
}
{
std::vector<SMESH_Group*> smesh_groups;
std::vector<string> entries;
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
for ( CORBA::ULong i = 0; i < groups.length(); ++i )
if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i] ))
{
THROW_SALOME_CORBA_EXCEPTION("Wrong group type", SALOME::BAD_PARAM);
smesh_groups.push_back( gp_i->GetSmeshGroup() );
- SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(study, groups[i]);
+ SALOMEDS::SObject_var so = SMESH_Gen_i::ObjectToSObject(groups[i]);
if ( !so->_is_nil())
{
CORBA::String_var entry = so->GetID();
std::ostringstream os;
os << " " << _groupEntries->length();
- SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy();
for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i )
{
// entry
os << " " << _groupEntries[i];
// id
- SALOMEDS::SObject_var groupSO = study->FindObjectID( _groupEntries[i] );
+ SALOMEDS::SObject_var groupSO = SMESH_Gen_i::getStudyServant()->FindObjectID( _groupEntries[i] );
CORBA::Object_var groupObj;
if ( !groupSO->_is_nil() ) {
groupObj = groupSO->GetObject();
public:
// Constructor
StdMeshers_ImportSource2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ImportSource2D_i();
//=============================================================================
StdMeshers_Import_1D2D_i::StdMeshers_Import_1D2D_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Import_1D2D(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Import_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
//=============================================================================
StdMeshers_Import_1D_i::StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Import_1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Import_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Import_1D_i();
StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
:SMESH_Hypothesis_i( thePOA ),
- StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
+ StdMeshers_LayerDistribution_i(thePOA, theGenImpl)
{
myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
StdMeshers_LayerDistribution2D_i(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_LayerDistribution2D_i();
//=============================================================================
StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
// Remove SO of 1D hypothesis if it was published
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
{
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- SALOMEDS::SObject_var SO = gen->ObjectToSObject( study, hyp1D );
+ SALOMEDS::SObject_var SO = gen->ObjectToSObject( hyp1D );
if ( ! SO->_is_nil() )
{
- SALOMEDS::StudyBuilder_var builder = study->NewBuilder();
+ SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::getStudyServant()->NewBuilder();
builder->RemoveObjectWithChildren( SO );
SO->UnRegister();
}
is >> libName )
{
SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var curStudy = gen->GetCurrentStudy();
- gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // prevent hypo publishing
+ gen->SetEnablePublish( false ); // prevent hypo publishing
try {
SMESH::SMESH_Hypothesis_var hyp1D =
}
catch (...) {
}
- gen->SetCurrentStudy( curStudy ); // enable hypo publishing
+ gen->SetEnablePublish( true ); // enable hypo publishing
}
}
public:
// Constructor
StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_LayerDistribution_i();
//=============================================================================
StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_LengthFromEdges_i();
//=============================================================================
StdMeshers_LocalLength_i::StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_LocalLength( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_LocalLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_LocalLength_i();
//=============================================================================
StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MEFISTO_2D_i();
//=============================================================================
StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MaxElementArea_i();
//=============================================================================
StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MaxElementVolume_i();
//=============================================================================
StdMeshers_MaxLength_i::StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_MaxLength( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_MaxLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MaxLength_i();
StdMeshers_NotConformAllowed_i::StdMeshers_NotConformAllowed_i
(PortableServer::POA_ptr thePOA,
- int studyId,
::SMESH_Gen* genImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_NotConformAllowed(genImpl->GetANewId(),
- studyId,
genImpl);
}
{
public:
StdMeshers_NotConformAllowed_i(PortableServer::POA_ptr thePOA,
- int studyId,
::SMESH_Gen* genImpl);
virtual ~StdMeshers_NotConformAllowed_i();
StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
:SMESH_Hypothesis_i( thePOA ),
- StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
+ StdMeshers_NumberOfLayers_i(thePOA, theGenImpl)
{
myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
StdMeshers_NumberOfLayers2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfLayers2D_i();
//=============================================================================
StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_NumberOfLayers( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfLayers_i();
//=============================================================================
StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfSegments_i();
// try by entry
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- if ( ! theEntry.empty() && ! study->_is_nil() ) {
- SALOMEDS::SObject_wrap sobj = study->FindObjectID( theEntry.c_str() );
+ if ( ! theEntry.empty() ) {
+ SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.c_str() );
CORBA::Object_var obj = gen->SObjectToObject( sobj );
geom = GEOM::GEOM_Object::_narrow( obj );
}
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
GEOM::GEOM_Object_var geom = gen->ShapeToGeomObject( theShape );
if ( ! geom->_is_nil() ) {
- SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( gen->GetCurrentStudy(), geom );
+ SALOMEDS::SObject_wrap sobj = gen->ObjectToSObject( geom );
if ( !sobj->_is_nil() ) {
CORBA::String_var entry = sobj->GetID();
stream << " " << entry.in();
if ( entry )
* entry = str;
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- if ( ! study->_is_nil() ) {
- SALOMEDS::SObject_wrap sobj = study->FindObjectID( str.c_str() );
- CORBA::Object_var obj = gen->SObjectToObject( sobj );
- GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj );
- return gen->GeomObjectToShape( geom.in() );
- }
+ SALOMEDS::SObject_wrap sobj = SMESH_Gen_i::getStudyServant()->FindObjectID( str.c_str() );
+ CORBA::Object_var obj = gen->SObjectToObject( sobj );
+ GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj );
+ return gen->GeomObjectToShape( geom.in() );
}
}
if ( entry )
if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
std::string str;
if (stream >> str) {
- if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) {
+ if ( StudyContext* myStudyContext = gen->GetStudyContext() ) {
std::string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() ));
if ( !ior.empty() )
return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() ));
//=============================================================================
StdMeshers_PolygonPerFace_2D_i::StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_PolygonPerFace_2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_PolygonPerFace_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_PolygonPerFace_2D_i();
//=============================================================================
StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
//=============================================================================
StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
public:
// Constructor
StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_ProjectionSource1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ProjectionSource1D_i();
StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_ProjectionSource2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ProjectionSource2D_i();
StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_ProjectionSource3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ProjectionSource3D_i();
//=============================================================================
StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_3D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//-----------------------------------------------------------------------------
//=============================================================================
StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//-----------------------------------------------------------------------------
//=============================================================================
StdMeshers_Projection_1D2D_i::StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Projection_1D2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
//=============================================================================
StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//-----------------------------------------------------------------------------
public:
// Constructor
StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_Projection_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
*/
//=============================================================================
StdMeshers_Propagation_i::StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Propagation(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
//=============================================================================
StdMeshers_PropagOfDistribution_i::
StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_PropagOfDistribution(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
StdMeshers_Propagation_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl);
// Verify whether hypothesis supports given entity type
public:
// Constructor
StdMeshers_PropagOfDistribution_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl);
// Verify whether hypothesis supports given entity type
StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl);
}
public:
// Constructor
StdMeshers_QuadrangleParams_i (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~StdMeshers_QuadrangleParams_i();
StdMeshers_QuadranglePreference_i::StdMeshers_QuadranglePreference_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl ): SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_QuadranglePreference( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_QuadranglePreference_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_QuadranglePreference_i();
//=============================================================================
StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
StdMeshers_QuadFromMedialAxis_1D2D_i::
StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_QuadFromMedialAxis_1D2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_QuadFromMedialAxis_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
StdMeshers_QuadraticMesh_i::StdMeshers_QuadraticMesh_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_QuadraticMesh( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_QuadraticMesh_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_QuadraticMesh_i();
StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_RadialQuadrangle_1D2D(theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_RadialQuadrangle_1D2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
//=============================================================================
StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_Regular_1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Regular_1D_i();
StdMeshers_SegmentAroundVertex_0D_i::StdMeshers_SegmentAroundVertex_0D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_0D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_SegmentAroundVertex_0D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
public:
// Constructor
StdMeshers_SegmentAroundVertex_0D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_SegmentAroundVertex_0D_i();
StdMeshers_SegmentLengthAroundVertex_i::StdMeshers_SegmentLengthAroundVertex_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_SegmentLengthAroundVertex( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_SegmentLengthAroundVertex_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_SegmentLengthAroundVertex_i();
//=============================================================================
StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_StartEndLength( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
StdMeshers_StartEndLength_i(PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_StartEndLength_i();
StdMeshers_UseExisting_1D_i::StdMeshers_UseExisting_1D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_1D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_UseExisting_1D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
StdMeshers_UseExisting_2D_i::StdMeshers_UseExisting_2D_i
( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
myBaseImpl = new ::StdMeshers_UseExisting_2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
public:
// Constructor
StdMeshers_UseExisting_1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
public:
// Constructor
StdMeshers_UseExisting_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
//=============================================================================
StdMeshers_ViscousLayers2D_i::StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ViscousLayers2D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_ViscousLayers2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ViscousLayers2D_i();
//=============================================================================
StdMeshers_ViscousLayers_i::StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
myBaseImpl = new ::StdMeshers_ViscousLayers( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
public:
// Constructor
StdMeshers_ViscousLayers_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_ViscousLayers_i();
{
public:
virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl)
{
StdMeshers_QuadrangleParams_i* h =
- new StdMeshers_QuadrangleParams_i( thePOA, theStudyId, theGenImpl);
+ new StdMeshers_QuadrangleParams_i( thePOA, theGenImpl);
h->SetQuadType( TYPE );
return h;
}
import SMESH
from salome.kernel import studyedit
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
if not os.path.isfile(self.fichierOut):
QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
- maStudy=studyedit.getActiveStudy()
- smesh.SetCurrentStudy(maStudy)
+ maStudy=salome.myStudy
(outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
name=str(self.LE_MeshSmesh.text())
initialMeshFile=None
newLink=monStudyBuilder.NewObject(SOMesh)
monStudyBuilder.Addreference(newLink, newStudyIter)
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num+=1
return True
ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
ACmt.SetValue(datai)
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num += 1
if verbose: print("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai))
return True
QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
if verbose: print("save hypothesis in Object Browser")
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
- maStudy=studyedit.getActiveStudy()
- smesh.SetCurrentStudy(maStudy)
+ maStudy=salome.myStudy
self.editor = studyedit.getStudyEditor()
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
notebook.set("MGCleaner_%i" % self.num, data)
"""
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num += 1
if verbose: print("save %s in Object Browser done:\n%s" % (name, data))
return True
from salome.smesh.smeshstudytools import SMeshStudyTools
from salome.gui import helper as guihelper
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
mySObject, myEntry = guihelper.getSObjectSelected()
if CORBA.is_nil(mySObject) or mySObject==None:
import SMESH
from salome.kernel import studyedit
salome.salome_init()
- maStudy=studyedit.getActiveStudy()
+ maStudy=salome.myStudy
#etc...a mano...
#
# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
def MGCleanerLct(context):
- # get context study, studyId, salomeGui
+ # get context study, salomeGui
study = context.study
- studyId = context.studyId
sg = context.sg
import os
import math, Config
from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
import CompositeBox
from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New( Config.theStudy )
+smesh = smeshBuilder.New()
##########################################################################################################
import GenFunctions, Config
from salome.geom import geomBuilder
- geompy = geomBuilder.New( Config.theStudy )
+ geompy = geomBuilder.New()
if type(Criterion) is str :
Crit = {'South' : lambda : 0,
import Config
from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New( Config.theStudy )
+smesh = smeshBuilder.New()
##########################################################################################################
# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
def MeshCut(context):
- # get context study, studyId, salomeGui
+ # get context study, salomeGui
study = context.study
- studyId = context.studyId
sg = context.sg
import os
fichierMedResult = 'fichierMed.med'
getStatsMaillage(monMaillage,fichierMedResult)
getStatsGroupes(monMaillage,fichierMedResult)
- getStatsCritere(dimMaillage,monMaillage,fichierMedResult,theStudy)
+ getStatsCritere(dimMaillage,monMaillage,fichierMedResult)
Lancement du script de comparaison
-----------------------------------
from getStats import getGroupesRef
from Type_Maille import dicoDimENtite
-def getCritere(dim,NomMesh,acritere,theStudy):
+def getCritere(dim,NomMesh,acritere):
import SMESH
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(theStudy)
+ smesh = smeshBuilder.New()
import numpy
# print dim,NomMesh,acritere
if dim == 2 :
return [max,min,Q1,M,Q3,moyenne]
-def getCritereGroupe(NomMesh,NomGr,acritere,theStudy):
+def getCritereGroupe(NomMesh,NomGr,acritere):
import SMESH
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(theStudy)
+ smesh = smeshBuilder.New()
import numpy
# on ne traite que les mailles 2D et 3D
return [max,min,Q1,M,Q3,moyenne]
-def getObjectsGroupe(Mesh,liste,theStudy):
+def getObjectsGroupe(Mesh,liste):
import SMESH
from salome.smesh import smeshBuilder
dico={}
if name == n : dico[name]=g
return dico
-def getStatsCritere(dim,Mesh,fichierMedResult,theStudy):
+def getStatsCritere(dim,Mesh,fichierMedResult):
fichierStatRatio=fichierMedResult.replace('.med','.ratio')
- max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio",theStudy)
+ max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Ratio")
f = open(fichierStatRatio, 'w')
f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
f.close()
fichierStatRatio=fichierMedResult.replace('.med','.taille')
- max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length",theStudy)
+ max,min,Q1,M,Q3,moyenne = getCritere(dim,Mesh,"Length")
f = open(fichierStatRatio, 'w')
f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
f.close()
liste=getGroupesRef(fichierMedResult)
- dicoGroupe=getObjectsGroupe(Mesh,liste,theStudy)
+ dicoGroupe=getObjectsGroupe(Mesh,liste)
for groupe in liste :
- max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio",theStudy)
+ max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Ratio")
extension="_"+groupe+'_Ratio.res'
fichier=fichierMedResult.replace('.med',extension)
f = open(fichier, 'w')
f.write(str(max)+","+str(min)+","+str(Q1)+","+str(M)+","+str(Q3)+","+str(moyenne))
f.close()
- max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length",theStudy)
+ max,min,Q1,M,Q3,moyenne=getCritereGroupe(Mesh,dicoGroupe[groupe],"Length")
extension="_"+groupe+'_Taille.res'
fichier=fichierMedResult.replace('.med',extension)
f = open(fichier, 'w')
import SMESH
from salome.kernel import studyedit
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
if not os.path.isfile(self.fichierOut):
QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
- maStudy=studyedit.getActiveStudy()
- smesh.SetCurrentStudy(maStudy)
+ maStudy=salome.myStudy
+ smesh.UpdateStudy()
(outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
name=str(self.LE_MeshSmesh.text())
initialMeshFile=None
newLink=monStudyBuilder.NewObject(SOMesh)
monStudyBuilder.Addreference(newLink, newStudyIter)
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num+=1
return True
ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
ACmt.SetValue(datai)
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num += 1
if verbose: print("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai))
return True
QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
if verbose: print("save hypothesis in Object Browser")
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
- maStudy=studyedit.getActiveStudy()
- smesh.SetCurrentStudy(maStudy)
+ maStudy=salome.myStudy
+ smesh.UpdateStudy()
self.editor = studyedit.getStudyEditor()
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
data = self.getResumeData(separator=" ; ")
self.editor.setAttributeValue(newStudyIter, "AttributeComment", data)
- if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(False)
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
self.num += 1
if verbose: print("save %s in Object Browser done:\n%s" % (name, data))
return True
from salome.smesh.smeshstudytools import SMeshStudyTools
from salome.gui import helper as guihelper
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New(salome.myStudy)
+ smesh = smeshBuilder.New()
mySObject, myEntry = guihelper.getSObjectSelected()
if CORBA.is_nil(mySObject) or mySObject==None:
# if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
def YamsLct(context):
- # get context study, studyId, salomeGui
+ # get context study, salomeGui
study = context.study
- studyId = context.studyId
sg = context.sg
import os
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
###
### GEOM component
import math
import SALOMEDS
-
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
boite = smesh.Mesh(Box_1)
Regular_1D = boite.Segment()
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
\ No newline at end of file
+ salome.sg.updateObjBrowser()
\ No newline at end of file
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
logging.info("maillage fissure fini")
#TODO: a compléter
"""
logging.info('start')
-
- #smesh.SetCurrentStudy(salome.myStudy)
geometrieSaine = geometriesSaines[0]
maillageSain = maillagesSains[0]
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
# logging.debug("initialisation de geompy et smesh OK")
logging.info("fichier maillage fissure : %s", fichierMaillageFissure)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
return maillageComplet
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
logging.info("maillage fissure fini")
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
return maillageComplet
\ No newline at end of file
from blocFissure import gmu
def fissureCoudeDlg(context):
- # get context study, studyId, salomeGui
+ # get context study, salomeGui
study = context.study
- studyId = context.studyId
sg = context.sg
import os
from blocFissure import gmu
def fissureGeneraleDlg(context):
- # get context study, studyId, salomeGui
+ # get context study, salomeGui
study = context.study
- studyId = context.studyId
sg = context.sg
import os
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
execInstance = casStandard(dicoParams)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
import os
from blocFissure import gmu
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(Box_1)
Regular_1D = Mesh_1.Segment()
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
import os
from blocFissure import gmu
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
cubeFin_1 = smesh.Mesh(cubeFin)
Regular_1D = cubeFin_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
cubeFin_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/cubeFin.med"), 0, SMESH.MED_V2_2, 1 )
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
smeshObj_1.SetNumberOfSegments( 5 )
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Disque_1 = smesh.Mesh(Disque)
Regular_1D = Disque_1.Segment()
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
import os
from blocFissure import gmu
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import math
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
Disk_1 = geompy.MakeDiskR(100, 1)
O = geompy.MakeVertex(0, 0, 0)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
Regular_1D = EprouvetteCourbe_1.Segment()
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
-notebook = salome_notebook.NoteBook(theStudy)
import os
from blocFissure import gmu
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
Regular_1D = eprouvetteDroite_1.Segment()
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
objetSain_1 = smesh.Mesh(objetSain)
Regular_1D = objetSain_1.Segment()
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(objetSain)
Regular_1D = Mesh_1.Segment()
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
import salome
salome.salome_init()
-theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.notebook
import SALOMEDS
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(theStudy)
+smesh = smeshBuilder.New()
coupe_vis_1 = smesh.Mesh(coupe_vis)
Regular_1D = coupe_vis_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
{
void demo(in double a,in double b,out double c) raises (SALOME::SALOME_Exception);
boolean testkernel() raises (SALOME::SALOME_Exception);
- boolean testsmesh(in long studyId) raises (SALOME::SALOME_Exception);
+ boolean testsmesh() raises (SALOME::SALOME_Exception);
};
};
* This test checks the constructor of the basic classes of the SMESH
* plugin for PADDER.
*/
-bool SPADDERPluginTester_i::testsmesh(CORBA::Long studyId)
+bool SPADDERPluginTester_i::testsmesh()
{
beginService("SPADDERPluginTester_i::testsmesh");
// Resolve the SMESH engine and the SALOME study
// _WARN_ The SMESH engine should have been loaded first
SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
- CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
- SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(studyId);
+ CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study");
+ SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(anObject);
//
// _MEM_ CAUTION: SMESH_Gen define a data structure for local usage
void demo(CORBA::Double a,CORBA::Double b,CORBA::Double& c);
bool testkernel();
- bool testsmesh(CORBA::Long studyId);
+ bool testsmesh();
};
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
filename="/home/gboulant/development/projets/salome/SPADDER/spadder/resources/padderexe/REF_spheres.dat.xyz"
file=open(filename,'rb')
self.__selectedMesh = None
return
- self.smeshStudyTool.updateStudy(studyedit.getActiveStudyId())
+ self.smeshStudyTool.updateStudy()
self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
if CORBA.is_nil(self.__selectedMesh):
self.__ui.txtSmeshObject.setText("The selected object is not a mesh")
from omniORB import CORBA
import SMESH
from salome.smesh import smeshBuilder
-smesh = smeshBuilder.New(salome.myStudy)
+smesh = smeshBuilder.New()
import MESHJOB
gui_states = ["CAN_SELECT", "CAN_COMPUTE", "CAN_REFRESH", "CAN_PUBLISH"]
medfilename = os.path.join(meshJobResults.results_dirname,
meshJobResults.outputmesh_filename)
- smesh.SetCurrentStudy(studyedit.getActiveStudy())
+ smesh.UpdateStudy()
([outputMesh], status) = smesh.CreateMeshesFromMED(medfilename)
# By convention, the name of the output mesh in the study is
meshname = 'padder_'+str(self.__jobid)
smesh.SetName(outputMesh.GetMesh(), meshname)
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(False)
+ salome.sg.updateObjBrowser()
self.__ui.lblStatusBar.setText("Publication OK")
self.__setGuiState(["CAN_SELECT"])
print "Test of usage of SMESH engine from the test component"
import SMESH
salome.lcc.FindOrLoadComponent("FactoryServer","SMESH")
-c.testsmesh(salome.myStudyId)
+c.testsmesh()
print "Test completed : OK"