salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# Create a 3D sketcher (wire) on the given points coordinates
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# a box
# --- geom Python interface
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# --- Create a box and publish it into the salome study
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
# --- update the study object browser
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()
gg = salome.ImportComponentGUI("GEOM")
# create PipeTShape object
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create DividedDisk object
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create DividedCylinder object
import salome, GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a could of points
points = [
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
OX = geompy.MakeVectorDXDYDZ(10, 0,0)
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
Circle_1 = geompy.MakeCircle(None, None, 100)
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
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()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
import SALOMEDS
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
import SALOMEDS
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SALOMEDS
# create a box and a cylinder
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import SALOMEDS
# create a box and partigion it by two planes
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
check_box = geompy.MakeBoxDXDYDZ(200, 200, 200)
ii = ii + 1
pass
-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()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create boxes
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
mindeg = 2
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
Wire_1 = geompy.MakeSketcher("Sketcher:F 0 0:TT 100 0:R 0:C 100 90:T 0 200", [0, 0, 0, 0, 0, 1, 1, 0, -0])
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import salome
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
def MakeHelix(radius, height, rotation, direction):
# - create a helix -
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# Create a box
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()
# Create Vertexes for curve
Vertex_1 = geompy.MakeVertex(0, 0, 0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create 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()
# create a shape
box1 = geompy.MakeBox(0, 0, 0, 100, 100, 100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create solids
box = geompy.MakeBoxDXDYDZ(100, 100, 100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import tempfile, os
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# Create two curves with three closest points
Vertex_1 = geompy.MakeVertex(0, 0, 0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import salome_notebook
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a point
point = geompy.MakeVertex(15., 23., 80.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices, an edge, an arc, a wire, a face and a prism
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create base points
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create boxes
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create boxes
geompy.addToStudy(glue2, "Glue two edges")
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()
gg = salome.ImportComponentGUI("GEOM")
# import initial topology with bad tolerances (more than 1e-07)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# Variant 1: using DivideEdge()
div = geompy.DivideEdgeByPoint( box, edge, [p1, p2], theName="box (edge divided)")
-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()
# create vertices
p1 = geompy.MakeVertex(0, 0, 0)
ii = ii + 1
pass
-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()
# create solids with some coincident faces
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
Joined_1 = geompy.RemoveInternalFaces(Partition_1)
geompy.addToStudy(Joined_1, 'Joined_1')
-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()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
#
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
#create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
#create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a vertex and a vector
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
gg = salome.ImportComponentGUI("GEOM")
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a box and a sphere
import salome
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a cylindric face and a curve(edge)
cylinder = geompy.MakeCylinderRH(100, 300)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices and vectors
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
import math
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create a face in OXY plane
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create box
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
radius = 10.
ShapeTypeEdge = geompy.ShapeType["EDGE"]
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
d1 = 10.
d2 = 10.
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
box = geompy.MakeBox(0,0,0, 50,50,50)
box2 = geompy.MakeBox(-50,-50,-50, 0,0,0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
box = geompy.MakeBox(0,0,0, 50,50,50)
sphere = geompy.MakeSphere(50,50,50, 30)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
box = geompy.MakeBox(0,0,0, 50,50,50)
sphere = geompy.MakeSphere(50,50,50, 30)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
texture_file = os.path.join(os.getenv("GEOM_ROOT_DIR"), "share", "salome", "resources", "geom", "textures", "texture1.dat")
texture = geompy.LoadTexture(texture_file)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# create a box
box = geompy.MakeBoxDXDYDZ(100,30,100)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
# display the contents of the group
gg.createAndDisplayGO(id_group1)
-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()
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
# display the contents of the group
gg.createAndDisplayGO(id_group1)
-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()
gg = salome.ImportComponentGUI("GEOM")
# create two vertices
# display the contents of the group
gg.createAndDisplayGO(id_group1)
-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()
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudyInFather(Box_1, Group_4, 'Group_4')
geompy.addToStudyInFather(Box_1, Group_U_1_2, 'Group_U_1_2')
geompy.addToStudyInFather(Box_1, Group_UL_3_4, 'Group_UL_3_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()
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudyInFather(Box_1, Group_4, 'Group_4')
geompy.addToStudyInFather(Box_1, Group_I_1_3, 'Group_I_1_3')
geompy.addToStudyInFather(Box_1, Group_IL_1_3, 'Group_IL_1_3')
-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()
# create a box and some groups of faces on it
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudyInFather(Box_1, Group_4, 'Group_4')
geompy.addToStudyInFather(Box_1, Group_C_2_4, 'Group_C_2_4')
geompy.addToStudyInFather(Box_1, Group_CL_2_4, 'Group_CL_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()
box = geompy.MakeBoxDXDYDZ(10,10,10)
type = geompy.ShapeIdToType(box.GetType())
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
box = geompy.MakeBoxDXDYDZ(10,10,10)
type = box.GetShapeType()
\n the old mode:
\code
import geompy
-geompy.init_geom(theStudy)
+geompy.init_geom()
\endcode
\n the new mode:
\code
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
\endcode
salome.salome_init()
from salome.geom import geomBuilder
-geompy = geomBuilder.New(theStudy)
+geompy = geomBuilder.New()
\endcode
With this initialization, the geometry engine runs in the default container,
from salome.geom import geomBuilder
lcc = salome.lcc
engineGeom = lcc.FindOrLoadComponent("myServer", "GEOM")
-geompy = geomBuilder.New(theStudy, engineGeom)
+geompy = geomBuilder.New(engineGeom)
\endcode
Or, within a Distributed Python Node of a YACS Schema, where the container
\code
from salome.geom import geomBuilder
my_container.load_component_Library("GEOM")
-engineGeom = my_container.create_component_instance("GEOM", 0)
-geompy = geomBuilder.New(theStudy, engineGeom)
+engineGeom = my_container.create_component_instance("GEOM")
+geompy = geomBuilder.New(engineGeom)
\endcode
import salome
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
*/
string GetEntry();
- /*!
- * \brief Get ID of study, where the object is created.
- */
- long GetStudyID();
-
/*!
* \brief Get internal type of operation created this object (POINT, BOX, CYLINDER, EXTRUSION...).
* \note To get topological information on the object, use \ref GEOM_IMeasureOperations::WhatIs() "WhatIs()"
*/
string GetErrorCode();
- /*!
- * \brief Get ID of study, where the operation is defined
- */
- long GetStudyID();
-
/*!
* \brief Opens a new transaction
*/
* \brief Undo/Redo Management
*/
- void Undo (in long theStudyID);
+ void Undo ();
- void Redo (in long theStudyID);
+ void Redo ();
/*!
* \brief Publishing management
* if theFather is not NULL the object is placed under thFather's SObject.
* Returns a SObject where theObject is placed
*/
- SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy,
- in GEOM_BaseObject theObject,
+ SALOMEDS::SObject AddInStudy (in GEOM_BaseObject theObject,
in string theName,
in GEOM_BaseObject theFather);
* \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
*
* To be used from python scripts out of geompy.addToStudy (non-default usage)
- * \param theStudy the study, in which theObject is published already,
- * and in which the arguments will be published
* \param theObject published GEOM_Object, arguments of which will be published
* \param theArgs list of GEOM_Object, operation arguments to be published.
* If this list is empty, all operation arguments will be published
* and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
* \return list of published sub-shapes
*/
- ListOfGO RestoreSubShapesO (in SALOMEDS::Study theStudy,
- in GEOM_Object theObject,
+ ListOfGO RestoreSubShapesO (in GEOM_Object theObject,
in ListOfGO theArgs,
in find_shape_method theFindMethod,
in boolean theInheritFirstArg,
* \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments
*
* To be used from python scripts out of geompy.addToStudy (non-default usage)
- * \param theStudy the study, in which theObject is published already,
- * and in which the arguments will be published
* \param theObject published GEOM_Object, arguments of which will be published
* \param theArgs list of GEOM_Object, operation arguments to be published.
* If this list is empty, all operation arguments will be published
* and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
* \return list of published sub-shapes
*/
- ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study theStudy,
- in GEOM_Object theObject,
+ ListOfGO RestoreGivenSubShapesO (in GEOM_Object theObject,
in ListOfGO theArgs,
in find_shape_method theFindMethod,
in boolean theInheritFirstArg,
*
* To be used from GUI and from geompy.addToStudy.
* Work like the above method, but accepts study object theSObject instead of GEOM_Object.
- * \param theStudy the study, in which theObject is published already,
- * and in which the arguments will be published
* \param theSObject study object, referencing GEOM_Object, arguments of which will be published
* \param theArgs list of GEOM_Object, operation arguments to be published.
* If this list is empty, all operation arguments will be published
* \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
* and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
*/
- ListOfGO RestoreSubShapesSO (in SALOMEDS::Study theStudy,
- in SALOMEDS::SObject theSObject,
+ ListOfGO RestoreSubShapesSO (in SALOMEDS::SObject theSObject,
in ListOfGO theArgs,
in find_shape_method theFindMethod,
in boolean theInheritFirstArg,
// # Methods to access interfaces for objects creation and transformation
- GEOM_IBasicOperations GetIBasicOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_ITransformOperations GetITransformOperations(in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_I3DPrimOperations GetI3DPrimOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IShapesOperations GetIShapesOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IBooleanOperations GetIBooleanOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_ICurvesOperations GetICurvesOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_ILocalOperations GetILocalOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IHealingOperations GetIHealingOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IInsertOperations GetIInsertOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IMeasureOperations GetIMeasureOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IBlocksOperations GetIBlocksOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IGroupOperations GetIGroupOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
- GEOM_IFieldOperations GetIFieldOperations (in long theStudyID) raises (SALOME::SALOME_Exception);
-
- GEOM_IOperations GetPluginOperations (in long theStudyID,
- in string theLibName) raises (SALOME::SALOME_Exception);
+ GEOM_IBasicOperations GetIBasicOperations () raises (SALOME::SALOME_Exception);
+ GEOM_ITransformOperations GetITransformOperations() raises (SALOME::SALOME_Exception);
+ GEOM_I3DPrimOperations GetI3DPrimOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IShapesOperations GetIShapesOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IBooleanOperations GetIBooleanOperations () raises (SALOME::SALOME_Exception);
+ GEOM_ICurvesOperations GetICurvesOperations () raises (SALOME::SALOME_Exception);
+ GEOM_ILocalOperations GetILocalOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IHealingOperations GetIHealingOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IInsertOperations GetIInsertOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IMeasureOperations GetIMeasureOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IBlocksOperations GetIBlocksOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IGroupOperations GetIGroupOperations () raises (SALOME::SALOME_Exception);
+ GEOM_IFieldOperations GetIFieldOperations () raises (SALOME::SALOME_Exception);
+
+ GEOM_IOperations GetPluginOperations (in string theLibName) raises (SALOME::SALOME_Exception);
// # Objects Management
/*!
* \brief Returns an object defined by the study and its entry in the GEOM component
- * \param theStudyID is a SALOMEDS Study ID
* \param theEntry is an entry of the requested GEOM_Object in the GEOM component
* \note if the object has not previously been created a NULL GEOM_Object is returned
*/
- GEOM_BaseObject GetObject (in long theStudyID, in string theEntry);
+ GEOM_BaseObject GetObject (in string theEntry);
/*!
* \brief Add a sub-shape defined by indices in \a theIndices
/*!
* \brief Publishes the named sub-shapes of given object in the study.
- * \param theStudy The study in which the object is published
* \param theObject The object which named sub-shapes are published
*/
- ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy,
- //in SObject theSObject,
+ ListOfGO PublishNamedShapesInStudy(//in SObject theSObject,
in Object theObject);
/*!
/*!
* \brief Collects dependencies of the given objects from other ones
- * \param theStudy The study in which the object is published
* \param theListOfEntries List of GEOM object entries in OCAF tree (not in study)
* \return Struct of dependent entries and its links as a byte array
* \note This method is supposed to be used by GUI only.
*/
- SALOMEDS::TMPFile GetDependencyTree(in SALOMEDS::Study theStudy,
- in string_array theListOfEntries);
+ SALOMEDS::TMPFile GetDependencyTree(in string_array theListOfEntries);
/*!
* \brief Fills 3 lists that is used to reduce study of redundant objects:
* - dependencies of the given objects from other ones;
* - children of the given objects;
* - all other objects in study.
- * \param theStudy The study in which the object was published
* \param theSelectedEntries List of GEOM object entries in OCAF tree
* \param theParentEntries List of GEOM object entries on which the given objects depend
* \param theSubEntries Children entries list of the given objects
* \param theOtherEntries List of GEOM object entries which are in the study, but not in parents and children lists
* \note This method is supposed to be used by GUI only.
*/
- void GetEntriesToReduceStudy(in SALOMEDS::Study theStudy,
- inout string_array theSelectedEntries,
- inout string_array theParentEntries,
- inout string_array theSubEntries,
- inout string_array theOtherEntries);
+ void GetEntriesToReduceStudy(inout string_array theSelectedEntries,
+ inout string_array theParentEntries,
+ inout string_array theSubEntries,
+ inout string_array theOtherEntries);
};
};
interface GEOM_Superv : Engines::EngineComponent,SALOMEDS::Driver
{
- //-----------------------------------------------------------//
- // Set current study ID //
- //-----------------------------------------------------------//
- void SetStudyID (in long theStudyID) ;
-
//-----------------------------------------------------------//
// Create ListOfGO and add items to it //
//-----------------------------------------------------------//
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list></outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list></outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_BaseObject</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_Object</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_Object</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theSObject</inParameter-name>
<inParameter-type>SObject</inParameter-type>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theLibName</inParameter-name>
<inParameter-type>string</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theEntry</inParameter-name>
<inParameter-type>string</inParameter-type>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyEntry</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>CORBA/Object</inParameter-type>
<component-interface-comment>unknown</component-interface-comment>
<!-- interface services list -->
<component-service-list>
- <component-service>
- <service-name>SetStudyID</service-name>
- <service-author>SALOME team</service-author>
- <service-version>@SALOMEGEOM_VERSION@</service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list></outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
<component-service>
<service-name>CreateListOfGO</service-name>
<service-author>SALOME team</service-author>
* Constructor
*/
//=============================================================================
-AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID) :
- GEOM_IOperations(theEngine, theDocID)
+AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine) :
+ GEOM_IOperations(theEngine)
{
MESSAGE("AdvancedEngine_IOperations::AdvancedEngine_IOperations");
- myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
- myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID());
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID());
- myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID());
- my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID());
- myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID());
- myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID());
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
+ myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine());
+ myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine());
+ myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine());
+ myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine());
+ myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine());
+ my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine());
+ myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine());
+ myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
}
//=============================================================================
// Get faces that are laying on conical faces.
if (aConicalFaces.IsEmpty() == Standard_False) {
Handle(GEOM_Object) aCone =
- GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ GetEngine()->AddObject(GEOM_TSHAPE);
Handle(GEOM_Function) aFunction =
aCone->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces);
MESSAGE("AdvancedEngine_IOperations::MakePipeTShape");
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
/////////////////
// TSHAPE CODE
/////////////////
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
if (aFunction.IsNull()) return NULL;
return NULL;
}
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO);
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT);
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDCYLINDER);
Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_SMOOTHINGSURFACE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS);
bool fuse);
public:
- AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID);
+ AdvancedEngine_IOperations(GEOM_Engine* theEngine);
~AdvancedEngine_IOperations();
Handle(TColStd_HSequenceOfTransient)
#include "Utils_ExceptHandlers.hxx"
#include "utilities.h"
-std::map <int, AdvancedEngine_IOperations*> AdvancedEngine_OperationsCreator::_mapOfOperations;
+AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::_operation;
AdvancedEngine_OperationsCreator::AdvancedEngine_OperationsCreator()
{
}
GEOM_IOperations_i* AdvancedEngine_OperationsCreator::Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl)
{
Unexpect aCatch(SALOME_SalomeException);
MESSAGE( "AdvancedEngine_OperationsCreator::Create" );
- return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new AdvancedEngine_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new AdvancedEngine_IOperations( theGenImpl );
+ return _operation;
}
~AdvancedEngine_OperationsCreator();
GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl);
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl);
private:
- static AdvancedEngine_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static AdvancedEngine_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, AdvancedEngine_IOperations*> _mapOfOperations;
+ static AdvancedEngine_IOperations* _operation;
};
#endif
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedCylinderDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
+ return getGeomEngine()->GetPluginOperations("AdvancedEngine");
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedDiskDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
+ return getGeomEngine()->GetPluginOperations("AdvancedEngine");
}
//=================================================================================
if (aFindedObject->_is_nil()) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations(getStudyId());
+ getGeomEngine()->GetIShapesOperations();
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
else {
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_PipeTShapeDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
+ return getGeomEngine()->GetPluginOperations("AdvancedEngine");
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::GenericAttribute_var anAttr;
if (!theSObject->FindAttribute(anAttr, "AttributeIOR"))
ObjectList::iterator it = pipeTShapeGroupObjects.begin();
for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
- getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
+ getGeomEngine()->AddInStudy((*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
}
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_SmoothingSurfaceDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
+ return getGeomEngine()->GetPluginOperations("AdvancedEngine");
}
//=================================================================================
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "BREPPluginEngine" );
BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
if ( brepOp.isNull() ) return false;
try
{
- app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
- transaction.start();
- GEOM::ListOfGO_var result = brepOp->ImportBREP( fileName.toUtf8().constData() );
- if ( result->length() > 0 && brepOp->IsDone() )
- {
- GEOM::GEOM_Object_var main = result[0];
- QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
- SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
- SALOMEDS::SObject::_nil(),
- main.in(),
- publishName.toUtf8().constData() );
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
+ transaction.start();
+ GEOM::ListOfGO_var result = brepOp->ImportBREP( fileName.toUtf8().constData() );
+ if ( result->length() > 0 && brepOp->IsDone() )
+ {
+ GEOM::GEOM_Object_var main = result[0];
+ QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(),
+ main.in(),
+ publishName.toUtf8().constData() );
- entryList.append( so->GetID() );
- transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ entryList.append( so->GetID() );
+ transaction.commit();
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
- }
- else
- {
- transaction.abort();
- errors.append( QString( "%1 : %2" ).arg( fileName ).arg( brepOp->GetErrorCode() ) );
- }
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( brepOp->GetErrorCode() ) );
+ }
}
catch( const SALOME::SALOME_Exception& e )
{
- transaction.abort();
+ transaction.abort();
}
}
- getGeometryGUI()->updateObjBrowser( true );
+ getGeometryGUI()->updateObjBrowser();
app->browseObjects( entryList );
if ( errors.count() > 0 )
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "BREPPluginEngine" );
BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
if ( brepOp.isNull() ) return false;
*/
//=============================================================================
bool
-BREPPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+BREPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() );
aPluginOperations->ExportBREP( theOriginal, theFileName );
return true;
}
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-BREPPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+BREPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ImportBREP( theFileName );
}
BREPPlugin_IECallBack();
~BREPPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "BREPPlugin_IOperations::BREPPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( BREPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- BREPPlugin_IOperations( GEOM_Engine*, int );
+ BREPPlugin_IOperations( GEOM_Engine* );
~BREPPlugin_IOperations();
void ExportBREP( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, BREPPlugin_IOperations*> BREPPlugin_OperationsCreator::_mapOfOperations;
+BREPPlugin_IOperations* BREPPlugin_OperationsCreator::_operation;
BREPPlugin_OperationsCreator::BREPPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* BREPPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "BREPPlugin_OperationsCreator::Create" );
- return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new BREPPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new BREPPlugin_IOperations( theGenImpl );
+ return _operation;
}
~BREPPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
private:
- static BREPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static BREPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, BREPPlugin_IOperations*> _mapOfOperations;
+ static BREPPlugin_IOperations* _operation;
friend class BREPPlugin_IECallBack;
};
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_ArcDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_CircleDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_CurveDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetICurvesOperations(getStudyId());
+ return myGeomGUI->GetGeomGen()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_EllipseDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_LineDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_PlaneDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations(getStudyId());
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BasicGUI_VectorDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBasicOperations();
}
//=================================================================================
aName = aName + ":edge_" + QString::number( anIndex );
GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
+ getGeomEngine()->GetIShapesOperations();
if ( myEditCurrentArgument == Group2->LineEdit1 )
myVectX = aShapesOp->GetSubShape( aSelectedObject, anIndex );
else
Zz = Xx = 1.;
GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
- myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
+ myGeomGUI->GetGeomGen()->GetIMeasureOperations();
aMeasureOp->GetPosition( myFace, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz);
if ( aMeasureOp->IsDone() ) {
}
if ( showPreview ) {
- GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
+ GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations();
GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker
( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(),
myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_BlockDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations(getStudyId());
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations( getStudyId() );
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_PropagateDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations( getStudyId() );
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_QuadFaceDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations(getStudyId());
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations(getStudyId());
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BooleanGUI_Dialog::createOperation()
{
- return getGeomEngine()->GetIBooleanOperations(getStudyId());
+ return getGeomEngine()->GetIBooleanOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
/*theInheritFirstArg=*/myOperation == BooleanGUI::CUT,
mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual void addSubshapesToStudy();
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_CompoundDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
/*theInheritFirstArg=*/false,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_EdgeDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_FaceDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_ShellDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_SolidDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
bool ok = !myShells.isEmpty();
GEOM::MeasureOpPtr anOp;
- anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()));
+ anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations());
if (getConstructorId() == 0 && (!GroupSolid->CheckButton1->isChecked() || myShells.count() == 1)) {
for (int i = 0, n = myShells.count(); i < n && ok; i++) {
CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get());
if ( !CORBA::is_nil( shell ) ) {
GEOM::MeasureOpPtr anOp;
- anOp.take( myGeomGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() ) );
+ anOp.take( myGeomGUI->GetGeomGen()->GetIMeasureOperations() );
// Detect kind of shape and parameters
aKind = anOp->KindOfShape(shell, anInts, aDbls);
//=================================================================================
GEOM::GEOM_IOperations_ptr BuildGUI_WireDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
myTextItem->setFont( textFont );
myEntry = theEntry;
-
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
- SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- int studyId = aStudyDS->StudyId();
- myGeomObject = GeometryGUI::GetGeomGen()->GetObject( studyId, myEntry.c_str() );
+ myGeomObject = GeometryGUI::GetGeomGen()->GetObject( myEntry.c_str() );
updateName();
if( DependencyTree_Object* treeObject = dynamic_cast<DependencyTree_Object*>( myView->selectedObject() ) ) {
QString studyEntry;
QString name;
- GEOM::GEOM_BaseObject_var anObj = GeometryGUI::GetGeomGen()->GetObject( myView->getStudyId(),
- treeObject->getEntry().c_str() );
+ GEOM::GEOM_BaseObject_var anObj = GeometryGUI::GetGeomGen()->GetObject( treeObject->getEntry().c_str() );
if( anObj->_is_nil() )
continue;
CORBA::String_var studyEntryVar = anObj->GetStudyEntry();
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- myStudy = GeometryGUI::ClientStudyToStudy( study->studyDS());
-
mySelectionMgr = app->selectionMgr();
if ( !mySelectionMgr ) return;
return tr( "DEPENDENCY_TREE" );
}
-//=================================================================================
-// function : getStudyId()
-// purpose : return Id of current study
-//=================================================================================
-int DependencyTree_View::getStudyId() const
-{
- return myStudy->StudyId();
-}
-
//=================================================================================
// function : getObjectByEntry()
// purpose : return DependencyTree_Object by entry
// get string which describes dependency tree structure
SALOMEDS::TMPFile_var SeqFile =
- GeometryGUI::GetGeomGen()->GetDependencyTree( myStudy, myMainEntries );
+ GeometryGUI::GetGeomGen()->GetDependencyTree( myMainEntries );
char* buf = (char*)&SeqFile[0];
clearView( true );
void wheelEvent( QWheelEvent* event );
QString getViewName() const;
- int getStudyId() const;
DependencyTree_Object* getObjectByEntry( const std::string& );
QCheckBox* myDisplayDescendants;
QPushButton* updateButton;
- SALOMEDS::Study_var myStudy;
LightApp_SelectionMgr* mySelectionMgr;
GEOM::string_array_var myMainEntries;
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer disp( appStudy );
+ GEOM_Displayer disp;
OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
SALOME_ListIO aSelList;
aSelMgr->selectedObjects( aSelList );
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer disp( appStudy );
+ GEOM_Displayer disp;
OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !appStudy ) return false;
-
LightApp_SelectionMgr *Sel = app->selectionMgr();
SALOME_ListIO selected;
Sel->selectedObjects( selected );
break;
}
Sel->setSelectedObjects( selected );
- GEOM_Displayer( appStudy ).UpdateColorScale();
+ GEOM_Displayer().UpdateColorScale();
return true;
}
//=====================================================================================
void DisplayGUI::DisplayAll()
{
- SalomeApp_Application* app = getGeometryGUI()->getApp();
- if ( !app ) return;
-
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !appStudy ) return;
- _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
if ( !aStudy ) return;
_PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) );
if ( !SC )
}
anIter->Next();
}
- GEOM_Displayer( appStudy ).Display( listIO, true );
+ GEOM_Displayer().Display( listIO, true );
}
//=====================================================================================
if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
SUIT_ViewManager* vman = vw->getViewManager();
if ( vman->getType() == OCCViewer_Viewer::Type() ||
vman->getType() == SVTK_Viewer::Type() ) {
- GEOM_Displayer( appStudy ).EraseAll(true);
+ GEOM_Displayer().EraseAll(true);
}
}
}
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
- if (!anActiveStudy) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+ if (!aStudy) return;
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if (!aSelMgr) return;
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if (anIObject->hasEntry()) {
- _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry()));
+ _PTR(SObject) SO (aStudy->studyDS()->FindObjectID(anIObject->getEntry()));
if (SO) {
_PTR(SComponent) SC (SO->GetFatherComponent());
if (QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str())) {
// if component is selected, pass it
}
else {
- _PTR(ChildIterator) anIter (anActiveStudy->studyDS()->NewChildIterator(SO));
+ _PTR(ChildIterator) anIter (aStudy->studyDS()->NewChildIterator(SO));
anIter->InitEx(true);
while (anIter->More()) {
_PTR(SObject) valSO (anIter->Value());
}
}
}
- GEOM_Displayer(anActiveStudy).Display(listIO, true);
+ GEOM_Displayer().Display(listIO, true);
}
//=====================================================================================
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !anActiveStudy ) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( !aStudy ) return;
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
for( ;It.More();It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
- _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
+ _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) );
anIter->InitEx( true );
while( anIter->More() ) {
_PTR(SObject) valSO ( anIter->Value() );
listIO.Append( anIObject );
}
}
- GEOM_Displayer( anActiveStudy ).Display( listIO, true );
+ GEOM_Displayer().Display( listIO, true );
}
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !anActiveStudy ) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( !aStudy ) return;
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
for( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
- _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
+ _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) );
anIter->InitEx( true );
while( anIter->More() ) {
_PTR(SObject) valSO ( anIter->Value() );
if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type())
aIsForced = false;
- GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced);
+ GEOM_Displayer().Erase( listIO, aIsForced);
getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
}
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !aStudy ) return;
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int mgrId = viewWindow->getViewManager()->getGlobalId();
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
viewWindow->setProperty( "VectorsMode", mode );
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
viewWindow->setProperty( "VerticesMode", mode );
viewWindow->setProperty( "NameMode", mode );
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int aMgrId = viewWindow->getViewManager()->getGlobalId();
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int mgrId = viewWindow->getViewManager()->getGlobalId();
aSelMgr->GetIndexes(aSelList.First(), aMap);
if (aMap.Extent() == 1) {
int anIndex = aMap(1);
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
}
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_3DSketcherDlg::createOperation()
{
- return getGeomEngine()->GetICurvesOperations(getStudyId());
+ return getGeomEngine()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_FeatureDetectorDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIShapesOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIShapesOperations();
}
//=================================================================================
{
bool res = false;
- GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations();
GEOM::GEOM_IShapesOperations_var aShapesOperations = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
ShapeRec_Parameters* parameters = parametersChanged();
}
else if (myConstructorId == CONTOURS)
{
- GEOM::GEOM_ICurvesOperations_var aCurveOperations = myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
+ GEOM::GEOM_ICurvesOperations_var aCurveOperations = myGeomGUI->GetGeomGen()->GetICurvesOperations();
myDetector->ComputeContours( useROI, parameters );
std::vector< std::vector<cv::Point> > contours = myDetector->GetContours();
SALOME_ListIO aSelList;
// To highlight the selected sub-shape in Object Browser, if it's already published under the main shape
- GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations();
QMap<int, QString> childsMap;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if (appStudy) {
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_FieldDlg::createOperation()
{
- return getGeomEngine()->GetIFieldOperations(getStudyId());
+ return getGeomEngine()->GetIFieldOperations();
}
#define RETURN_WITH_MSG(a, b) \
//=================================================================================
bool EntityGUI_FieldDlg::execute()
{
- SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( getStudy()->studyDS() );
+ SALOMEDS::Study_var aStudyDS = GeometryGUI::getStudyServant();
SALOMEDS::StudyBuilder_var aBuilder = aStudyDS->NewBuilder();
QString aName = getNewObjectName().trimmed();
return false;
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toLatin1().constData(), myShape );
+ getGeomEngine()->AddInStudy( myField, aName.toLatin1().constData(), myShape );
if ( !aSO->_is_nil() ) {
myField->UnRegister();
CORBA::String_var entry = aSO->GetID();
step = myField->AddStep( tbl->getStepID(), tbl->getStamp() );
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), myField );
+ getGeomEngine()->AddInStudy( step, stepName.toLatin1().constData(), myField );
if ( /*!myIsCreation &&*/ !aSO->_is_nil() ) {
step->UnRegister();
CORBA::String_var entry = aSO->GetID();
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_IsolineDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetICurvesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_PictureImportDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetIBlocksOperations();
}
//=================================================================================
bool res = false;
GEOM::GEOM_Object_var anObj;
- GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
+ GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations();
GEOM::GEOM_IBlocksOperations_var aBlocksOperations = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() );
QString theImgFileName = myLineEdit->text();
if ( theImgFileName.isEmpty() )
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_PolylineDlg::createOperation()
{
- return getGeomEngine()->GetICurvesOperations( getStudyId() );
+ return getGeomEngine()->GetICurvesOperations();
}
//=================================================================================
if (aShape.ShapeType() == TopAbs_FACE) {
GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
- myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId());
+ myGeomGUI->GetGeomGen()->GetIMeasureOperations();
double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz;
aMeasureOp->GetPosition(theGeomObj.get(), Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz);
myHelpFileName = "create_sketcher_page.html";
- GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
+ GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations();
myGlobalCS = aBasicOp->MakeMarker( 0,0,0,
1,0,0,
0,1,0 );
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_SketcherDlg::createOperation()
{
- return getGeomEngine()->GetICurvesOperations( getStudyId() );
+ return getGeomEngine()->GetICurvesOperations();
}
//=================================================================================
if (aShape.ShapeType() == TopAbs_FACE)
{
GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
- myGeometryGUI->GetGeomGen()->GetIMeasureOperations( getStudyId() );
+ myGeometryGUI->GetGeomGen()->GetIMeasureOperations();
double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz;
aMeasureOp->GetPosition( geomObj, Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz);
if ( aMeasureOp->IsDone() )
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_SurfFromFaceDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetIShapesOperations(getStudyId());
+ return myGeomGUI->GetGeomGen()->GetIShapesOperations();
}
//=================================================================================
OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseDriver,TFunction_Driver);
-//================================================================================
-/*!
- * Returns document id
- */
-//================================================================================
-int GEOM_BaseDriver::GetDocID() const
-{
- int docId = 0;
- if (!Label().IsNull()) {
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(Label().Data());
- docId = GEOM_Engine::GetEngine()->GetDocID(aDoc);
- }
- return docId;
-}
-
//================================================================================
/*!
* \brief Returns a name of creation operation and names and values of creation parameters
class GEOM_BaseDriver : public TFunction_Driver
{
public:
- // Returns document id
- Standard_EXPORT int GetDocID() const;
// Returns a name of creation operation and names and values of creation parameters
// (Use AddParam() methods declared below to fill params vector while implementing
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theLabel, anEntry);
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theLabel.Data());
- if(aDoc.IsNull()) return NULL;
-
- Handle(TDataStd_Integer) anID;
- if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return NULL;
-
GEOM_Engine* anEngine = GEOM_Engine::GetEngine();
if(anEngine == NULL) return NULL;
- return anEngine->GetObject(anID->Get(), anEntry.ToCString());
+ return anEngine->GetObject(anEntry.ToCString());
}
//=============================================================================
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry)
- : _label(theEntry), _ior(""), _docID(-1)
+ : _label(theEntry), _ior("")
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
_root = TDataStd_TreeNode::Set(theEntry);
}
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
-: _label(theEntry), _ior(""), _docID(-1)
+: _label(theEntry), _ior("")
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
theEntry.ForgetAllAttributes(Standard_True);
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
TDataStd_Integer::Set(aTicLabel, aTic + 1);
}
-
-//=============================================================================
-/*!
- * GetDocID
- */
-//=============================================================================
-int GEOM_BaseObject::GetDocID()
-{
- return _docID;
-}
-
//=============================================================================
/*!
* SetName
Standard_EXPORT void SetTic(int theTic);
Standard_EXPORT void IncrementTic();
- //Returns an ID of the OCAF document where this GEOM_BaseObject is stored
- Standard_EXPORT int GetDocID();
-
//Sets a name of this GEOM_BaseObject
Standard_EXPORT void SetName(const char* theName);
TDF_Label _label;
TCollection_AsciiString _ior;
TCollection_AsciiString _parameters;
- int _docID;
public:
OCCT_DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient)
static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_BaseObject)& theObject)
{
- TCollection_AsciiString anID(theObject->GetDocID()), anEntry;
+ TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- anID+=(TCollection_AsciiString("_")+anEntry);
- return anID;
-}
-
-static TCollection_AsciiString BuildID(Standard_Integer theDocID, const char* theEntry)
-{
- TCollection_AsciiString anID(theDocID);
- anID+=(TCollection_AsciiString("_")+theEntry);
- return anID;
-}
-
-static Standard_Integer ExtractDocID(TCollection_AsciiString& theID)
-{
- TCollection_AsciiString aDocID = theID.Token("_");
- if(aDocID.Length() < 1) return -1;
- return aDocID.IntegerValue();
+ return anEntry;
}
bool ProcessFunction(Handle(GEOM_Function)& theFunction,
Standard_Integer& objectCounter,
Resource_DataMapOfAsciiStringAsciiString& aNameToEntry);
-void AddObjectColors (int theDocID,
- TCollection_AsciiString& theScript,
+void AddObjectColors (TCollection_AsciiString& theScript,
const TSting2ObjDataMap& theEntry2ObjData);
-void AddTextures (int theDocID, TCollection_AsciiString& theScript);
+void AddTextures (TCollection_AsciiString& theScript);
void PublishObject (TObjectData& theObjectData,
TSting2ObjDataMap& theEntry2ObjData,
for(objit = objs.begin(); objit != objs.end(); ++objit)
RemoveObject(*objit);
- //Close all documents not closed
- TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument);
- for (; anItr.More(); anItr.Next())
- {
- Close(anItr.Key());
- anItr.Initialize( _mapIDDocument ); // anItr becomes invalid at _mapIDDocument.UnBind(docId)
- }
- _mapIDDocument.Clear();
+ //Close document
+ Close();
_objects.Clear();
}
* GetDocument
*/
//=============================================================================
-Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force)
+Handle(TDocStd_Document) GEOM_Engine::GetDocument(bool force)
{
Handle(TDocStd_Document) aDoc;
- if(_mapIDDocument.IsBound(theDocID)) {
- aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+ if (_document) {
+ aDoc = _document;
}
else if (force) {
#if OCC_VERSION_MAJOR > 6
_OCAFApp->NewDocument("SALOME_GEOM", aDoc);
#endif
aDoc->SetUndoLimit(_UndoLimit);
- _mapIDDocument.Bind(theDocID, aDoc);
- TDataStd_Integer::Set(aDoc->Main(), theDocID);
+ _document = aDoc;
}
return aDoc;
}
-//=============================================================================
-/*!
- * GetDocID
- */
-//=============================================================================
-int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument)
-{
- if (theDocument.IsNull()) return -1;
- TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument);
- for (; anItr.More(); anItr.Next())
- if (anItr.Value() == theDocument) return anItr.Key();
-
- return -1;
-}
-
//=============================================================================
/*!
* GetObject
*/
//=============================================================================
-Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntry, bool force)
+Handle(GEOM_BaseObject) GEOM_Engine::GetObject(const char* theEntry, bool force)
{
Handle(GEOM_BaseObject) anObject;
- TCollection_AsciiString anID = BuildID(theDocID, theEntry);
-
- if (_objects.IsBound(anID)) {
- anObject = Handle(GEOM_BaseObject)::DownCast(_objects(anID));
+ if (_objects.IsBound(theEntry)) {
+ anObject = Handle(GEOM_BaseObject)::DownCast(_objects(theEntry));
}
else if (force) {
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID, force);
+ Handle(TDocStd_Document) aDoc = GetDocument(force);
if ( !aDoc.IsNull()) {
TDF_Label aLabel;
TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True);
case GEOM_FIELD_STEP_OBJTYPE: anObject = new GEOM_FieldStep(aLabel); break;
default: anObject = new GEOM_Object (aLabel);
}
- _objects.Bind(anID, anObject);
+ _objects.Bind(theEntry, anObject);
}
}
}
*/
//=============================================================================
-Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType)
+Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theType)
{
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
- if (_freeLabels.find(theDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[theDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
*/
//================================================================================
-Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType)
+Handle(GEOM_Object) GEOM_Engine::AddObject(int theType)
{
- return Handle(GEOM_Object)::DownCast( AddBaseObject(theDocID, theType) );
+ return Handle(GEOM_Object)::DownCast( AddBaseObject(theType) );
}
//=============================================================================
{
if (theMainShape.IsNull() || theIndices.IsNull()) return NULL;
- Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID());
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
- TDF_Label aChild;
- int aDocID = theMainShape->GetDocID();
- if (_freeLabels.find(aDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[aDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ TDF_Label aChild;;
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
{
if (theObject.IsNull()) return false;
- int aDocID = theObject->GetDocID();
- if(!_mapIDDocument.IsBound(aDocID))
+ if(!_document)
return false; // document is closed...
//Remove an object from the map of available objects
aLabel.ForgetAllAttributes(Standard_True);
// Remember the label to reuse it then
- std::list<TDF_Label>& aFreeLabels = _freeLabels[aDocID];
- if ( aFreeLabels.empty() || aFreeLabels.back() != aLabel )
- aFreeLabels.push_back(aLabel);
+ if ( _freeLabels.empty() || _freeLabels.back() != aLabel )
+ _freeLabels.push_back(aLabel);
// we can't explicitely delete theObject. At least prevent its functioning
// as an alive object when aLabel is reused for a new object
theObject->_label = aLabel.Root();
theObject->_ior.Clear();
- theObject->_parameters.Clear();
- theObject->_docID = -1;
+ theObject->_parameters.Clear();;
theObject.Nullify();
* Undo
*/
//=============================================================================
-void GEOM_Engine::Undo(int theDocID)
+void GEOM_Engine::Undo()
{
- GetDocument(theDocID)->Undo();
+ GetDocument()->Undo();
}
//=============================================================================
* Redo
*/
//=============================================================================
-void GEOM_Engine::Redo(int theDocID)
+void GEOM_Engine::Redo()
{
- GetDocument(theDocID)->Redo();
+ GetDocument()->Redo();
}
//=============================================================================
* Save
*/
//=============================================================================
-bool GEOM_Engine::Save(int theDocID, const char* theFileName)
+bool GEOM_Engine::Save(const char* theFileName)
{
- if(!_mapIDDocument.IsBound(theDocID)) return false;
- Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+ if(!_document) return false;
- _OCAFApp->SaveAs(aDoc, theFileName);
+ _OCAFApp->SaveAs(_document, theFileName);
return true;
}
* Load
*/
//=============================================================================
-bool GEOM_Engine::Load(int theDocID, const char* theFileName)
+bool GEOM_Engine::Load(const char* theFileName)
{
Handle(TDocStd_Document) aDoc;
if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) {
aDoc->SetUndoLimit(_UndoLimit);
- if(_mapIDDocument.IsBound(theDocID)) _mapIDDocument.UnBind(theDocID);
- _mapIDDocument.Bind(theDocID, aDoc);
-
- TDataStd_Integer::Set(aDoc->Main(), theDocID);
+ _document = aDoc;
return true;
}
* Close
*/
//=============================================================================
-void GEOM_Engine::Close(int theDocID)
+void GEOM_Engine::Close()
{
- if (_mapIDDocument.IsBound(theDocID)) {
- Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
-
- //Remove all GEOM Objects associated to the given document
+ if (_document) {
+ //Remove all GEOM Objects associated to the document
TColStd_SequenceOfAsciiString aSeq;
GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects);
for (; It.More(); It.Next()) {
- TCollection_AsciiString anObjID (It.Key());
- Standard_Integer anID = ExtractDocID(anObjID);
- if (theDocID == anID) aSeq.Append(It.Key());
+ aSeq.Append(It.Key());
}
- for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i));
-
- // Forget free labels for this document
- TFreeLabelsList::iterator anIt = _freeLabels.find(theDocID);
- if (anIt != _freeLabels.end()) {
- _freeLabels.erase(anIt);
+ for (Standard_Integer i=1; i<=aSeq.Length(); i++) {
+ _objects.UnBind(aSeq.Value(i));
}
- _mapIDDocument.UnBind(theDocID);
- _OCAFApp->Close(aDoc);
- aDoc.Nullify();
+ // Forget free labels for document
+ _freeLabels.clear();
+
+ _OCAFApp->Close(_document);
+ _document.Nullify();
}
}
* DumpPython
*/
//=============================================================================
-TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
- std::vector<TObjectData>& theObjectData,
+TCollection_AsciiString GEOM_Engine::DumpPython(std::vector<TObjectData>& theObjectData,
TVariablesList theVariables,
bool isPublished,
bool isMultiFile,
Kernel_Utils::Localizer loc;
TCollection_AsciiString aScript;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
if (aDoc.IsNull())
{
TCollection_AsciiString anEmptyScript;
if( isMultiFile )
- anEmptyScript = "def RebuildData(theStudy): pass\n";
+ anEmptyScript = "def RebuildData(): pass\n";
return anEmptyScript;
}
+
+ if( isMultiFile )
+ aScript = "import salome\n";
- aScript = "import GEOM\n";
+ aScript += "import GEOM\n";
aScript += "from salome.geom import geomBuilder\n";
aScript += "import math\n";
aScript += "import SALOMEDS\n\n";
if( isMultiFile )
- aScript += "def RebuildData(theStudy):";
+ aScript += "def RebuildData():";
- aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n";
+ aScript += "\n\tgeompy = geomBuilder.New()\n";
- AddTextures(theDocID, aScript);
+ AddTextures(aScript);
Standard_Integer posToInsertGlobalVars = aScript.Length() + 1;
aScript += aFuncScript;
// ouv : NPAL12872
- AddObjectColors( theDocID, aScript, aEntry2ObjData );
+ AddObjectColors(aScript, aEntry2ObjData );
// Make script to publish in study
TSting2ObjDataPtrMap::iterator aStEntry2ObjDataPtrIt;
#define TEXTURE_LABEL_HEIGHT 4
#define TEXTURE_LABEL_DATA 5
-int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight,
+int GEOM_Engine::addTexture(int theWidth, int theHeight,
const Handle(TColStd_HArray1OfByte)& theTexture,
const TCollection_AsciiString& theFileName)
{
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
- if (_freeLabels.find(theDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[theDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
return aTextureID;
}
-Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID,
+Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theTextureID,
int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName)
{
Handle(TColStd_HArray1OfByte) anArray;
theWidth = theHeight = 0;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
bool found = false;
return anArray;
}
-std::list<int> GEOM_Engine::getAllTextures(int theDocID)
+std::list<int> GEOM_Engine::getAllTextures()
{
std::list<int> id_list;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
for (; anIterator.More(); anIterator.Next()) {
return id_list;
}
-void GEOM_Engine::DocumentModified(const int theDocId, const bool isModified)
-{
- if (isModified) _mapModifiedDocs.Add(theDocId);
- else _mapModifiedDocs.Remove(theDocId);
-}
-
-bool GEOM_Engine::DocumentModified(const int theDocId)
-{
- return _mapModifiedDocs.Contains(theDocId);
-}
-
//===========================================================================
// Internal functions
//===========================================================================
* AddObjectColors: Add color to objects
*/
//=============================================================================
-void AddObjectColors (int theDocID,
- TCollection_AsciiString& theScript,
+void AddObjectColors (TCollection_AsciiString& theScript,
const TSting2ObjDataMap& theEntry2ObjData)
{
GEOM_Engine* engine = GEOM_Engine::GetEngine();
- Handle(TDocStd_Document) aDoc = engine->GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = engine->GetDocument();
TSting2ObjDataMap::const_iterator anEntryToNameIt;
for (anEntryToNameIt = theEntry2ObjData.begin();
return stream;
}
-void AddTextures (int theDocID, TCollection_AsciiString& theScript)
+void AddTextures (TCollection_AsciiString& theScript)
{
GEOM_Engine* engine = GEOM_Engine::GetEngine();
- std::list<int> allTextures = engine->getAllTextures(theDocID);
+ std::list<int> allTextures = engine->getAllTextures();
std::list<int>::const_iterator it;
if (allTextures.size() > 0) {
Standard_Integer aWidth, aHeight;
TCollection_AsciiString aFileName;
Handle(TColStd_HArray1OfByte) aTexture =
- engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName);
+ engine->getTexture(*it, aWidth, aHeight, aFileName);
if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) {
TCollection_AsciiString aCommand = "\n\t";
aCommand += "texture_map["; aCommand += *it; aCommand += "] = ";
Standard_EXPORT static GEOM_Engine* GetEngine();
//Returns the OCAF document by its ID, if document doesn't exists it will be created
- Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID, bool force=true);
-
- //Returns the ID of the given OCAF document
- Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument);
+ Standard_EXPORT Handle(TDocStd_Document) GetDocument(bool force=true);
//Returns the OCAF appliaction
Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; }
//Returns a pointer to GEOM_BaseObject defined by a document and the entry
- Standard_EXPORT Handle(GEOM_BaseObject) GetObject(int theDocID,
- const char* theEntry,
+ Standard_EXPORT Handle(GEOM_BaseObject) GetObject(const char* theEntry,
bool force=true);
//Adds a new object of the type theType in the OCAF document
- Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theDocID, int theType);
+ Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theType);
//Adds a new object of the type theType in the OCAF document
- Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType);
+ Standard_EXPORT Handle(GEOM_Object) AddObject(int theType);
//Removes the object from the OCAF document
Standard_EXPORT bool RemoveObject(Handle(GEOM_BaseObject)& theObject);
- //Saves the OCAF document with ID = theDocID with file with name theFileName
- Standard_EXPORT bool Save(int theDocID, const char* theFileName);
+ //Saves the OCAF document with file with name theFileName
+ Standard_EXPORT bool Save(const char* theFileName);
- //Loads the OCAF document into the application and assigns to it an ID = theDocID
- Standard_EXPORT bool Load(int theDocID, const char* theFileName);
+ //Loads the OCAF document into the application
+ Standard_EXPORT bool Load(const char* theFileName);
- //Closes the document with ID = theDocID
- Standard_EXPORT void Close(int theDocID);
+ //Closes the document
+ Standard_EXPORT void Close();
//Sets the number of Undos (default value = 10)
Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; }
- //Applies an Undo to document with ID = theDocID
- Standard_EXPORT void Undo(int theDocID);
+ //Applies an Undo to document
+ Standard_EXPORT void Undo();
- //Applies an Redo to document with ID = theDocID
- Standard_EXPORT void Redo(int theDocID);
+ //Applies an Redo to document
+ Standard_EXPORT void Redo();
//Adds a new sub-shape object of the MainShape object
Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape,
Handle(TColStd_HArray1OfInteger) theIndices,
bool isStandaloneOperation = false);
- Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
- std::vector<TObjectData>& theObjectData,
+ Standard_EXPORT TCollection_AsciiString DumpPython(std::vector<TObjectData>& theObjectData,
TVariablesList theVariables,
bool isPublished,
bool isMultiFile,
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
- Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight,
+ Standard_EXPORT int addTexture(int theWidth, int theHeight,
const Handle(TColStd_HArray1OfByte)& theTexture,
const TCollection_AsciiString& theFileName = "");
- Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theDocID, int theTextureID,
+ Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theTextureID,
int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName);
- Standard_EXPORT std::list<int> getAllTextures(int theDocID);
+ Standard_EXPORT std::list<int> getAllTextures();
static const Standard_GUID& GetTextureGUID();
const TCollection_AsciiString& anEntry,
Resource_DataMapOfAsciiStringAsciiString& aNameToEntry);
- Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified);
-
- Standard_EXPORT bool DocumentModified(const int theDocId);
-
protected:
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
private:
Handle(GEOM_Application) _OCAFApp;
- TColStd_DataMapOfIntegerTransient _mapIDDocument;
- TColStd_MapOfInteger _mapModifiedDocs; // keeps the identifiers of the modified document ids
+ Handle(TDocStd_Document) _document;
int _UndoLimit;
GEOM_DataMapOfAsciiStringTransient _objects;
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
- TFreeLabelsList _freeLabels;
+ std::list<TDF_Label> _freeLabels;
};
#endif
if(anEngine == NULL) return NULL;
step = Handle(GEOM_FieldStep)::DownCast
- ( anEngine->AddBaseObject( GetDocID(),GEOM_FIELD_STEP_OBJTYPE ));
+ ( anEngine->AddBaseObject( GEOM_FIELD_STEP_OBJTYPE ));
if ( step.IsNull())
return step;
*/
//=============================================================================
-GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID)
-: _engine(theEngine), _docID(theDocID)
+GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine)
+: _engine(theEngine)
{
_solver = new GEOM_Solver(theEngine);
}
//=============================================================================
void GEOM_IOperations::StartOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
if(aDoc->GetUndoLimit() > 0)
aDoc->NewCommand();
}
//=============================================================================
void GEOM_IOperations::FinishOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
if(aDoc->GetUndoLimit() > 0)
aDoc->CommitCommand();
- _engine->DocumentModified(_docID, true);
}
//=============================================================================
//=============================================================================
void GEOM_IOperations::AbortOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
aDoc->AbortCommand();
}
class GEOM_IOperations
{
public:
- Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOM_IOperations();
//Starts a new operation (opens a tansaction)
//Return a pointer to Solver associated with this operation interface
Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
- //Returns an ID of the OCAF document where this operation stores the data
- Standard_EXPORT int GetDocID() { return _docID; }
-
private:
TCollection_AsciiString _errorCode;
GEOM_Engine* _engine;
GEOM_Solver* _solver;
- int _docID;
};
* Update
*/
//=============================================================================
-bool GEOM_Solver::Update(int theDocID, TDF_LabelSequence& theSeq)
+bool GEOM_Solver::Update(TDF_LabelSequence& theSeq)
{
return false;
}
Standard_EXPORT GEOM_Solver(GEOM_Engine* theEngine) :_engine(theEngine) {}
Standard_EXPORT ~GEOM_Solver() {}
- //Update the values of all GEOM_Object in the document theDocID, theSeq will contain a list of touched labels
+ //Update the values of all GEOM_Object in the document, theSeq will contain a list of touched labels
//Note: not Implemented
- Standard_EXPORT bool Update(int theDocID, TDF_LabelSequence& theSeq);
+ Standard_EXPORT bool Update(TDF_LabelSequence& theSeq);
//Updates a value of theObject, theSeq will contain a list of touched labels
//Note: not implemented
QString fatherEntry = GetEntry( father );
if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
QString aName = !name.isEmpty() ? name : GetName( object );
- GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ),
- object, aName.toLatin1().data(), father.in() );
+ GeometryGUI::GetGeomGen()->AddInStudy( object, aName.toLatin1().data(), father.in() );
}
}
}
if ( !aStudy || theObj->_is_nil() )
return QString();
- SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy);
-
GEOM::GEOM_Object_ptr aFatherObj = getFather( theObj );
SALOMEDS::SObject_var aSO =
- getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj);
+ getGeomEngine()->AddInStudy(theObj, theName, aFatherObj);
QString anEntry;
if ( !aSO->_is_nil() ) {
}
// Each dialog is responsible for this method implementation,
// default implementation does nothing
- restoreSubShapes(aStudyDS, aSO);
+ restoreSubShapes(aSO);
aSO->UnRegister();
return anEntry;
// Function : restoreSubShapes
// Purpose : restore tree of argument's sub-shapes under the resulting shape
//================================================================
-void GEOMBase_Helper::restoreSubShapes (SALOMEDS::Study_ptr /*theStudy*/,
- SALOMEDS::SObject_ptr /*theSObject*/)
+void GEOMBase_Helper::restoreSubShapes (SALOMEDS::SObject_ptr /*theSObject*/)
{
// do nothing by default
// example of implementation in particular dialog:
// GEOM::ListOfGO anArgs;
// anArgs.length(0); // empty list means that all arguments should be restored
- // getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ // getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
// /*theFindMethod=*/GEOM::FSM_GetInPlace,
// /*theInheritFirstArg=*/false);
}
CAM_Module* module = app->module( "Geometry" );
SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>( module );
if ( appMod ) {
- appMod->updateObjBrowser( true );
+ appMod->updateObjBrowser();
}
}
}
getDisplayer()->UpdateViewer();
}
-//================================================================
-// Function : getStudyId
-// Purpose : Get study Id
-//================================================================
-int GEOMBase_Helper::getStudyId() const
-{
- int anId = -1;
- if ( getStudy() )
- anId = getStudy()->id();
- return anId;
-}
-
//================================================================
// Function : getStudy
// Purpose : Returns the active study. It is recommended to use
GEOM_Displayer* GEOMBase_Helper::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
GEOM::GeomObjPtr subShape = findObjectInFather( object.get(), idx );
if ( !subShape ) {
// sub-shape is not yet published in the study
- GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations();
subShape.take( shapesOp->GetSubShape( object.get(), idx ) ); // take ownership!
}
if ( typeInList( (TopAbs_ShapeEnum)(subShape->GetShapeType()), types ) ) {
bool hasCommand () const;
void updateObjBrowser() const;
- int getStudyId () const;
SalomeApp_Study* getStudy () const;
bool checkViewWindow ();
// It should perform the required operation and put all new or modified objects into
// <objects> argument.Should return <false> if some error occurs during its execution.
- virtual void restoreSubShapes( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr theSObject );
// This method is called by addInStudy().
virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj );
void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
const QStringList& theParameters)
{
- SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS());
+ SALOMEDS::Study_var aStudy = GeometryGUI::getStudyServant();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry());
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
#include <Standard_ProgramError.hxx>
#include <gp_Trsf.hxx>
-#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
// Static patterns for casting value-to-string & value-from-string. The patterns are:
// ITEM: { name[string] : visibility : type : values[composite] };
// function : Init constructor
// purpose :
//=================================================================================
-GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry )
+GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( const std::string& theEntry )
{
- LoadFromAttribute( theStudy, theEntry );
+ LoadFromAttribute( theEntry );
}
//=================================================================================
// function : LoadFromAttribute
// purpose :
//=================================================================================
-void GEOMGUI_DimensionProperty::LoadFromAttribute( SalomeApp_Study* theStudy,
- const std::string& theEntry )
+void GEOMGUI_DimensionProperty::LoadFromAttribute( const std::string& theEntry )
{
Clear();
- _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+ _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
if ( !aSObj )
{
return;
}
- _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder();
+ _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder();
_PTR(GenericAttribute) aSeekAtt;
_PTR(AttributeTableOfReal) aRecordsAtt;
// function : SaveToAttribute
// purpose :
//=================================================================================
-void GEOMGUI_DimensionProperty::SaveToAttribute( SalomeApp_Study *theStudy,
- const std::string &theEntry )
+void GEOMGUI_DimensionProperty::SaveToAttribute( const std::string &theEntry )
{
- _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+ _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
if ( !aSObj )
{
return;
}
- _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder();
+ _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder();
_PTR(AttributeTableOfReal) aRecordsAtt;
/*!
* \brief Constructor. Inits property from attribute.
*/
- GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry );
+ GEOMGUI_DimensionProperty( const std::string& theEntry );
/*!
* \brief Constructor. Inits property from formatted QString.
/*!
* \brief Loads properties data from attribute "AttributeTableOfReal".
- * \param theStudy [in] the study.
* \param theEntry [in] the entry of GEOM object to operate with.
*/
- void LoadFromAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+ void LoadFromAttribute( const std::string& theEntry );
/*!
* \brief Saves properties data to attribute "AttributeTableOfReal".
- * \param theStudy [in] the study.
* \param theEntry [in] the entry of GEOM object to operate with.
*/
- void SaveToAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+ void SaveToAttribute( const std::string& theEntry );
private:
bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj )
{
// as soon as Use Case browser data tree was added
- return obj ? obj->GetStudy()->GetUseCaseBuilder()->HasChildren( obj ) : false;
+ return obj ? SalomeApp_Application::getStudy()->GetUseCaseBuilder()->HasChildren( obj ) : false;
}
bool GEOMGUI_Selection::expandable( const _PTR(SObject)& obj )
_PTR(Study) study = appStudy->studyDS();
if ( study && !anEntry.isEmpty() ) {
_PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
- if ( aSO && aSO->GetStudy()->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) {
- _PTR(UseCaseIterator) it = aSO->GetStudy()->GetUseCaseBuilder()->GetUseCaseIterator( aSO );
+ if ( aSO && study->GetUseCaseBuilder()->IsUseCaseNode(aSO) ) {
+ _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( aSO );
for (it->Init(false); it->More(); it->Next()) nb++;
}
}
bool GEOMGUI_Selection::hasDimensions( const int theIndex, bool& theHidden, bool& theVisible ) const
{
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( study() );
-
- if ( !appStudy )
- {
- return false;
- }
-
QString anEntry = entry( theIndex );
- _PTR(Study) aStudy = appStudy->studyDS();
- if ( !aStudy || anEntry.isNull() )
+ if ( anEntry.isNull() )
{
return false;
}
- GEOMGUI_DimensionProperty aDimensions( appStudy, anEntry.toStdString() );
+ GEOMGUI_DimensionProperty aDimensions( anEntry.toStdString() );
theHidden = false;
theVisible = false;
if ( !aStudy || anEntry.isNull() )
return false;
- _PTR(SObject) aSObj = appStudy->studyDS()->FindObjectID( anEntry.toStdString() );\r
+ _PTR(SObject) aSObj = appStudy->studyDS()->FindObjectID( anEntry.toStdString() );
- const Handle(GEOMGUI_AnnotationAttrs)\r
- aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );\r
+ const Handle(GEOMGUI_AnnotationAttrs)
+ aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
- if ( aShapeAnnotations.IsNull() )\r
- return false;\r
+ if ( aShapeAnnotations.IsNull() )
+ return false;
theHidden = false;
theVisible = false;
{
public:
- DimensionsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) :
- myStudy( theStudy ), myEntry( theEntry ) {
- myAttr.LoadFromAttribute( theStudy, theEntry );
+ DimensionsProperty( const std::string& theEntry ) :
+ myEntry( theEntry ) {
+ myAttr.LoadFromAttribute( theEntry );
}
virtual int GetNumber() Standard_OVERRIDE {
return myAttr.GetNumber();
myAttr.SetVisible( theIndex, theIsVisible );
}
virtual void Save() Standard_OVERRIDE {
- myAttr.SaveToAttribute( myStudy, myEntry );
+ myAttr.SaveToAttribute( myEntry );
}
GEOMGUI_DimensionProperty& Attr() { return myAttr; }
private:
GEOMGUI_DimensionProperty myAttr;
- SalomeApp_Study* myStudy;
std::string myEntry;
};
{
public:
- AnnotationsProperty( SalomeApp_Study* theStudy, const std::string& theEntry ) {
+ AnnotationsProperty( const std::string& theEntry ) {
myEntry = theEntry.c_str();
- myStudy = theStudy;
- _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+ _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
if ( aSObj ) {
myAttr = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
}
protected:
GEOMGUI_AnnotationMgr* annotationMgr() const
{
- CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
+ CAM_Application* anApp = dynamic_cast<CAM_Application*>(SUIT_Session::session()->activeApplication());
GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
if (!aModule) {
return NULL;
private:
QString myEntry;
Handle(GEOMGUI_AnnotationAttrs) myAttr;
- SalomeApp_Study* myStudy;
};
}
// purpose :
//=================================================================================
GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
- : myDisplayer(NULL)
{
myStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- myDisplayer = GEOM_Displayer( myStudy );
+ myDisplayer = GEOM_Displayer();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
{
switch ( theBranchType )
{
- case DimensionShape : return QSharedPointer<VisualProperty>( new DimensionsProperty( theStudy, theEntry ) );
- case AnnotationShape : return QSharedPointer<VisualProperty>( new AnnotationsProperty( theStudy, theEntry ) );
+ case DimensionShape : return QSharedPointer<VisualProperty>( new DimensionsProperty( theEntry ) );
+ case AnnotationShape : return QSharedPointer<VisualProperty>( new AnnotationsProperty( theEntry ) );
default: break;
}
return QSharedPointer<VisualProperty>();
QSharedPointer<VisualProperty> aProp = getVisualProperty( aBranchType, myStudy, anEntry );
- CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
+ SalomeApp_Application* anApp =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
if ( aProp->GetIsVisible( aDimIndex ) ) {
aModule->GetAnnotationMgr()->Erase(anEntry.c_str(), aDimIndex);
* Constructor
*/
//=================================================================
-GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
+GEOM_Displayer::GEOM_Displayer()
: myUpdateColorScale(true), myIsRedisplayed( false )
{
- if( st )
- myApp = dynamic_cast<SalomeApp_Application*>( st->application() );
- else
- myApp = 0;
+ SUIT_Session* session = SUIT_Session::session();
+ myApp = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
/* Shading Color */
- SUIT_Session* session = SUIT_Session::session();
SUIT_ResourceMgr* resMgr = session->resourceMgr();
QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1;
// get presentation properties
- PropMap propMap = getObjectProperties( study, entry, myViewFrame );
+ PropMap propMap = getObjectProperties( entry, myViewFrame );
// Temporary staff: vertex must be infinite for correct visualization
AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines)
aImagePath = GetTexture().c_str();
if ( ! entry.isEmpty() ) {
// check that study is active
- SalomeApp_Study* study = getActiveStudy();
+ SalomeApp_Study* study = getStudy();
if ( study ) {
// Store the texture in object properties for next displays
study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::Texture ), QString( GetTexture().c_str() ) );
study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::DisplayMode ), 3 );
// Update propeties map
- propMap = getObjectProperties( study, entry, myViewFrame );
+ propMap = getObjectProperties( entry, myViewFrame );
}
}
}
int textureId = aList[0].toInt();
Standard_Integer aWidth, aHeight;
Handle(TColStd_HArray1OfByte) aTexture =
- GeometryGUI::getTexture( study, textureId, aWidth, aHeight );
+ GeometryGUI::getTexture( textureId, aWidth, aHeight );
if ( !aTexture.IsNull() ) {
Handle(Prs3d_PointAspect) aTextureAspect =
new Prs3d_PointAspect( HasColor() ?
int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1;
// get presentation properties
- PropMap propMap = getObjectProperties( study, entry, myViewFrame );
+ PropMap propMap = getObjectProperties( entry, myViewFrame );
QColor c;
/////////////////////////////////////////////////////////////////////////
}
else
{
- aRecords.LoadFromAttribute( getStudy(), theIO->getEntry() );
+ aRecords.LoadFromAttribute( theIO->getEntry() );
}
// create up-to-date dimension presentations
// set interactive object
setIO( theIO );
// Find SOBject (because shape should be published previously)
- SUIT_Session* session = SUIT_Session::session();
- SUIT_Application* app = session->activeApplication();
- if ( app )
+ if ( getStudy() )
{
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( study )
+ _PTR(SObject) SO ( getStudy()->studyDS()->FindObjectID( theIO->getEntry() ) );
+ if ( SO )
{
- _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) );
- if ( SO )
+ // get CORBA reference to data object
+ CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
+ if ( !CORBA::is_nil( object ) )
{
- // get CORBA reference to data object
- CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
- if ( !CORBA::is_nil( object ) )
+ // downcast to GEOM base object
+ GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object );
+ if ( !GeomBaseObject->_is_nil() )
{
- // downcast to GEOM base object
- GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object );
- if ( !GeomBaseObject->_is_nil() )
- {
- myType = GeomBaseObject->GetType();
+ myType = GeomBaseObject->GetType();
- // downcast to GEOM object
- GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
- if ( myType == GEOM_FIELD_STEP )
+ // downcast to GEOM object
+ GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
+ if ( myType == GEOM_FIELD_STEP )
+ {
+ // get the GEOM object from the field's shape
+ GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject );
+ if ( !GeomFieldStep->_is_nil() )
{
- // get the GEOM object from the field's shape
- GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject );
- if ( !GeomFieldStep->_is_nil() )
- {
- GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField();
- if ( !GeomField->_is_nil() )
- GeomObject = GeomField->GetShape();
- }
-
- // read the field step information
- readFieldStepInfo( GeomFieldStep );
+ GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField();
+ if ( !GeomField->_is_nil() )
+ GeomObject = GeomField->GetShape();
}
- if ( !GeomObject->_is_nil() )
- {
- theIO->setName( GeomObject->GetName() );
- // finally set shape
- setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
- }
+ // read the field step information
+ readFieldStepInfo( GeomFieldStep );
+ }
+
+ if ( !GeomObject->_is_nil() )
+ {
+ theIO->setName( GeomObject->GetName() );
+ // finally set shape
+ setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
}
}
}
return aSColor;
}
-PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study,
- const QString& entry,
+PropMap GEOM_Displayer::getObjectProperties( const QString& entry,
SALOME_View* view )
{
// get default properties for the explicitly specified default view type
PropMap propMap = GEOM_Displayer::getDefaultPropertyMap();
- if ( study && view ) {
+ if ( getStudy() && view ) {
SUIT_ViewModel* viewModel = dynamic_cast<SUIT_ViewModel*>( view );
SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0;
int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1;
if ( viewModel && viewId != -1 ) {
// get properties from the study
- PropMap storedMap = study->getObjectProperties( viewId, entry );
+ PropMap storedMap = getStudy()->getObjectProperties( viewId, entry );
// overwrite default properties from stored ones (that are specified)
for ( int prop = GEOM::Visibility; prop <= GEOM::LastProperty; prop++ ) {
if ( storedMap.contains( GEOM::propertyName( (GEOM::Property)prop ) ) )
if ( !entry.isEmpty() ) {
// get CORBA reference to geom object
- _PTR(SObject) SO( study->studyDS()->FindObjectID( entry.toStdString() ) );
+ _PTR(SObject) SO( getStudy()->studyDS()->FindObjectID( entry.toStdString() ) );
if ( SO ) {
CORBA::Object_var object = GeometryGUI::ClientSObjectToObject( SO );
if ( !CORBA::is_nil( object ) ) {
void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO,
- const bool eraseOnlyChildren) {
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if ( !app )
- return;
-
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !appStudy )
- return;
-
- LightApp_DataObject* parent = appStudy->findObjectByEntry(theIO->getEntry());
+ const bool eraseOnlyChildren)
+{
+ LightApp_DataObject* parent = getStudy()->findObjectByEntry(theIO->getEntry());
if( !parent)
return;
// Erase from all views
QList<SALOME_View*> views;
SALOME_View* view;
- ViewManagerList vmans = app->viewManagers();
+ ViewManagerList vmans = myApp->viewManagers();
SUIT_ViewManager* vman;
foreach ( vman, vmans ) {
SUIT_ViewModel* vmod = vman->getViewModel();
void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer )
{
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
- if( !aStudy )
- return;
-
SOCC_Viewer* aViewModel = dynamic_cast<SOCC_Viewer*>( GetActiveView() );
if( !aViewModel )
return;
if( theIsRedisplayFieldSteps )
{
- _PTR(Study) aStudyDS = aStudy->studyDS();
+ _PTR(Study) aStudyDS = getStudy()->studyDS();
QList<SUIT_ViewManager*> vmList;
myApp->viewManagers( vmList );
for( QList<SUIT_ViewManager*>::Iterator vmIt = vmList.begin(); vmIt != vmList.end(); vmIt++ )
{
if( SUIT_ViewManager* aViewManager = *vmIt )
{
- const ObjMap& anObjects = aStudy->getObjectProperties( aViewManager->getGlobalId() );
+ const ObjMap& anObjects = getStudy()->getObjectProperties( aViewManager->getGlobalId() );
for( ObjMap::ConstIterator objIt = anObjects.begin(); objIt != anObjects.end(); objIt++ )
{
_PTR(SObject) aSObj( aStudyDS->FindObjectID( objIt.key().toLatin1().constData() ) );
public:
/* Constructor */
- GEOM_Displayer( SalomeApp_Study* app );
+ GEOM_Displayer();
/* Destructor */
virtual ~GEOM_Displayer();
void updateDimensions( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& );
void updateShapeAnnotations( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& );
- PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 );
+ PropMap getObjectProperties( const QString&, SALOME_View* = 0 );
PropMap getDefaultPropertyMap();
/* Methods for reading the field step information */
}
}
-GeometryGUI::StudyTextureMap GeometryGUI::myTextureMap;
+GeometryGUI::TextureMap GeometryGUI::myTextureMap;
GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil();
}
//=======================================================================
-// function : ClientStudyToStudy
+// function : GetStudy
// purpose :
//=======================================================================
-SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy)
+SALOMEDS::Study_var GeometryGUI::getStudyServant()
{
SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
- int aStudyID = theStudy->StudyId();
- SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID);
- return aDSStudy._retn();
+ CORBA::Object_var aStudyObject = aNamingService->Resolve("/Study");
+ SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(aStudyObject);
+ return aStudy._retn();
}
void GeometryGUI::Modified (bool theIsUpdateActions)
return;
}
if ( appStudy ) {
- _PTR(Study) studyDS = appStudy->studyDS();
- if ( studyDS && !CORBA::is_nil( GetGeomGen() ) ) {
- GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() );
+ if ( !CORBA::is_nil( GetGeomGen() ) ) {
+ GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations();
if ( !aBasicOperations->_is_nil() ) {
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 );
GEOM::GEOM_Object_var anOY = aBasicOperations->MakeVectorDXDYDZ( 0.0, aLength, 0.0 );
GEOM::GEOM_Object_var anOZ = aBasicOperations->MakeVectorDXDYDZ( 0.0, 0.0, aLength );
- SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( studyDS );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOrigin, "O" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" );
- GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" );
+ GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOrigin, "O" );
+ GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOX, "OX" );
+ GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOY, "OY" );
+ GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(), anOZ, "OZ" );
anOrigin->UnRegister();
anOX->UnRegister();
anOY->UnRegister();
SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( getApp()->activeStudy() );
if (!appStudy) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
void GeometryGUI::updateFieldColorScale()
{
- if( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) )
- {
- GEOM_Displayer aDisplayer( aStudy );
- aDisplayer.UpdateColorScale();
- }
+ GEOM_Displayer aDisplayer;
+ aDisplayer.UpdateColorScale();
}
QString GeometryGUI::engineIOR() const
return "";
}
-Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture
- (SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight)
+Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture (int theId, int& theWidth, int& theHeight)
{
theWidth = theHeight = 0;
Handle(TColStd_HArray1OfByte) aTexture;
- if (theStudy) {
- TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ];
- aTexture = aTextureMap[ theId ];
- if ( aTexture.IsNull() ) {
- GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations( theStudy->studyDS()->StudyId() );
- if ( !aInsOp->_is_nil() ) {
- CORBA::Long aWidth, aHeight;
- SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
- if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
- theWidth = aWidth;
- theHeight = aHeight;
-
- aTexture = new TColStd_HArray1OfByte (1, aStream->length());
-
- for ( CORBA::ULong i = 0; i < aStream->length(); i++)
- aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
- aTextureMap[ theId ] = aTexture;
- }
+ aTexture = myTextureMap[ theId ];
+ if ( aTexture.IsNull() ) {
+ GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations();
+ if ( !aInsOp->_is_nil() ) {
+ CORBA::Long aWidth, aHeight;
+ SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
+ if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
+ theWidth = aWidth;
+ theHeight = aHeight;
+
+ aTexture = new TColStd_HArray1OfByte (1, aStream->length());
+
+ for ( CORBA::ULong i = 0; i < aStream->length(); i++)
+ aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
+ myTextureMap[ theId ] = aTexture;
}
}
}
param == QString("scalar_bar_height") ||
param == QString("scalar_bar_text_height") ||
param == QString("scalar_bar_nb_intervals")) {
- if( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) )
- {
- GEOM_Displayer aDisplayer( aStudy );
- bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals");
- aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
- }
+ GEOM_Displayer aDisplayer;
+ bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals");
+ aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
}
else if ( param == QString("dimensions_color") ||
param == QString("dimensions_line_width") ||
return;
}
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
- if ( !aStudy )
- {
- return;
- }
-
- GEOM_Displayer aDisplayer( aStudy );
+ GEOM_Displayer aDisplayer;
ViewManagerList aVMs;
anApp->viewManagers( OCCViewer_Viewer::Type(), aVMs );
LightApp_Displayer* GeometryGUI::displayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
std::string aStoreEntry = ip->encodeEntry( aStudyEntry, componentName );
// store dimension parameters
- GEOMGUI_DimensionProperty aDimensions( appStudy, aStudyEntry );
+ GEOMGUI_DimensionProperty aDimensions( aStudyEntry );
if ( aDimensions.GetNumber() != 0 ) {
ip->setParameter( aStoreEntry, aDimensionParam.toStdString(), ((QString)aDimensions).toLatin1().data() );
}
if ( aParamNameStr == GEOM::propertyName( GEOM::Dimensions ) )
{
GEOMGUI_DimensionProperty aDimensionProp( aValuesStr );
- aDimensionProp.SaveToAttribute( appStudy, entry.toLatin1().data() );
+ aDimensionProp.SaveToAttribute( entry.toLatin1().data() );
}
else if ( aParamNameStr == GEOM::propertyName( GEOM::ShapeAnnotations ) )
{
bool isMode = false;
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int aMgrId = viewWindow->getViewManager()->getGlobalId();
SALOME_View* window = displayer.GetActiveView();
TCollection_AsciiString asciiIOR( (char *)IOR.in() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
- SALOMEDSClient_StudyManager *aManager = SalomeApp_Application::studyMgr();
+ SalomeApp_Application* app =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
+ SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
- if (!aManager)
+ if (!appStudy)
return;
- _PTR(Study) aStudy = aManager->GetStudyByID(theObj->GetStudyID());
+ _PTR(Study) aStudy = appStudy->studyDS();
if ( !aStudy )
return;
_PTR(SObject) aSO = dataObj->object();
if ( aSO ) {
_PTR(GenericAttribute) anAttr;
- _PTR(SObject) aFatherSO = aSO->GetStudy()->GetUseCaseBuilder()->GetFather( aSO );
+ _PTR(SObject) aFatherSO = SalomeApp_Application::getStudy()->GetUseCaseBuilder()->GetFather( aSO );
if ( aFatherSO && aFatherSO->FindAttribute(anAttr, "AttributeLocalID") ) {
_PTR(AttributeLocalID) aLocalID( anAttr );
anObjectInFolder = aLocalID->Value() == 999;
_PTR(SObject) parentObj = dataObj->object();
// Find the current Study and StudyBuilder
- _PTR(Study) aStudy = parentObj->GetStudy();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
_PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
// collect all parents of the target node
QStringList parentIDs;
virtual void initialize( CAM_Application* );
virtual QString engineIOR() const;
- static Handle(TColStd_HArray1OfByte) getTexture (SalomeApp_Study*, int, int&, int&);
+ static Handle(TColStd_HArray1OfByte) getTexture (int, int&, int&);
static bool InitGeomGen();
static GEOM::GEOM_Gen_var GetGeomGen();
static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
- static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
+ static SALOMEDS::Study_var getStudyServant();
static void Modified( bool = true );
typedef QMap<long, Handle(TColStd_HArray1OfByte)> TextureMap;
- typedef QMap<long, TextureMap> StudyTextureMap;
typedef QMap<QString, GEOMGUI*> GUIMap;
typedef QPair<QString, QString> PluginAction;
- GUIMap myGUIMap; // GUI libraries map
- QDialog* myActiveDialogBox; // active dialog box
- gp_Ax3 myWorkingPlane;
- //QMap<int,QString> myRules; // popup rules
- static StudyTextureMap myTextureMap; // texture map
+ GUIMap myGUIMap; // GUI libraries map
+ QDialog* myActiveDialogBox; // active dialog box
+ gp_Ax3 myWorkingPlane;
+ //QMap<int,QString> myRules; // popup rules
+ static TextureMap myTextureMap; // texture map
- QMap<int, PluginAction> myPluginActions; // plugin actions
- QMap<QString, QString> myPluginLibs; // plugin name to plugin client library
+ QMap<int, PluginAction> myPluginActions; // plugin actions
+ QMap<QString, QString> myPluginLibs; // plugin name to plugin client library
QList<GEOMGUI_OCCSelector*> myOCCSelectors;
QList<LightApp_VTKSelector*> myVTKSelectors;
- LightApp_Displayer* myDisplayer;
- int myLocalSelectionMode; //Select Only
+ LightApp_Displayer* myDisplayer;
+ int myLocalSelectionMode; //Select Only
- GEOMGUI_CreationInfoWdg* myCreationInfoWdg;
+ GEOMGUI_CreationInfoWdg* myCreationInfoWdg;
GEOMGUI_TextTreeWdg* myTextTreeWdg;
GEOMGUI_AnnotationMgr* myAnnotationMgr;
- SALOME_ListIO myTopLevelIOList;
+ SALOME_ListIO myTopLevelIOList;
friend class DisplayGUI;
};
if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty())
return 0;
- if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( GetDocID(), obj, aFileName, aFormatName ) );
+ if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( obj, aFileName, aFormatName ) );
return 0;
#if OCC_VERSION_MAJOR < 7
GEOMImpl_Gen::GEOMImpl_Gen()
{
MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
- _mapOfBasicOperations.clear();
// Basic elements
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
SetEngine(this);
+
+ _BasicOperations = new GEOMImpl_IBasicOperations( this );
+ _TransformOperations = new GEOMImpl_ITransformOperations( this );
+ _3DPrimOperations = new GEOMImpl_I3DPrimOperations( this );
+ _ShapesOperations = new GEOMImpl_IShapesOperations( this );
+ _BlocksOperations = new GEOMImpl_IBlocksOperations( this );
+ _BooleanOperations = new GEOMImpl_IBooleanOperations( this );
+ _HealingOperations = new GEOMImpl_IHealingOperations( this );
+ _CurvesOperations = new GEOMImpl_ICurvesOperations( this );
+ _LocalOperations = new GEOMImpl_ILocalOperations( this );
+ _InsertOperations = new GEOMImpl_IInsertOperations( this );
+ _MeasureOperations = new GEOMImpl_IMeasureOperations( this );
+ _GroupOperations = new GEOMImpl_IGroupOperations( this );
+ _FieldOperations = new GEOMImpl_IFieldOperations( this );
}
//=============================================================================
{
MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
- std::map<int, GEOMImpl_IBasicOperations*>::iterator aBasicIter = _mapOfBasicOperations.begin();
- for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++)
- delete (*aBasicIter).second;
-
- std::map<int, GEOMImpl_ITransformOperations*>::iterator aTransformIter = _mapOfTransformOperations.begin();
- for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++)
- delete (*aTransformIter).second;
-
- std::map<int, GEOMImpl_I3DPrimOperations*>::iterator a3DPrimIter = _mapOf3DPrimOperations.begin();
- for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++)
- delete (*a3DPrimIter).second;
-
- std::map<int, GEOMImpl_IShapesOperations*>::iterator aShapesIter = _mapOfShapesOperations.begin();
- for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++)
- delete (*aShapesIter).second;
-
- std::map<int, GEOMImpl_IBlocksOperations*>::iterator aBlocksIter = _mapOfBlocksOperations.begin();
- for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++)
- delete (*aBlocksIter).second;
-
- std::map<int, GEOMImpl_IBooleanOperations*>::iterator aBooleanIter = _mapOfBooleanOperations.begin();
- for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++)
- delete (*aBooleanIter).second;
-
- std::map<int, GEOMImpl_IHealingOperations*>::iterator aHealingIter = _mapOfHealingOperations.begin();
- for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++)
- delete (*aHealingIter).second;
-
- std::map<int, GEOMImpl_ICurvesOperations*>::iterator aCurvesIter = _mapOfCurvesOperations.begin();
- for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++)
- delete (*aCurvesIter).second;
-
- std::map<int, GEOMImpl_ILocalOperations*>::iterator aLocalIter = _mapOfLocalOperations.begin();
- for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++)
- delete (*aLocalIter).second;
-
- std::map<int, GEOMImpl_IInsertOperations*>::iterator aInsertIter = _mapOfInsertOperations.begin();
- for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++)
- delete (*aInsertIter).second;
-
- std::map<int, GEOMImpl_IMeasureOperations*>::iterator aMeasureIter = _mapOfMeasureOperations.begin();
- for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++)
- delete (*aMeasureIter).second;
-
- std::map<int, GEOMImpl_IGroupOperations*>::iterator aGroupIter = _mapOfGroupOperations.begin();
- for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++)
- delete (*aGroupIter).second;
-
- std::map<int, GEOMImpl_IFieldOperations*>::iterator aFieldIter = _mapOfFieldOperations.begin();
- for (; aFieldIter != _mapOfFieldOperations.end(); aFieldIter++)
- delete (*aFieldIter).second;
+ delete _BasicOperations;
+ delete _TransformOperations;
+ delete _3DPrimOperations;
+ delete _ShapesOperations;
+ delete _BlocksOperations;
+ delete _BooleanOperations;
+ delete _HealingOperations;
+ delete _CurvesOperations;
+ delete _LocalOperations;
+ delete _InsertOperations;
+ delete _MeasureOperations;
+ delete _GroupOperations;
+ delete _FieldOperations;
}
//=============================================================================
* GetIBasicOperations
*/
//=============================================================================
-GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID)
+GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations()
{
- if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) {
- _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID);
- }
-
- return _mapOfBasicOperations[theDocID];
+ return _BasicOperations;
}
//=============================================================================
* GetITransformOperations
*/
//=============================================================================
-GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID)
+GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations()
{
- if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) {
- _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID);
- }
-
- return _mapOfTransformOperations[theDocID];
+ return _TransformOperations;
}
//=============================================================================
* GetIBooleanOperations
*/
//=============================================================================
-GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID)
+GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations()
{
- if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) {
- _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID);
- }
-
- return _mapOfBooleanOperations[theDocID];
+ return _BooleanOperations;
}
//=============================================================================
* GetIHealingOperations
*/
//=============================================================================
-GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID)
+GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations()
{
- if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) {
- _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID);
- }
-
- return _mapOfHealingOperations[theDocID];
+ return _HealingOperations;
}
//=============================================================================
* GetI3DPrimOperations
*/
//=============================================================================
-GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID)
+GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations()
{
- if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) {
- _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID);
- }
-
- return _mapOf3DPrimOperations[theDocID];
+ return _3DPrimOperations;
}
//=============================================================================
* GetIShapesOperations
*/
//=============================================================================
-GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID)
+GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations()
{
- if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) {
- _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID);
- }
-
- return _mapOfShapesOperations[theDocID];
+ return _ShapesOperations;
}
//=============================================================================
* GetIBlocksOperations
*/
//=============================================================================
-GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID)
+GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations()
{
- if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) {
- _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID);
- }
-
- return _mapOfBlocksOperations[theDocID];
+ return _BlocksOperations;
}
//=============================================================================
* GetICurvesOperations
*/
//=============================================================================
-GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID)
+GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations()
{
- if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) {
- _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID);
- }
-
- return _mapOfCurvesOperations[theDocID];
+ return _CurvesOperations;
}
//=============================================================================
* GetILocalOperations
*/
//=============================================================================
-GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID)
+GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations()
{
- if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) {
- _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID);
- }
-
- return _mapOfLocalOperations[theDocID];
+ return _LocalOperations;
}
//=============================================================================
* GetIInsertOperations
*/
//=============================================================================
-GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID)
+GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations()
{
- if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) {
- _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID);
- }
-
- return _mapOfInsertOperations[theDocID];
+ return _InsertOperations;
}
//=============================================================================
* GetIMeasureOperations
*/
//=============================================================================
-GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID)
+GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations()
{
- if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) {
- _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID);
- }
-
- return _mapOfMeasureOperations[theDocID];
+ return _MeasureOperations;
}
//=============================================================================
* GetIGroupOperations
*/
//=============================================================================
-GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID)
+GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations()
{
- if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) {
- _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID);
- }
-
- return _mapOfGroupOperations[theDocID];
+ return _GroupOperations;
}
//=============================================================================
* GetIFieldOperations
*/
//=============================================================================
-GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations(int theDocID)
+GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations()
{
- if(_mapOfFieldOperations.find(theDocID) == _mapOfFieldOperations.end()) {
- _mapOfFieldOperations[theDocID] = new GEOMImpl_IFieldOperations(this, theDocID);
- }
-
- return _mapOfFieldOperations[theDocID];
+ return _FieldOperations;
}
GEOMImpl_Gen();
~GEOMImpl_Gen();
- GEOMImpl_IBasicOperations* GetIBasicOperations(int theDocID);
+ GEOMImpl_IBasicOperations* GetIBasicOperations();
- GEOMImpl_ITransformOperations* GetITransformOperations(int theDocID);
+ GEOMImpl_ITransformOperations* GetITransformOperations();
- GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(int theDocID);
+ GEOMImpl_I3DPrimOperations* GetI3DPrimOperations();
- GEOMImpl_IShapesOperations* GetIShapesOperations(int theDocID);
+ GEOMImpl_IShapesOperations* GetIShapesOperations();
- GEOMImpl_IBlocksOperations* GetIBlocksOperations(int theDocID);
+ GEOMImpl_IBlocksOperations* GetIBlocksOperations();
- GEOMImpl_IMeasureOperations* GetIMeasureOperations(int theDocID);
+ GEOMImpl_IMeasureOperations* GetIMeasureOperations();
- GEOMImpl_IBooleanOperations* GetIBooleanOperations(int theDocID);
+ GEOMImpl_IBooleanOperations* GetIBooleanOperations();
- GEOMImpl_ICurvesOperations* GetICurvesOperations(int theDocID);
+ GEOMImpl_ICurvesOperations* GetICurvesOperations();
- GEOMImpl_ILocalOperations* GetILocalOperations(int theDocID);
+ GEOMImpl_ILocalOperations* GetILocalOperations();
- GEOMImpl_IInsertOperations* GetIInsertOperations(int theDocID);
+ GEOMImpl_IInsertOperations* GetIInsertOperations();
- GEOMImpl_IHealingOperations* GetIHealingOperations(int theDocID);
+ GEOMImpl_IHealingOperations* GetIHealingOperations();
- GEOMImpl_IGroupOperations* GetIGroupOperations(int theDocID);
+ GEOMImpl_IGroupOperations* GetIGroupOperations();
- GEOMImpl_IFieldOperations* GetIFieldOperations(int theDocID);
+ GEOMImpl_IFieldOperations* GetIFieldOperations();
private:
- std::map <int, GEOMImpl_IBasicOperations*> _mapOfBasicOperations;
- std::map <int, GEOMImpl_ITransformOperations*> _mapOfTransformOperations;
- std::map <int, GEOMImpl_I3DPrimOperations*> _mapOf3DPrimOperations;
- std::map <int, GEOMImpl_IShapesOperations*> _mapOfShapesOperations;
- std::map <int, GEOMImpl_IBlocksOperations*> _mapOfBlocksOperations;
- std::map <int, GEOMImpl_IBooleanOperations*> _mapOfBooleanOperations;
- std::map <int, GEOMImpl_IHealingOperations*> _mapOfHealingOperations;
- std::map <int, GEOMImpl_ICurvesOperations*> _mapOfCurvesOperations;
- std::map <int, GEOMImpl_ILocalOperations*> _mapOfLocalOperations;
- std::map <int, GEOMImpl_IInsertOperations*> _mapOfInsertOperations;
- std::map <int, GEOMImpl_IMeasureOperations*> _mapOfMeasureOperations;
- std::map <int, GEOMImpl_IGroupOperations*> _mapOfGroupOperations;
- std::map <int, GEOMImpl_IFieldOperations*> _mapOfFieldOperations;
+ GEOMImpl_IBasicOperations* _BasicOperations;
+ GEOMImpl_ITransformOperations* _TransformOperations;
+ GEOMImpl_I3DPrimOperations* _3DPrimOperations;
+ GEOMImpl_IShapesOperations* _ShapesOperations;
+ GEOMImpl_IBlocksOperations* _BlocksOperations;
+ GEOMImpl_IBooleanOperations* _BooleanOperations;
+ GEOMImpl_IHealingOperations* _HealingOperations;
+ GEOMImpl_ICurvesOperations* _CurvesOperations;
+ GEOMImpl_ILocalOperations* _LocalOperations;
+ GEOMImpl_IInsertOperations* _InsertOperations;
+ GEOMImpl_IMeasureOperations* _MeasureOperations;
+ GEOMImpl_IGroupOperations* _GroupOperations;
+ GEOMImpl_IFieldOperations* _FieldOperations;
};
#endif
* constructor:
*/
//=============================================================================
-GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations");
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
}
//=============================================================================
SetErrorCode(KO);
//Add a new Box object
- Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX);
//Add a new Box function with DX_DY_DZ parameters
Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_DX_DY_DZ);
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Box object
- Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_TWO_PNT);
if (theH == 0 || theW == 0) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_H_W);
if (theObj.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W);
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Disk function for creation a disk relatively to point and vector
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Disk function for creation a disk relatively to three points
Handle(GEOM_Function) aFunction =
if (theR == 0 ) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R);
SetErrorCode(KO);
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function with R and H parameters
Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H);
SetErrorCode(KO);
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function with R and H parameters
Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A);
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function for creation a cylinder relatively to point and vector
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function for creation a cylinder relatively to point and vector
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Cone object
- Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
+ Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE);
//Add a new Cone function with R and H parameters
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cone object
- Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
+ Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE);
//Add a new Cone function for creation a cone relatively to point and vector
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Sphere object
- Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
+ Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE);
//Add a new Sphere function with R parameter
Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_R);
if (thePnt.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
+ Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE);
//Add a new Sphere function for creation a sphere relatively to point
Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_PNT_R);
SetErrorCode(KO);
//Add a new Torus object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS);
//Add a new Torus function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Torus object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS);
//Add a new Torus function
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theVec.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to vector
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theVec.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to vector
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to two points
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to two points
Handle(GEOM_Function) aFunction =
if (theBase.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism by DXDYDZ
Handle(GEOM_Function) aFunction =
if (theBase.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism by DXDYDZ
Handle(GEOM_Function) aFunction =
if ( theFuse )
{
//Add a new Extruded Boss object
- aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_BOSS);
+ aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_BOSS);
}
else
{
//Add a new Extruded Cut object
- aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_CUT);
+ aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_CUT);
}
//Add a new Prism function for the creation of a Draft Prism feature
if (theBase.IsNull() || thePath.IsNull()) return NULL;
//Add a new Pipe object
- Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theAxis.IsNull()) return NULL;
//Add a new Revolution object
- Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+ Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION);
//Add a new Revolution function for creation a revolution relatively to axis
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theAxis.IsNull()) return NULL;
//Add a new Revolution object
- Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+ Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION);
//Add a new Revolution function for creation a revolution relatively to axis
Handle(GEOM_Function) aFunction =
return NULL;
}
//Add a new Filling object
- Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
+ Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GEOM_FILLING);
//Add a new Filling function for creation a filling from a compound
Handle(GEOM_Function) aFunction = aFilling->AddFunction(GEOMImpl_FillingDriver::GetID(), BASIC_FILLING);
return anObj;
//Add a new ThruSections object
- Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
+ Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GEOM_THRUSECTIONS);
//Add a new ThruSections function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
if (theBase.IsNull() || thePath.IsNull() || theVec.IsNull()) return NULL;
//Add a new Pipe object
- Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
if (isCopy)
{
//Add a new Copy object
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY);
}
else
if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
// Add a new Path object
- Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+ Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH);
// Add a new Path function
Handle(GEOM_Function) aFunction =
return NULL;
// Add a new Path object
- Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+ Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH);
// Add a new Path function
Handle(GEOM_Function) aFunction =
class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_I3DPrimOperations();
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
* constructor
*/
//=============================================================================
-GEOMImpl_IBaseIEOperations::GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBaseIEOperations::GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
- myGroupOperations = new GEOMImpl_IGroupOperations( GetEngine(), GetDocID() );
- myFieldOperations = new GEOMImpl_IFieldOperations( GetEngine(), GetDocID() );
- myShapesOperations = new GEOMImpl_IShapesOperations( GetEngine(), GetDocID() );
+ myGroupOperations = new GEOMImpl_IGroupOperations( GetEngine() );
+ myFieldOperations = new GEOMImpl_IFieldOperations( GetEngine() );
+ myShapesOperations = new GEOMImpl_IShapesOperations( GetEngine() );
}
//=============================================================================
class GEOMImpl_IBaseIEOperations : public GEOM_IOperations
{
public:
- Standard_EXPORT GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBaseIEOperations();
protected:
* constructor:
*/
//=============================================================================
-GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations");
}
SetErrorCode(KO);
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function with XYZ parameters
Handle(GEOM_Function) aFunction =
if (theReference.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF);
if (theGeomObj.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
int fType = POINT_CURVE_PAR;
if (theLine1.IsNull() || theLine2.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION);
if (theCurve.IsNull()) return NULL;
//Add a new Vector object
- Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVec = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR);
SetErrorCode(KO);
//Add a new Vector object
- Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Vector function with DXDYDZ parameters
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Vector object
- Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theDir.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (theVec1.IsNull() || theVec2.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBasicOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBasicOperations();
// Point
* constructor:
*/
//=============================================================================
-GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations");
}
theEdge3.IsNull() || theEdge4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
if (theEdge1.IsNull() || theEdge2.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
thePnt3.IsNull() || thePnt4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
theFace5.IsNull() || theFace6.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
if (theCompound.IsNull()) return NULL;
//Add a new object
- Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GetDocID(), GEOM_COMPOUND);
+ Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GEOM_COMPOUND);
//Add a new BlocksComp function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBlocksOperations();
// Creation of blocks and block faces
* constructor:
*/
//=============================================================================
-GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations");
}
if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction;
if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Partition object
- Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION);
+ Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GEOM_PARTITION);
//Add a new Partition function
Handle(GEOM_Function) aFunction;
if (theShape.IsNull() || thePlane.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aPart = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION);
+ Handle(GEOM_Object) aPart = GetEngine()->AddObject(GEOM_PARTITION);
//Add a new Partition function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBooleanOperations();
Standard_EXPORT Handle(GEOM_Object) MakeBoolean
* constructor:
*/
//=============================================================================
-GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations");
}
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to three points
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to center and 2 points
Handle(GEOM_Function) aFunction =
//if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to point and vector
Handle(GEOM_Function) aFunction =
//if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Ellipse object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_ELLIPSE);
//Add a new Ellipse function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_ELLIPSE_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Polyline object
- Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
+ Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GEOM_POLYLINE);
//Add a new Polyline function for creation a polyline relatively to points set
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
switch(theCurveType) {
case Polyline: {
//Add a new Polyline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
+ aCurve = GetEngine()->AddObject(GEOM_POLYLINE);
//Add a new Polyline function for creation a polyline relatively to points set
aFunction = aCurve->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS);
}
case Bezier: {
//Add a new Spline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ aCurve = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
aFunction =
aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER);
}
case Interpolation: {
//Add a new Spline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ aCurve = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION);
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Sketcher object
- Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER);
+ Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
//Add a new Spline object
Handle(GEOM_Object) anIsoline =
- GetEngine()->AddObject(GetDocID(), GEOM_ISOLINE);
+ GetEngine()->AddObject(GEOM_ISOLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
// Add a new Polyline object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ GetEngine()->AddObject(GEOM_POLYLINE2D);
Handle(GEOM_Function) aFunction = aResult->AddFunction
(GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_COORDS);
//Add a new Polyline object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ GetEngine()->AddObject(GEOM_POLYLINE2D);
Handle(GEOM_Function) aFunction = aResult->AddFunction
(GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_OBJECT);
enum CurveType { Polyline, Bezier, Interpolation };
- Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ICurvesOperations();
Standard_EXPORT Handle(GEOM_Object) MakeCircleThreePnt (Handle(GEOM_Object) thePnt1,
* Export
*/
//=============================================================================
-bool GEOMImpl_IECallBack::Export( int /*theDocId*/,
- const Handle(GEOM_Object) /*theOriginal*/,
+bool GEOMImpl_IECallBack::Export( const Handle(GEOM_Object) /*theOriginal*/,
const TCollection_AsciiString& /*theFileName*/,
const TCollection_AsciiString& /*theFormatName*/ )
{
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IECallBack::Import( int /*theDocId*/,
- const TCollection_AsciiString& /*theFormatName*/,
+GEOMImpl_IECallBack::Import( const TCollection_AsciiString& /*theFormatName*/,
const TCollection_AsciiString& /*theFileName*/ )
{
return NULL;
*/
//=============================================================================
TCollection_AsciiString
-GEOMImpl_IECallBack::ReadValue( int /*theDocId*/,
- const TCollection_AsciiString& /*theFileName*/,
+GEOMImpl_IECallBack::ReadValue( const TCollection_AsciiString& /*theFileName*/,
const TCollection_AsciiString& /*theFormatName*/,
const TCollection_AsciiString& /*theParameterName*/ )
{
Standard_EXPORT GEOMImpl_IECallBack();
Standard_EXPORT ~GEOMImpl_IECallBack();
- Standard_EXPORT virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+ Standard_EXPORT virtual bool Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
Standard_EXPORT virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
Standard_EXPORT virtual
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName );
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName );
Standard_EXPORT static void Register( const TCollection_AsciiString& theFormatName, GEOMImpl_IECallBack* theCallBack );
* constructor:
*/
//=============================================================================
-GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations");
}
// make a field
Handle(GEOM_Field) aField = Handle(GEOM_Field)::DownCast
- ( GetEngine()->AddBaseObject( GetDocID(), GEOM_FIELD ));
+ ( GetEngine()->AddBaseObject( GEOM_FIELD ));
// set field data
aField->Init( theShape, theName, theType, theDimension, theComponentNames );
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false);
nbFields += ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) );
}
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false);
if ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) )
{
Handle(GEOM_Field) field = Handle(GEOM_Field)::DownCast( anObj );
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( GetDocID(), entry, false ));
+ field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( entry, false ));
if ( !field.IsNull() && field->GetName() == theName ) {
SetErrorCode(OK);
break;
class GEOMImpl_IFieldOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IFieldOperations();
Standard_EXPORT Handle(GEOM_Field)
* constructor:
*/
//=============================================================================
-GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations");
}
class GEOMImpl_IGroupOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IGroupOperations();
Standard_EXPORT Handle(GEOM_Object) CreateGroup(Handle(GEOM_Object) theMainShape, TopAbs_ShapeEnum theShapeType);
* constructor:
*/
//=============================================================================
-GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
myModifStats = new ShHealOper_ModifStats;
MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
Handle(GEOM_Function)
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT);
if (theWire.IsNull()) return NULL;
// Add a new object
- Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), theWire->GetType());
+ Handle(GEOM_Object) aRes = GetEngine()->AddObject(theWire->GetType());
// Add a new function
Handle(GEOM_Function) aFunction;
TopExp_Explorer anExp;
for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
}
for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
//Add the function
return NULL; // There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(theObject->GetType());
// Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE);
class GEOMImpl_IHealingOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IHealingOperations();
// Apply Shape Processing to the selected Object
* constructor
*/
//=============================================================================
-GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations");
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
- myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine(), GetDocID());
+ myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
+ myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine());
}
//=============================================================================
if (theOriginal.IsNull()) return NULL;
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a Copy function for creation a copy object
Handle(GEOM_Function) aFunction = aCopy->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITH_REF);
if (theOriginal.IsNull()) return;
- if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) )
+ if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( theOriginal, theFileName, theFormatName ) )
return;
SetErrorCode(OK);
}
if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL;
Handle(TColStd_HSequenceOfTransient) aSeq =
- GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName );
+ GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( theFormatName, theFileName );
SetErrorCode(OK);
return aSeq;
}
TCollection_AsciiString aValue;
if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
- aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName );
+ aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( theFileName, theFormatName, theParameterName );
SetErrorCode(OK);
return aValue;
SetErrorCode(KO);
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_COPY);
//Add a Copy function
Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF);
for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i)
aTexture->SetValue(i, (Standard_Byte)(*bdit));
- int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile);
+ int aTextureId = GetEngine()->addTexture(lenbytes*8, lines.size(), aTexture, theTextureFile);
if (aTextureId > 0) SetErrorCode(OK);
return aTextureId;
}
const Handle(TColStd_HArray1OfByte)& theTexture)
{
SetErrorCode(KO);
- int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
+ int aTextureId = GetEngine()->addTexture(theWidth, theHeight, theTexture);
if (aTextureId > 0) SetErrorCode(OK);
return aTextureId;
}
if (theTextureId <= 0)
return aTexture;
- aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName);
+ aTexture = GetEngine()->getTexture(theTextureId, theWidth, theHeight, aFileName);
if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK);
std::list<int> GEOMImpl_IInsertOperations::GetAllTextures()
{
SetErrorCode(KO);
- std::list<int> id_list = GetEngine()->getAllTextures(GetDocID());
+ std::list<int> id_list = GetEngine()->getAllTextures();
SetErrorCode(OK);
return id_list;
}
//Add a new Transfer Data object object
Handle(GEOM_Object) aTDObj =
- GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA);
+ GetEngine()->AddObject(GEOM_TRANSFER_DATA);
//Add a Transfer Data function for created object
Handle(GEOM_Function) aFunction =
long myMaxNumber;
};
- Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IInsertOperations();
* constructor:
*/
//=============================================================================
-GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations");
}
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D);
+ Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GEOM_FILLET_2D);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D);
+ Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GEOM_FILLET_1D);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Archimede object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_ARCHIMEDE);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_ARCHIMEDE);
//Add a new Archimede function
Handle(GEOM_Function) aFunction = aChamfer->AddFunction(GEOMImpl_ArchimedeDriver::GetID(), ARCHIMEDE_TYPE);
if (aGen) {
GEOMImpl_IShapesOperations* anIShapesOperations =
- aGen->GetIShapesOperations(GetDocID());
+ aGen->GetIShapesOperations();
anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape);
SetErrorCode(anIShapesOperations->GetErrorCode());
}
class GEOMImpl_ILocalOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ILocalOperations();
Standard_EXPORT Handle(GEOM_Object) MakeFilletAll (Handle(GEOM_Object) theShape, double theR);
* Constructor
*/
//=============================================================================
-GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations");
}
if (theShape.IsNull()) return NULL;
//Add a new CentreOfMass object
- Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GetDocID(), GEOM_CDG);
+ Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GEOM_CDG);
//Add a new CentreOfMass function
Handle(GEOM_Function) aFunction =
if (aRefShape.IsNull()) return NULL;
//Add a new Vertex object
- Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GEOM_POINT);
//Add a function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Normale object
- Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Normale function
Handle(GEOM_Function) aFunction =
if (theShape.IsNull()) return NULL;
//Add a new BoundingBox object
- Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GEOM_BOX);
//Add a new BoundingBox function
const int aType = (precise ? BND_BOX_MEASURE_PRECISE : BND_BOX_MEASURE);
class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IMeasureOperations();
enum ShapeKind {
* constructor:
*/
//=============================================================================
-GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations");
}
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (theRefCurve.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (theWire.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aWire = GetEngine()->AddObject(GetDocID(), GEOM_WIRE);
+ Handle(GEOM_Object) aWire = GetEngine()->AddObject(GEOM_WIRE);
//Add a new function
Handle(GEOM_Function) aFunction =
if (theWire.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Shape function for creation of a face from a wire
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FILLING);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), theObjectType);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(theObjectType);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
+ Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GEOM_SOLID);
//Add a new function
Handle(GEOM_Function) aFunction =
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
return NULL;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
Standard_Integer aStrLen = anEntry.LengthOfCString();
char* anEntryStr = new char[aStrLen+1];
anEntry.ToUTF8CString(anEntryStr);
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(anEntryStr, false);
if (!anObj.IsNull() ) {
bool isGroup = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() == GEOM_GROUP;
bool isSubShape = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() != GEOM_GROUP;
//anObj = GetEngine()->AddSubShape(theShape, anArray);
{
- anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ anObj = GetEngine()->AddObject(GEOM_SUBSHAPE);
Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull()) return aSeq;
anArray = new TColStd_HArray1OfInteger(1,1);
anArray->SetValue(1, id);
- anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ anObj = GetEngine()->AddObject(GEOM_SUBSHAPE);
if (!anObj.IsNull()) {
Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull()) return aSeq;
/*
//Add a new reversed object
- Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType());
+ Handle(GEOM_Object) aReversed = GetEngine()->AddObject(theShape->GetType());
//Add a new Revese function
Handle(GEOM_Function) aFunction;
if (aGen) {
GEOMImpl_IHealingOperations* anIHealingOperations =
- aGen->GetIHealingOperations(GetDocID());
+ aGen->GetIHealingOperations();
aReversed = anIHealingOperations->ChangeOrientationCopy(theShape);
SetErrorCode(anIHealingOperations->GetErrorCode());
}
}
//Add a new result object
- Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), GEOM_SHAPES_ON_SHAPE);
+ Handle(GEOM_Object) aRes = GetEngine()->AddObject(GEOM_SHAPES_ON_SHAPE);
Handle(GEOM_Function) aFunction =
aRes->AddFunction(GEOMImpl_ShapeDriver::GetID(), SHAPES_ON_SHAPE);
aFunction->SetValue(aCompound);
//Add a new Result object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_EXTRACTION);
+ GetEngine()->AddObject(GEOM_EXTRACTION);
//Add a new Extraction function
Handle(GEOM_Function) aFunction =
}
//Add a new Edge object
- Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
}
//Add a new Face object
- Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
}
//Add a new Face object
- Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
std::list<Standard_Integer> indices; ///< Shape indices touched by this type of modification.
};
- Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IShapesOperations();
Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
*/
//=============================================================================
-GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations");
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
//Add a translate function
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_TranslateDriver::GetID(), TRANSLATE_VECTOR_DISTANCE);
}
else {
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a new Offset function
Handle(GEOM_Function) aFunction =
else
{
//Add a new Projection object
- aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ aCopy = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction =
}
//Add a new Projection object
- thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ thePointOnEdge = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a scale function
Handle(GEOM_Function) aFunction =
Handle(GEOM_Object) aCopy; //Add a new Copy object
Handle(GEOM_Function) aFunction;
if (doCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_ScaleDriver::GetID(), SCALE_SHAPE_AXES_COPY);
}
else {
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a position function
Standard_Integer aType = POSITION_SHAPE_COPY;
Handle(GEOM_Object) aCopy;
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_ALONG_PATH);
}
else
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
// Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
// Add a transform function (depends on theSample function)
Handle(GEOM_Function) aFunction =
//Add a new Projection object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = aResult->AddFunction
class GEOMImpl_ITransformOperations : public GEOM_IOperations
{
public:
- Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ITransformOperations();
Standard_EXPORT Handle(GEOM_Object) TranslateTwoPoints (Handle(GEOM_Object) theObject,
return 0;
Handle(TColStd_HSequenceOfTransient) aSeq =
- GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( GetDocID(), aFormatName, aFileName );
+ GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( aFormatName, aFileName );
if( aSeq.IsNull() )
return 0;
// purpose : check if the object(s) passed as the the second arguments are used
// by the other objects in the study
//=====================================================================================
-static bool inUse( _PTR(Study) study, const QString& component, const QMap<QString,QString>& objects )
+static bool inUse( const QString& component, const QMap<QString,QString>& objects )
{
+ _PTR(Study) study = SalomeApp_Application::getStudy();
_PTR(SObject) comp = study->FindObjectID( component.toLatin1().data() );
if ( !comp )
return false;
QMap<QString,QString>& geomObjList,
QMap<QString,QString>& folderList ) {
if ( !theSO ) return;
- _PTR(Study) aStudy = theSO->GetStudy();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
if ( !aStudy ) return;
_PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
return;
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !aSelMgr || !appStudy )
+ if ( !aSelMgr )
return;
// get selection
if ( selected.IsEmpty() )
return;
- _PTR(Study) aStudy = appStudy->studyDS();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
_PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
// check if study is locked
}
_PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
- GEOM_Displayer disp( appStudy );
+ GEOM_Displayer disp;
disp.SetUpdateColorScale( false ); // IPAL54049
if ( isComponentSelected ) {
for ( it->InitEx( false ); it->More(); it->Next() ) {
_PTR(SObject) child( it->Value() );
// remove object from GEOM engine
- removeObjectWithChildren( child, aStudy, views, &disp );
+ removeObjectWithChildren( child, views, &disp );
// remove object from study
aStudyBuilder->RemoveObjectWithChildren( child );
// remove object from use case tree
}
else {
// GEOM component is not selected: check if selected objects are in use
- if ( inUse( aStudy, geomComp, allDeleted ) &&
+ if ( inUse( geomComp, allDeleted ) &&
SUIT_MessageBox::question( app->desktop(),
QObject::tr("WRN_WARNING"),
QObject::tr("DEP_OBJECT"),
for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) {
_PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
// remove object from GEOM engine
- removeObjectWithChildren( obj, aStudy, views, &disp );
+ removeObjectWithChildren( obj, views, &disp );
// remove objects from study
aStudyBuilder->RemoveObjectWithChildren( obj );
// remove object from use case tree
for ( it = toBeDelFolders.begin(); it != toBeDelFolders.end(); ++it ) {
_PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
// remove object from GEOM engine
- removeObjectWithChildren( obj, aStudy, views, &disp );
+ removeObjectWithChildren( obj, views, &disp );
// remove objects from study
aStudyBuilder->RemoveObjectWithChildren( obj );
// remove object from use case tree
// purpose : used by OnEditDelete() method
//=====================================================================================
void GEOMToolsGUI::removeObjectWithChildren(_PTR(SObject) obj,
- _PTR(Study) aStudy,
QList<SALOME_View*> views,
GEOM_Displayer* disp)
{
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
// iterate through all children of obj
for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
// for (_PTR(UseCaseIterator) it (aStudy->GetUseCaseBuilder()->GetUseCaseIterator(obj)); it->More(); it->Next()) {
_PTR(SObject) child (it->Value());
- removeObjectWithChildren(child, aStudy, views, disp);
+ removeObjectWithChildren(child, views, disp);
}
// erase object and remove it from engine
{
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( app ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer aDisp (appStudy);
+ GEOM_Displayer aDisp;
aDisp.GlobalSelection();
getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
}
// Recursive deletion of object with children
void removeObjectWithChildren( _PTR(SObject),
- _PTR(Study),
QList<SALOME_View*>,
GEOM_Displayer* );
};
QList<SALOMEDS::Color> aReservedColors;
- GEOM_Displayer displayer ( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
// get active view
SALOME_View* window = displayer.GetActiveView();
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
{
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( app ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer aDisp (appStudy);
+ GEOM_Displayer aDisp;
aDisp.GlobalSelection(mode);
getGeometryGUI()->setLocalSelectionMode(mode);
}
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !appStudy ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( study );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
}
}
}
- GEOM_Displayer displayer( getStudy() );
+ GEOM_Displayer displayer;
displayer.Redisplay( selected, true );
selMgr->setSelectedObjects( selected );
}
// ---
GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen();
- myOperation = engine->GetIInsertOperations( getStudy()->id() );
+ myOperation = engine->GetIInsertOperations();
GEOM::ListOfLong_var ids = myOperation->GetAllTextures();
for ( int i = 0; i < ids->length(); i++ )
addTexture( ids[i] );
if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
int tWidth, tHeight;
- Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
+ Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(id, tWidth, tHeight);
if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
QImage image( tWidth, tHeight, QImage::Format_Mono );
if ( appStudy ) {
_PTR(Study) aStudy = appStudy->studyDS();
if ( aStudy ) {
- GEOM_Displayer displayer ( appStudy );
- QTreeWidgetItemIterator it( myTreeWidget );
- while ( *it ) {
- QString entry = myEntryToItem.key( *it );
- _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) );
- if ( SO ) {
- GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
- if ( CORBA::is_nil( aGeomObject ) ) continue;
- if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
- Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
- displayer.Erase( io );
- }
- }
- ++it;
- }
- displayer.UpdateViewer();
+ GEOM_Displayer displayer;
+ QTreeWidgetItemIterator it( myTreeWidget );
+ while ( *it ) {
+ QString entry = myEntryToItem.key( *it );
+ _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) );
+ if ( SO ) {
+ GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
+ if ( CORBA::is_nil( aGeomObject ) ) continue;
+ if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
+ Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
+ displayer.Erase( io );
+ }
+ }
+ ++it;
+ }
+ displayer.UpdateViewer();
}
}
}
if(!myGeomRoot)
return;
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if(!appStudy )
- return;
-
- _PTR(Study) aStudy = appStudy->studyDS();
- if(!aStudy)
- return;
-
- buildTree(aStudy, myGeomRoot);
+ buildTree(myGeomRoot);
myTreeWidget->resizeColumnToContents(0);
myTreeWidget->resizeColumnToContents(1);
// function : findParentItem()
// purpose :
//=================================================================================
-QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(_PTR(Study) theStudy, SalomeApp_DataObject* theObject, BufferedList& theList ) {
+QTreeWidgetItem* GEOMToolsGUI_PublishDlg::findParentItem(SalomeApp_DataObject* theObject, BufferedList& theList ) {
QTreeWidgetItem* aResult = NULL;
SalomeApp_DataObject* aParrent = dynamic_cast<SalomeApp_DataObject*>(theObject->parent());
if( !(aResult = myEntryToItem.value(targetEntry)) ) {
if( aParrent != myGeomRoot ) {
QString aName;
- _PTR(SObject) aSO ( theStudy->FindObjectID(qPrintable(aParrent->entry())));
+ _PTR(SObject) aSO ( SalomeApp_Application::getStudy()->FindObjectID(qPrintable(aParrent->entry())));
_PTR(GenericAttribute) anAttr;
if ( aSO->FindAttribute(anAttr, "AttributeName") ) {
_PTR(AttributeName) anAttrName (anAttr);
aName = anAttrName->Value().c_str();
}
theList.push_front(qMakePair(targetEntry, aName));
- aResult = findParentItem(theStudy,aParrent,theList);
+ aResult = findParentItem(aParrent,theList);
} else {
//Publish List
for(int i = 0; i < theList.size(); i++ ) {
// function : buildTree()
// purpose :
//=================================================================================
-void GEOMToolsGUI_PublishDlg::buildTree(_PTR(Study) theStudy, SalomeApp_DataObject* theItem) {
+void GEOMToolsGUI_PublishDlg::buildTree(SalomeApp_DataObject* theItem) {
if(!theItem || theItem->isReference())
return;
//If object hasn't "AttributeDrawable" => it visible
bool isDrawable = true;
- _PTR(SObject) SO ( theStudy->FindObjectID(qPrintable(theItem->entry())));
+ _PTR(SObject) SO ( SalomeApp_Application::getStudy()->FindObjectID(qPrintable(theItem->entry())));
_PTR(GenericAttribute) anAttr;
if ( SO && SO->FindAttribute(anAttr, "AttributeDrawable") ) {
_PTR(AttributeDrawable) aDrw (anAttr);
aName = aAttrName->Value().c_str();
}
BufferedList aList;
- QTreeWidgetItem* parentItem = findParentItem(theStudy, theItem, aList);
+ QTreeWidgetItem* parentItem = findParentItem(theItem, aList);
createItem(parentItem,qMakePair(theItem->entry(),aName),true);
}
}
DataObjectList listObj = theItem->children( false );
DataObjectList::iterator itr = listObj.begin();
while( itr != listObj.end()) {
- buildTree(theStudy, dynamic_cast<SalomeApp_DataObject*>(*itr));
+ buildTree(dynamic_cast<SalomeApp_DataObject*>(*itr));
itr++;
}
}
if ( !SO ) return;
GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
if ( CORBA::is_nil( aGeomObject ) ) return;
- GEOM_Displayer displayer ( appStudy );
+ GEOM_Displayer displayer;
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
protected:
void initData();
- void buildTree(_PTR(Study) theStudy, SalomeApp_DataObject* theItem);
- QTreeWidgetItem* findParentItem(_PTR(Study) theStudy, SalomeApp_DataObject* theItem, BufferedList& theList);
+ void buildTree(SalomeApp_DataObject* theItem);
+ QTreeWidgetItem* findParentItem(SalomeApp_DataObject* theItem, BufferedList& theList);
QTreeWidgetItem* createItem(QTreeWidgetItem* theItem, Pair theAttributes, bool isCheckable);
void getDrawableList(QTreeWidgetItem* theItem, QList<QTreeWidgetItem*>& theList);
void getTails(QTreeWidgetItem* theItem, QList<QTreeWidgetItem*>& theList);
#include <QMessageBox>
GEOMToolsGUI_ReduceStudyDlg::GEOMToolsGUI_ReduceStudyDlg( QWidget* parent )
-:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
-myDisplayer(NULL)
+:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
myApp = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( !myApp ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
- myStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() )->studyDS();
- myDisplayer = GEOM_Displayer( study );
+
+ myDisplayer = GEOM_Displayer();
setWindowTitle( tr( "GEOM_REDUCE_STUDY_TITLE" ) );
setAttribute(Qt::WA_DeleteOnClose);
GEOM::string_array_var subObjects = new GEOM::string_array();
GEOM::string_array_var otherObjects = new GEOM::string_array();
- GeometryGUI::GetGeomGen()->GetEntriesToReduceStudy( GeometryGUI::ClientStudyToStudy( myStudy ),
- keptObjects, parentsObjects,
- subObjects, otherObjects );
+ GeometryGUI::GetGeomGen()->GetEntriesToReduceStudy( keptObjects, parentsObjects,
+ subObjects, otherObjects );
for ( int i = 0; i < keptObjects->length(); i++ )
myKeptObjects.insert( keptObjects[i].in() );
std::set<std::string>::iterator it;
for( it = theObjects.begin(); it != theObjects.end(); ++it ) {
std::string objectEntry = *it;
- GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(), objectEntry.c_str() );
+ GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() );
GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
QString studyEntry = GeomBaseObject->GetStudyEntry();
if( GeomObject->_is_nil() || studyEntry.isEmpty() || !isObjectDrawable( studyEntry.toStdString() ) )
//=================================================================================
bool GEOMToolsGUI_ReduceStudyDlg::isObjectDrawable( std::string theStudyEntry )
{
- _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
+ _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
//If object hasn't "AttributeDrawable" => it visible
bool isDrawable = true;
- _PTR(SObject) SO ( myStudy->FindObjectID( theStudyEntry ) );
+ _PTR(SObject) SO ( aStudy->FindObjectID( theStudyEntry ) );
_PTR(GenericAttribute) anAttr;
if ( SO && SO->FindAttribute( anAttr, "AttributeDrawable" ) ) {
_PTR(AttributeDrawable) aDrw (anAttr);
//=================================================================================
void GEOMToolsGUI_ReduceStudyDlg::unpublishObjects( std::set<std::string>& theObjects )
{
- _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
+ _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
std::set<std::string>::iterator it;
for( it = theObjects.begin(); it != theObjects.end(); ++it ) {
std::string objectEntry = *it;
- GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(),
- objectEntry.c_str() );
+ GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() );
std::string studyEntry = GeomBaseObject->GetStudyEntry();
if ( studyEntry == "" || !isObjectDrawable( studyEntry ) )
continue;
- _PTR(SObject) obj ( myStudy->FindObjectID( studyEntry.c_str() ) );
+ _PTR(SObject) obj ( aStudy->FindObjectID( studyEntry.c_str() ) );
_PTR(GenericAttribute) anAttr;
if ( obj ) {
_PTR(AttributeDrawable) aDrw = aStudyBuilder->FindOrCreateAttribute( obj, "AttributeDrawable" );
aDrw->SetDrawable( false );
myDisplayer.EraseWithChildren( new SALOME_InteractiveObject( studyEntry.c_str(), "GEOM", "TEMP_IO" ) );
// hide references if any
- std::vector< _PTR(SObject) > vso = myStudy->FindDependances(obj);
+ std::vector< _PTR(SObject) > vso = aStudy->FindDependances(obj);
for ( int i = 0; i < vso.size(); i++ ) {
_PTR(SObject) refObj = vso[i];
aDrw = aStudyBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" );
std::set<std::string>::iterator it;
for( it = theObjects.begin(); it != theObjects.end(); ++it ) {
std::string objectEntry = *it;
- GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( myStudy->StudyId(),
- objectEntry.c_str() );
+ GEOM::GEOM_BaseObject_var GeomBaseObject = GeometryGUI::GetGeomGen()->GetObject( objectEntry.c_str() );
std::string studyEntry = GeomBaseObject->GetStudyEntry();
if ( studyEntry == "" )
GeometryGUI::GetGeomGen()->RemoveObject( GeomBaseObject );
void GEOMToolsGUI_ReduceStudyDlg::removeObject( std::string& theStudyEntry )
{
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
- _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder();
- _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder();
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
+ _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
+ _PTR(UseCaseBuilder) aUseCaseBuilder = aStudy->GetUseCaseBuilder();
- _PTR(SObject) obj ( myStudy->FindObjectID( theStudyEntry.c_str() ) );
+ _PTR(SObject) obj ( aStudy->FindObjectID( theStudyEntry.c_str() ) );
if ( obj ) {
// remove visual properties of the object
appStudy->removeObjectProperties(obj->GetID().c_str());
{
std::set<std::string> emptyFolders;
- _PTR(SComponent) SC ( myStudy->FindComponent( "GEOM" ) );
+ _PTR(Study) aStudy = SalomeApp_Application::getStudy();
+ _PTR(SComponent) SC ( aStudy->FindComponent( "GEOM" ) );
if ( !SC )
return;
- _PTR(ChildIterator) anIter ( myStudy->NewChildIterator( SC ) );
+ _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) );
anIter->InitEx( true );
while( anIter->More() ) {
_PTR(SObject) valSO ( anIter->Value() );
//=================================================================================
void GEOMToolsGUI_ReduceStudyDlg::getEmptyFolders( _PTR(SObject) theSO, std::set<std::string>& theFolders )
{
- _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder();
+ _PTR(UseCaseBuilder) aUseCaseBuilder = SalomeApp_Application::getStudy()->GetUseCaseBuilder();
bool isFolder = false;
_PTR(GenericAttribute) anAttr;
GEOM_Displayer myDisplayer;
SalomeApp_Application* myApp;
- _PTR(Study) myStudy;
};
return CORBA::string_dup(anEntstr);
}
-//=============================================================================
-/*!
- * GetStudyID
- */
-//=============================================================================
-
-CORBA::Long GEOM_BaseObject_i::GetStudyID()
-{
- return _impl->GetDocID();
-}
-
//=============================================================================
/*!
* GetType
HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i));
if (anObj.IsNull()) continue;
TDF_Tool::Entry(anObj->GetEntry(), anEntry);
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), (char*) anEntry.ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject((char*) anEntry.ToCString());
aList[i-1] = obj;
}
for (int i = 1; i<=aLength; i++) {
HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i));
if (anObj.IsNull()) continue;
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(),
- anObj->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetEntryString().ToCString());
aList[i-1] = GEOM::GEOM_BaseObject::_duplicate( obj );
}
virtual char* GetEntry();
- virtual CORBA::Long GetStudyID();
-
virtual CORBA::Long GetType();
virtual CORBA::Long GetTick();
//purpose :
//=======================================================================
-Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
- CORBA::Boolean isMultiFile,
+Engines::TMPFile* GEOM_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);
}
TCollection_AsciiString aScript;
- aScript += _impl->DumpPython(aStudy->StudyId(), objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript);
+ aScript += _impl->DumpPython(objectDataVec, aVariableMap, isPublished, isMultiFile, isValidScript);
if (isPublished)
{
HANDLE_NAMESPACE(GEOM_Object) shape = _impl->GetShape();
if ( !shape.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetDocID(),
- shape->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetEntryString().ToCString());
shapeVar = GEOM::GEOM_Object::_narrow( obj );
}
return shapeVar._retn();
HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->AddStep( stepID, stamp );
if ( !step.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(),
- step->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString());
stepVar = GEOM::GEOM_FieldStep::_narrow( obj );
}
return stepVar._retn();
HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->GetStep(stepID);
if ( !step.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(),
- step->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString());
stepVar = GEOM::GEOM_FieldStep::_narrow( obj );
}
return stepVar._retn();
HANDLE_NAMESPACE(GEOM_Field) field = _impl->GetField();
if ( !field.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetDocID(),
- field->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetEntryString().ToCString());
fieldVar = GEOM::GEOM_Field::_narrow( obj );
}
return fieldVar._retn();
CORBA::Boolean isMultiFile,
CORBA::Boolean isASCII)
{
- SALOMEDS::Study_var aStudy = theSObject->GetStudy();
-
HANDLE_NAMESPACE(GEOM_BaseObject) anObject =
- _impl->GetObject(aStudy->StudyId(), aLocalPersistentID);
+ _impl->GetObject(aLocalPersistentID);
if ( !anObject.IsNull() )
{
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObject->GetEntry(), anEntry);
- GEOM::GEOM_BaseObject_var obj = GetObject(anObject->GetDocID(), anEntry.ToCString());
+ GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString());
CORBA::String_var aPersRefString = _orb->object_to_string(obj);
return CORBA::string_dup(aPersRefString);
// function : PublishInStudy
// purpose :
//============================================================================
-SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject,
const char* theName)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
SALOMEDS::SObject_var aResultSO;
- if(CORBA::is_nil(theObject) || theStudy->_is_nil()) return aResultSO;
+ SALOMEDS::Study_var aStudy = getStudyServant();
+ if(CORBA::is_nil(theObject) || aStudy->_is_nil()) return aResultSO;
GEOM::GEOM_BaseObject_var aBaseObj = GEOM::GEOM_BaseObject::_narrow(theObject);
GEOM::GEOM_Object_var aShape = GEOM::GEOM_Object::_narrow(theObject);
if(aBaseObj->_is_nil()) return aResultSO;
SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
- SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theStudy->GetUseCaseBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = aStudy->GetUseCaseBuilder();
- SALOMEDS::SComponent_var aFather = theStudy->FindComponent("GEOM");
+ SALOMEDS::SComponent_var aFather = aStudy->FindComponent("GEOM");
if (aFather->_is_nil()) {
aFather = aStudyBuilder->NewComponent("GEOM");
anAttr = aStudyBuilder->FindOrCreateAttribute(aFather, "AttributeName");
// recieve current TopoDS shape
CORBA::String_var entry = aShape->GetEntry();
HANDLE_NAMESPACE(GEOM_Object) aGShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast
- ( _impl->GetObject( aShape->GetStudyID(), entry ));
+ ( _impl->GetObject( entry ));
TopoDS_Shape TopoSh = aGShape->GetValue();
// find label of main shape
GEOM::GEOM_Object_var aMainSh = aShape;
aMainSh = aMainSh->GetMainShape();
}
entry = aMainSh->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anObj = _impl->GetObject( aMainSh->GetStudyID(), entry );
+ HANDLE_NAMESPACE(GEOM_BaseObject) anObj = _impl->GetObject( entry );
TDF_Label aMainLbl = anObj->GetFunction(1)->GetNamingEntry();
// check all named shapes using iterator
// END: try to find existed name for current shape
if ( mytype == GEOM_GROUP ) {
- GEOM::GEOM_IGroupOperations_var anOp = GetIGroupOperations( theStudy->StudyId() );
+ GEOM::GEOM_IGroupOperations_var anOp = GetIGroupOperations();
switch ( (TopAbs_ShapeEnum)anOp->GetType( aShape )) {
case TopAbs_VERTEX:
aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_GROUP_PNT" );
SALOMEDS::SObject_var obj;
do {
anObjectName = aNamePrefix + TCollection_AsciiString(++i);
- obj = theStudy->FindObject( anObjectName.ToCString() );
+ obj = aStudy->FindObject( anObjectName.ToCString() );
}
while ( !obj->_is_nil() );
}
//Set NoteBook variables used in the object creation
TCollection_AsciiString aVars;
CORBA::String_var aString=aBaseObj->GetParameters();
- SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aString);
+ SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aString);
for(int i = 0, n = aSections->length(); i < n; i++) {
SALOMEDS::ListOfStrings aListOfVars = aSections[i];
for(int j = 0, m = aListOfVars.length(); j < m; j++) {
- if(theStudy->IsVariable(aListOfVars[j].in()))
+ if(aStudy->IsVariable(aListOfVars[j].in()))
aVars += aListOfVars[j].in();
if(j != m-1)
aVars += ":";
// function : CreateAndPublishGroup
// purpose : auxilary for PublishNamedShapesInStudy
//============================================================================
-void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_var theMainShape,
+void GEOM_Gen_i::CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape,
const TopTools_IndexedMapOfShape& anIndices,
const TopTools_SequenceOfShape& SeqS,
const TColStd_SequenceOfAsciiString& SeqN,
GEOM::ListOfGO_var aResList)
{
CORBA::String_var entry = theMainShape->GetEntry();
- //HANDLE_NAMESPACE(GEOM_Object) aMainShape = _impl->GetObject(theMainShape->GetStudyID(), entry);
+ //HANDLE_NAMESPACE(GEOM_Object) aMainShape = _impl->GetObject(entry);
Handle(TColStd_HArray1OfInteger) anArray;
if(SeqS.Length()>0) {
// create a group
- GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations(theStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations();
GEOM::GEOM_Object_wrap GrObj = GOp->CreateGroup( theMainShape, SeqS(1).ShapeType() );
- AddInStudy(theStudy, GrObj, GrName, theMainShape._retn());
+ AddInStudy(GrObj, GrName, theMainShape._retn());
//CORBA::String_var GrEntry = GrObj->GetEntry();
- //HANDLE_NAMESPACE(GEOM_Object) HGrObj = _impl->GetObject(GrObj->GetStudyID(), GrEntry);
+ //HANDLE_NAMESPACE(GEOM_Object) HGrObj = _impl->GetObject(GrEntry);
// add named objects
//HANDLE_NAMESPACE(GEOM_Object) anObj;
for(int i=1; i<=SeqS.Length(); i++) {
Standard_Integer anIndex = anIndices.FindIndex(aValue);
//anArray->SetValue(1, anIndex);
GOp->AddObject(GrObj,anIndex);
- //anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE);
+ //anObj = GEOM_Engine::GetEngine()->AddObject(GEOM_SUBSHAPE);
//if (anObj.IsNull()) continue;
//HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
//if (aFunction.IsNull()) continue;
//SALOMEDS::SObject_var aResultSO;
//TCollection_AsciiString anEntry;
//TDF_Tool::Entry(anObj->GetEntry(),anEntry);
- //GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString());
- //AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
+ //GEOM::GEOM_Object_var aGObj = GetObject(anEntry.ToCString());
+ //AddInStudy(aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
}
}
}
// purpose :
//============================================================================
GEOM::ListOfGO* GEOM_Gen_i::
- PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
- //SALOMEDS::SObject_ptr theSObject,
+ PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject)
{
//Unexpect aCatch(SALOME_SalomeException);
CORBA::String_var entry = theMainShape->GetEntry();
HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast
- ( _impl->GetObject( theMainShape->GetStudyID(), entry ));
+ ( _impl->GetObject( entry ));
if (aMainShape.IsNull()) return aResList._retn();
TopoDS_Shape MainSh = aMainShape->GetValue();
TopTools_IndexedMapOfShape anIndices;
TopExp::MapShapes(MainSh, anIndices);
- CreateAndPublishGroup(theStudy, theMainShape, anIndices, SolidSeqS, SolidSeqN,
+ CreateAndPublishGroup(theMainShape, anIndices, SolidSeqS, SolidSeqN,
"Group_Of_Named_Solids", aResList);
- CreateAndPublishGroup(theStudy, theMainShape, anIndices, FaceSeqS, FaceSeqN,
+ CreateAndPublishGroup(theMainShape, anIndices, FaceSeqS, FaceSeqN,
"Group_Of_Named_Faces", aResList);
- CreateAndPublishGroup(theStudy, theMainShape, anIndices, EdgeSeqS, EdgeSeqN,
+ CreateAndPublishGroup(theMainShape, anIndices, EdgeSeqS, EdgeSeqN,
"Group_Of_Named_Edges", aResList);
- CreateAndPublishGroup(theStudy, theMainShape, anIndices, VertSeqS, VertSeqN,
+ CreateAndPublishGroup(theMainShape, anIndices, VertSeqS, VertSeqN,
"Group_Of_Named_Vertices", aResList);
return aResList._retn();
}
// Create a list to store names of created files
- SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
- aSeq->length(1);
+ SALOMEDS_Tool::ListOfFiles aSeq;
+ aSeq.reserve(1);
// Prepare a file name to open
TCollection_AsciiString aNameWithExt("");
if (isMultiFile)
aNameWithExt = TCollection_AsciiString((char*)(SALOMEDS_Tool::GetNameFromPath
- (theComponent->GetStudy()->URL())).c_str());
+ (getStudyServant()->URL())).c_str());
#if OCC_VERSION_MAJOR > 6
aNameWithExt += TCollection_AsciiString("_GEOM.cbf");
#else
aNameWithExt += TCollection_AsciiString("_GEOM.sgd");
#endif
- aSeq[0] = CORBA::string_dup(aNameWithExt.ToCString());
+ aSeq.push_back(CORBA::string_dup(aNameWithExt.ToCString()));
// Build a full file name of temporary file
TCollection_AsciiString aFullName = TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt;
// Save GEOM component in this file
- _impl->Save(theComponent->GetStudy()->StudyId(),(char*) aFullName.ToCString());
+ _impl->Save((char*) aFullName.ToCString());
// Conver a file to the byte stream
- aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), isMultiFile);
+ aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq, isMultiFile);
// Remove the created file and tmp directory
- if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+ if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true);
// Return the created byte stream
return aStreamFile._retn();
}
// Conver the byte stream theStream to a file and place it in tmp directory
- SALOMEDS::ListOfFileNames_var aSeq =
+ SALOMEDS_Tool::ListOfFiles aSeq =
SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), isMultiFile);
// Prepare a file name to open
TCollection_AsciiString aNameWithExt("");
- SALOMEDS::Study_var study = theComponent->GetStudy();
+ SALOMEDS::Study_var study = getStudyServant();
#if OCC_VERSION_MAJOR > 6
// Get the file name.
int i;
- int aLength = aSeq->length();
+ int aLength = aSeq.size();
const char *aGeomSgd = "_GEOM.sgd";
const char *aGeomcbf = "_GEOM.cbf";
TCollection_AsciiString aFullName = (TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt);
// Open document
- if (!_impl->Load(study->StudyId(),(char*) aFullName.ToCString())) return false;
+ if (!_impl->Load((char*) aFullName.ToCString())) return false;
// Remove the created file and tmp directory
- if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+ if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true);
// creation of tree nodes for all data objects in the study
// to support tree representation customization and drag-n-drop:
//============================================================================
void GEOM_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent)
{
- SALOMEDS::Study_var aStudy= theComponent->GetStudy();
- _impl->Close(aStudy->StudyId());
+ _impl->Close();
}
//============================================================================
CORBA::Long theObjectID,
SALOMEDS::SObject_ptr theObject) {
// Find the current Study and StudyBuilder
- SALOMEDS::Study_var aStudy = theObject->GetStudy();
+ SALOMEDS::Study_var aStudy = getStudyServant();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
SALOMEDS::UseCaseBuilder_var anUseCaseBuilder = aStudy->GetUseCaseBuilder();
SALOMEDS::SObject_var aNewSO;
//Create a new GEOM_Object
- HANDLE_NAMESPACE(GEOM_Object) anObj = _impl->AddObject(aNewSO->GetStudy()->StudyId(), theObjectID);
+ HANDLE_NAMESPACE(GEOM_Object) anObj = _impl->AddObject(theObjectID);
HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF);
aFunction->SetValue(aTopology);
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObj->GetEntry(), anEntry);
- GEOM::GEOM_BaseObject_var obj = GetObject(anObj->GetDocID(), anEntry.ToCString());
+ GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString());
//Set the study entry of the published GEOM_Object
obj->SetStudyEntry(aNewSO->GetID());
// function : AddInStudy
// purpose :
//============================================================================
-SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_BaseObject_ptr theObject,
+SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (GEOM::GEOM_BaseObject_ptr theObject,
const char* theName,
GEOM::GEOM_BaseObject_ptr theFather)
{
SALOMEDS::SObject_var aResultSO;
- if(theObject->_is_nil() || theStudy->_is_nil()) return aResultSO;
+ SALOMEDS::Study_var aStudy = getStudyServant();
+ if(theObject->_is_nil() || aStudy->_is_nil()) return aResultSO;
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
CORBA::String_var IOR;
if(!theFather->_is_nil()) {
IOR = _orb->object_to_string(theFather);
- SALOMEDS::SObject_wrap aFatherSO = theStudy->FindObjectIOR(IOR.in());
+ SALOMEDS::SObject_wrap aFatherSO = aStudy->FindObjectIOR(IOR.in());
if(aFatherSO->_is_nil()) return aResultSO._retn();
aResultSO = aStudyBuilder->NewObject(aFatherSO);
//aStudyBuilder->Addreference(aResultSO, aResultSO);
}
- aResultSO = PublishInStudy(theStudy, aResultSO, theObject, theName);
+ aResultSO = PublishInStudy(aResultSO, theObject, theName);
if(aResultSO->_is_nil()) return aResultSO._retn();
GEOM::ListOfGBO_var aList = theObject->GetDependency();
GEOM::GEOM_BaseObject_var anObject = aList[i];
if(anObject->_is_nil()) continue;
IOR = _orb->object_to_string(anObject);
- SALOMEDS::SObject_wrap aSO = theStudy->FindObjectIOR(IOR.in());
+ SALOMEDS::SObject_wrap aSO = aStudy->FindObjectIOR(IOR.in());
if(aSO->_is_nil()) continue;
CORBA::String_var anID = aSO->GetID();
if ( aPrevID == anID.in() ) continue;
aPrevID = anID.in();
SALOMEDS::SObject_wrap aSubSO = aStudyBuilder->NewObject(aResultSO);
aStudyBuilder->Addreference(aSubSO, aSO);
- theStudy->GetUseCaseBuilder()->AppendTo( aResultSO, aSubSO );
+ aStudy->GetUseCaseBuilder()->AppendTo( aResultSO, aSubSO );
}
return aResultSO._retn();
// purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments.
// To be used from python scripts out of geompy.addToStudy (non-default usage)
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject))
+ SALOMEDS::Study_var aStudy = getStudyServant();
+ if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject))
return aParts._retn();
// find SObject in the study if it is already published
CORBA::String_var anIORo = _orb->object_to_string(theObject);
- SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in());
+ SALOMEDS::SObject_var aSO = aStudy->FindObjectIOR(anIORo.in());
//PTv, IMP 0020001, The salome object <aSO>
// is not obligatory in case of invokation from script
// if (CORBA::is_nil(aSO))
// return aParts._retn();
- aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs,
+ aParts = RestoreSubShapes(theObject, aSO, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix);
if (!CORBA::is_nil(aSO)) aSO->UnRegister();
return aParts._retn();
// purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments.
// To be used from python scripts, generated by Dump Python.
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject))
+ if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theObject))
return aParts._retn();
// find SObject in the study if it is already published
CORBA::String_var anIORo = _orb->object_to_string(theObject);
- SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in());
+ SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectIOR(anIORo.in());
//PTv, IMP 0020001, The salome object <aSO>
// is not obligatory in case of invokation from script
// if (CORBA::is_nil(aSO))
// return aParts._retn();
- aParts = RestoreGivenSubShapes(theStudy, theObject, aSO, theArgs,
+ aParts = RestoreGivenSubShapes(theObject, aSO, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix);
if (!CORBA::is_nil(aSO)) aSO->UnRegister();
return aParts._retn();
// purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments.
// To be used from GUI and from geompy.addToStudy
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theSObject))
+ if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theSObject))
return aParts._retn();
SALOMEDS::GenericAttribute_var anAttr;
if (CORBA::is_nil(anO))
return aParts._retn();
- aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs,
+ aParts = RestoreSubShapes(anO, theSObject, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix);
return aParts._retn();
}
// purpose : Private method. Works only if both theObject and theSObject
// are defined, and does not check, if they correspond to each other.
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
+ SALOMEDS::Study_var aStudy = getStudyServant();
//PTv, IMP 0020001, The salome object <theSObject>
// is not obligatory in case of invokation from script
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
+ if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
return aParts._retn();
// For Dump Python (mantis issue 0020768)
// but only reconstruct its published sub-shapes
CORBA::String_var anIOR = _orb->object_to_string(aList[0]);
- SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
+ SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in());
// remember restored objects for Python Dump
addToListOfGO(aList[0], anOutArgs);
- aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject,
+ aParts = RestoreSubShapesOneLevel(anArgSO, theSObject, theObject,
anOutArgs, theFindMethod, theAddPrefix);
// set the color of the transformed shape to the color of initial shape
if (aList[0]->GetMarkerType() == GEOM::MT_USER)
theObject->SetMarkerTexture(aList[0]->GetMarkerTexture());
}
-
- anArgSO->UnRegister();
+ if (!CORBA::is_nil(anArgSO))
+ anArgSO->UnRegister();
}
else {
// Get interface, containing method, which we will use to reconstruct sub-shapes
- GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
- GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
- GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations();
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations();
PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in());
GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast<GEOM_ITransformOperations_i*>(aServant);
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
for (Standard_Integer i = 0; i < aLength; i++)
{
GEOM::GEOM_Object_var anArgO = aList[i];
if (!CORBA::is_nil(anArgO)) {
anIOR = _orb->object_to_string(anArgO);
- SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
+ SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in());
TCollection_AsciiString anArgName;
if (CORBA::is_nil(anArgSO)) {
anArgName = "arg_";
GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject);
if (!CORBA::is_nil(anArgOTrsf)) {
CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry);
HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
anArgOTrsfFun->SetDescription("");
aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf);
HANDLE_NAMESPACE(GEOM_Function) anOFun = theObject->GetLastFunction();
if (!anOFun.IsNull()) {
CORBA::String_var entryArg = anArgO->GetEntry();
- HANDLE_NAMESPACE(GEOM_Object) anArgOImpl = _impl->GetObject(anArgO->GetStudyID(), entryArg);
+ HANDLE_NAMESPACE(GEOM_Object) anArgOImpl = _impl->GetObject(entryArg);
if (!anArgOImpl.IsNull()) {
TopoDS_Shape anArgOShape = anArgOImpl->GetValue();
TopoDS_Shape aMultiArgShape;
}
aSubName += anArgName;
aSubSO = aStudyBuilder->NewObject(theSObject);
- aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
+ aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString());
// Restore color
aSubO->SetColor(anArgO->GetColor());
// set the texture
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass theObject, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubParts = RestoreSubShapesOneLevel(anArgSO, aSubSO,
theObject, anOutArgs, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubParts = RestoreSubShapesOneLevel(anArgSO, aSubSO,
aSubO, anOutArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ RestoreSubShapesOneLevel(anArgSO, aSubSO,
theObject, anOutArgs, theFindMethod, theAddPrefix);
// add to parts list
aSubName = "from_parts_of_";
}
aSubName += anArgName;
- aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
+ aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString());
// Restore color
aSubO->SetColor(anArgO->GetColor());
// set the texture
}
}
} // try to build from published parts
- anArgSO->UnRegister();
+ if (!CORBA::is_nil(anArgSO))
+ anArgSO->UnRegister();
}
} // process arguments
}
aResParts->length(nb);
if (nb > 0)
{
- HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+ HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry());
HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction();
GEOM::TPythonDump pd (aFunction, true);
pd <<"[";
anObjEntryMap.insert(anEntry);
aResParts[nbRes++] = anObj;
// clear python dump of object
- HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry);
HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction();
if ( !anObjFun.IsNull() )
anObjFun->SetDescription( "" );
GEOM::GEOM_Object_var anObj = anOutArgs[ i ];
if (CORBA::is_nil(anObj))
continue;
- HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry());
+ HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry());
if ( j > 0 )
pd << ", ";
pd << aGeomObj;
// function : RestoreSubShapesOneLevel
// purpose : Private method
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theOldSO,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
GEOM::ListOfGO& theOutArgs,
CORBA::Boolean theAddPrefix)
{
int i = 0;
+ SALOMEDS::Study_var aStudy = getStudyServant();
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO;
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theOldSO) ||
+ if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) ||
CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/)
return aParts._retn();
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
// Get interface, containing method, which we will use to reconstruct sub-shapes
- GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
- GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
- GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations();
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations();
PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in());
GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast<GEOM_ITransformOperations_i*>(aServant);
// Reconstruct published sub-shapes
- SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
+ SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theOldSO);
int aLen = 0;
for (it->Init(); it->More(); it->Next()) {
GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO);
if (!CORBA::is_nil(anArgOTrsf)) {
CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry);
HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
anArgOTrsfFun->SetDescription("");
aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf);
}
aSubName += anArgName;
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
- aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
+ aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass the main shape as Object, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aSubParts = RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO,
theNewO, theOutArgs, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aSubParts = RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO,
aNewSubO, theOutArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ RestoreSubShapesOneLevel(anOldSubSO, aNewSubSO,
theNewO, theOutArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
aSubName = "from_parts_of_";
}
aSubName += anArgName;
- aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
+ aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
// List theArgs in this case contains not only operation arguments,
// but also all subshapes, which must be published.
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
+ SALOMEDS::Study_var aStudy = getStudyServant();
//PTv, IMP 0020001, The salome object <theSObject>
// is not obligatory in case of invokation from script
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
+ if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
return aParts._retn();
// If theArgs list is empty, nothing to do
// but only reconstruct its published sub-shapes
CORBA::String_var anIOR = _orb->object_to_string(aList[0]);
- SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
+ SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in());
- aParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject,
+ aParts = RestoreGivenSubShapesOneLevel(anArgSO, theSObject, theObject,
anArgs, theFindMethod, theAddPrefix);
// set the color of the transformed shape to the color of initial shape
}
else {
// Get interface, containing method, which we will use to reconstruct sub-shapes
- GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
- GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
- GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations();
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations();
PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in());
GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast<GEOM_ITransformOperations_i*>(aServant);
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
for (Standard_Integer i = 0; i < nbArgsActual; i++)
{
GEOM::GEOM_Object_var anArgO = aList[i];
if (!CORBA::is_nil(anArgO)) {
anIOR = _orb->object_to_string(anArgO);
- SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
+ SALOMEDS::SObject_var anArgSO = aStudy->FindObjectIOR(anIOR.in());
TCollection_AsciiString anArgName;
if (CORBA::is_nil(anArgSO)) {
anArgName = "arg_";
GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject);
if (!CORBA::is_nil(anArgOTrsf)) {
CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry);
HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
anArgOTrsfFun->SetDescription("");
aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf);
}
aSubName += anArgName;
aSubSO = aStudyBuilder->NewObject(theSObject);
- aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
+ aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString());
// Restore color
aSubO->SetColor(anArgO->GetColor());
// set the texture
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass theObject, because only it has the history
- aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubParts = RestoreGivenSubShapesOneLevel(anArgSO, aSubSO,
theObject, anArgs, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubParts = RestoreGivenSubShapesOneLevel(anArgSO, aSubSO,
aSubO, anArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ RestoreGivenSubShapesOneLevel(anArgSO, aSubSO,
theObject, anArgs, theFindMethod, theAddPrefix);
// add to parts list
aSubName = "from_parts_of_";
}
aSubName += anArgName;
- aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
+ aSubSO = PublishInStudy(aSubSO, aSubO, aSubName.ToCString());
// Restore color
aSubO->SetColor(anArgO->GetColor());
// set the texture
aResParts->length(nb);
if (nb > 0)
{
- HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+ HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry());
HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction();
GEOM::TPythonDump pd (aFunction, true);
pd <<"[";
anObjEntryMap.insert(anEntry);
aResParts[nbRes++] = anObj;
// clear python dump of object
- HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry);
HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction();
if ( !anObjFun.IsNull() )
anObjFun->SetDescription( "" );
GEOM::GEOM_Object_var anObj = theArgs[ i ];
if (CORBA::is_nil(anObj))
continue;
- HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry());
+ HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry());
if ( j > 0 )
pd << ", ";
pd << aGeomObj;
// function : RestoreGivenSubShapesOneLevel
// purpose : Private method
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theOldSO,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
std::set<std::string> theArgs,
CORBA::Boolean theAddPrefix)
{
int i = 0;
+ SALOMEDS::Study_var aStudy = getStudyServant();
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO;
- if (CORBA::is_nil(theStudy) || CORBA::is_nil(theOldSO) ||
+ if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) ||
CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/)
return aParts._retn();
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
// Get interface, containing method, which we will use to reconstruct sub-shapes
- GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
- GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
- GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations();
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations();
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations();
PortableServer::Servant aServant = _poa->reference_to_servant(aTrsfOp.in());
GEOM_ITransformOperations_i* aTrsfOpSv = dynamic_cast<GEOM_ITransformOperations_i*>(aServant);
// Reconstruct published sub-shapes
- SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
+ SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(theOldSO);
int aLen = 0;
for (it->Init(); it->More(); it->Next()) {
GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO);
if (!CORBA::is_nil(anArgOTrsf)) {
CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry);
HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
anArgOTrsfFun->SetDescription("");
aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf);
}
aSubName += anArgName;
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
- aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
+ aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass the main shape as Object, because only it has the history
- aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aSubParts = RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO,
theNewO, theArgs, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aSubParts = RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO,
aNewSubO, theArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ RestoreGivenSubShapesOneLevel(anOldSubSO, aNewSubSO,
theNewO, theArgs, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
aSubName = "from_parts_of_";
}
aSubName += anArgName;
- aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
+ aNewSubSO = PublishInStudy(aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
aNewSubO->SetColor(anOldSubO->GetColor());
// set the texture
name_service->Register(g, name);
}
+//============================================================================
+// function : getStudyServant()
+// purpose : Get Study
+//============================================================================
+SALOMEDS::Study_var GEOM_Gen_i::getStudyServant()
+{
+ static SALOMEDS::Study_var aStudy;
+ if(CORBA::is_nil(aStudy)){
+ CORBA::Object_ptr anObject = name_service->Resolve("/Study");
+ aStudy = SALOMEDS::Study::_narrow(anObject);
+ }
+ return aStudy;
+}
+
//============================================================================
// function : Undo
// purpose :
//============================================================================
-void GEOM_Gen_i::Undo(CORBA::Long theStudyID)
+void GEOM_Gen_i::Undo()
{
- _impl->Undo(theStudyID);
+ _impl->Undo();
}
//============================================================================
// function : Redo
// purpose :
//============================================================================
-void GEOM_Gen_i::Redo(CORBA::Long theStudyID)
+void GEOM_Gen_i::Redo()
{
- _impl->Redo(theStudyID);
+ _impl->Redo();
}
//============================================================================
// function : GetIBasicOperations
// purpose :
//============================================================================
-GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IBasicOperations_ptr GEOM_Gen_i::GetIBasicOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
//transfer reference on engine
GEOM_IBasicOperations_i* aServant =
- new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID));
+ new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations());
PortableServer::ObjectId_var id = _poa->activate_object(aServant);
// activate the CORBA servant
// function : GetITransformOperations
// purpose :
//============================================================================
-GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations(CORBA::Long theStudyID)
+GEOM::GEOM_ITransformOperations_ptr GEOM_Gen_i::GetITransformOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_ITransformOperations_i* aServant =
- new GEOM_ITransformOperations_i(_poa, engine, _impl->GetITransformOperations(theStudyID));
+ new GEOM_ITransformOperations_i(_poa, engine, _impl->GetITransformOperations());
// activate the CORBA servant
GEOM::GEOM_ITransformOperations_var operations = aServant->_this();
// function : GetI3DPrimOperations
// purpose :
//============================================================================
-GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations(CORBA::Long theStudyID)
+GEOM::GEOM_I3DPrimOperations_ptr GEOM_Gen_i::GetI3DPrimOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_I3DPrimOperations_i* aServant =
- new GEOM_I3DPrimOperations_i(_poa, engine, _impl->GetI3DPrimOperations(theStudyID));
+ new GEOM_I3DPrimOperations_i(_poa, engine, _impl->GetI3DPrimOperations());
PortableServer::ObjectId_var id = _poa->activate_object(aServant);
// activate the CORBA servant
// function : GetIShapesOperations
// purpose :
//============================================================================
-GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IShapesOperations_ptr GEOM_Gen_i::GetIShapesOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IShapesOperations_i* aServant =
- new GEOM_IShapesOperations_i(_poa, engine, _impl->GetIShapesOperations(theStudyID));
+ new GEOM_IShapesOperations_i(_poa, engine, _impl->GetIShapesOperations());
// activate the CORBA servant
GEOM::GEOM_IShapesOperations_var operations = aServant->_this();
// function : GetIBlocksOperations
// purpose :
//============================================================================
-GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IBlocksOperations_ptr GEOM_Gen_i::GetIBlocksOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IBlocksOperations_i* aServant =
- new GEOM_IBlocksOperations_i(_poa, engine, _impl->GetIBlocksOperations(theStudyID));
+ new GEOM_IBlocksOperations_i(_poa, engine, _impl->GetIBlocksOperations());
// activate the CORBA servant
GEOM::GEOM_IBlocksOperations_var operations = aServant->_this();
// function : GetIBooleanOperations
// purpose :
//============================================================================
-GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IBooleanOperations_ptr GEOM_Gen_i::GetIBooleanOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IBooleanOperations_i* aServant =
- new GEOM_IBooleanOperations_i(_poa, engine, _impl->GetIBooleanOperations(theStudyID));
+ new GEOM_IBooleanOperations_i(_poa, engine, _impl->GetIBooleanOperations());
// activate the CORBA servant
GEOM::GEOM_IBooleanOperations_var operations = aServant->_this();
// function : GetICurvesOperations
// purpose :
//============================================================================
-GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations(CORBA::Long theStudyID)
+GEOM::GEOM_ICurvesOperations_ptr GEOM_Gen_i::GetICurvesOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_ICurvesOperations_i* aServant =
- new GEOM_ICurvesOperations_i(_poa, engine, _impl->GetICurvesOperations(theStudyID));
+ new GEOM_ICurvesOperations_i(_poa, engine, _impl->GetICurvesOperations());
// activate the CORBA servant
GEOM::GEOM_ICurvesOperations_var operations = aServant->_this();
// function : GetILocalOperations
// purpose :
//============================================================================
-GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations(CORBA::Long theStudyID)
+GEOM::GEOM_ILocalOperations_ptr GEOM_Gen_i::GetILocalOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_ILocalOperations_i* aServant =
- new GEOM_ILocalOperations_i(_poa, engine, _impl->GetILocalOperations(theStudyID));
+ new GEOM_ILocalOperations_i(_poa, engine, _impl->GetILocalOperations());
// activate the CORBA servant
GEOM::GEOM_ILocalOperations_var operations = aServant->_this();
// function : GetIHealingOperations
// purpose :
//============================================================================
-GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IHealingOperations_ptr GEOM_Gen_i::GetIHealingOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IHealingOperations_i* aServant =
- new GEOM_IHealingOperations_i(_poa, engine, _impl->GetIHealingOperations(theStudyID));
+ new GEOM_IHealingOperations_i(_poa, engine, _impl->GetIHealingOperations());
// activate the CORBA servant
GEOM::GEOM_IHealingOperations_var operations = aServant->_this();
// function : GetIInsertOperations
// purpose :
//============================================================================
-GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IInsertOperations_ptr GEOM_Gen_i::GetIInsertOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IInsertOperations_i* aServant =
- new GEOM_IInsertOperations_i(_poa, engine, _impl->GetIInsertOperations(theStudyID));
+ new GEOM_IInsertOperations_i(_poa, engine, _impl->GetIInsertOperations());
// activate the CORBA servant
GEOM::GEOM_IInsertOperations_var operations = aServant->_this();
// function : GetIMeasureOperations
// purpose :
//============================================================================
-GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IMeasureOperations_ptr GEOM_Gen_i::GetIMeasureOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IMeasureOperations_i* aServant =
- new GEOM_IMeasureOperations_i(_poa, engine, _impl->GetIMeasureOperations(theStudyID));
+ new GEOM_IMeasureOperations_i(_poa, engine, _impl->GetIMeasureOperations());
// activate the CORBA servant
GEOM::GEOM_IMeasureOperations_var operations = aServant->_this();
// function : GetIGroupOperations
// purpose :
//============================================================================
-GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IGroupOperations_ptr GEOM_Gen_i::GetIGroupOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IGroupOperations_i* aServant =
- new GEOM_IGroupOperations_i(_poa, engine, _impl->GetIGroupOperations(theStudyID));
+ new GEOM_IGroupOperations_i(_poa, engine, _impl->GetIGroupOperations());
// activate the CORBA servant
GEOM::GEOM_IGroupOperations_var operations = aServant->_this();
// function : GetIFieldOperations
// purpose :
//============================================================================
-GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations(CORBA::Long theStudyID)
+GEOM::GEOM_IFieldOperations_ptr GEOM_Gen_i::GetIFieldOperations()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen_ptr engine = _this();
GEOM_IFieldOperations_i* aServant =
- new GEOM_IFieldOperations_i(_poa, engine, _impl->GetIFieldOperations(theStudyID));
+ new GEOM_IFieldOperations_i(_poa, engine, _impl->GetIFieldOperations());
// activate the CORBA servant
GEOM::GEOM_IFieldOperations_var operations = aServant->_this();
// function : GetPluginOperations
// purpose :
//============================================================================
-GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyID,
- const char* theLibName)
+GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(const char* theLibName)
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
// create a new operations object, store its ref. in engine
if ( myOpCreatorMap.find(aLibName) != myOpCreatorMap.end() ) {
GEOM_IOperations_i* aServant = 0;
- aServant = myOpCreatorMap[aLibName]->Create(_poa, theStudyID, engine, _impl);
+ aServant = myOpCreatorMap[aLibName]->Create(_poa, engine, _impl);
// activate the CORBA servant
if (aServant)
operations = aServant->_this();
return GEOM::GEOM_Object::_nil();
CORBA::String_var entry = theMainShape->GetEntry();
HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast
- ( _impl->GetObject( theMainShape->GetStudyID(), entry ));
+ ( _impl->GetObject( entry ));
if (aMainShape.IsNull()) return GEOM::GEOM_Object::_nil();
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theIndices.length());
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObject->GetEntry(), anEntry);
- return GEOM::GEOM_Object::_narrow( GetObject(anObject->GetDocID(), anEntry.ToCString()));
+ return GEOM::GEOM_Object::_narrow( GetObject(anEntry.ToCString()));
}
//=============================================================================
void GEOM_Gen_i::RemoveObject(GEOM::GEOM_BaseObject_ptr theObject)
{
CORBA::String_var anEntry = theObject->GetEntry();
- HANDLE_NAMESPACE(GEOM_BaseObject) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry, false);
+ HANDLE_NAMESPACE(GEOM_BaseObject) anObject = _impl->GetObject(anEntry, false);
if (!anObject.IsNull())
_impl->RemoveObject(anObject);
}
// function : GetObject()
// purpose :
//=================================================================================
-GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (CORBA::Long theStudyID, const char* theEntry)
+GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (const char* theEntry)
{
GEOM::GEOM_BaseObject_var obj;
- HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject(theStudyID, (char*)theEntry);
+ HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((char*)theEntry);
if (handle_object.IsNull()) return obj._retn();
TCollection_AsciiString stringIOR = handle_object->GetIOR();
// function : getObjectInfo()
// purpose : returns an information for a given object by its entry
//=================================================================================
-char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry)
+char* GEOM_Gen_i::getObjectInfo(const char* entry)
{
GEOM::GEOM_Object_var aGeomObject;
- CORBA::Object_var aSMObject = name_service->Resolve( "/myStudyManager" );
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
- SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
- SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( entry );
+ SALOMEDS::SObject_var aSObj = getStudyServant()->FindObjectID( entry );
SALOMEDS::SObject_var aResultSObj;
if (aSObj->ReferencedObject(aResultSObj))
aSObj = aResultSObj;
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aVal = anIOR->Value();
anIOR->UnRegister();
- CORBA::Object_var anObject = aStudy->ConvertIORToObject(aVal);
+ CORBA::Object_var anObject = getStudyServant()->ConvertIORToObject(aVal);
aGeomObject = GEOM::GEOM_Object::_narrow(anObject);
}
if (!aSObj->_is_nil() )
GEOM::ListOfLong_var anInts;
GEOM::ListOfDouble_var aDbls;
- GEOM::GEOM_IMeasureOperations_var anOp = GetIMeasureOperations( studyId );
+ GEOM::GEOM_IMeasureOperations_var anOp = GetIMeasureOperations();
aKind = anOp->KindOfShape( aGeomObject, anInts, aDbls );
if ( anOp->IsDone() ) {
aLocalID->UnRegister();
}
- SALOMEDS::Study_var aStudy = theFather->GetStudy();
+ SALOMEDS::Study_var aStudy = getStudyServant();
SALOMEDS::StudyBuilder_var aStudyBuilder( aStudy->NewBuilder() );
aFolderSO = aStudyBuilder->NewObject( theFather );
SALOMEDS::SObject_ptr theFolder) {
GEOM::object_list_var objects = new GEOM::object_list();
objects->length( 1 );
- SALOMEDS::SObject_var aSO = theFolder->GetStudy()->FindObjectID( theObject->GetStudyEntry() );
+ SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectID( theObject->GetStudyEntry() );
objects[0] = aSO;
Move( objects, theFolder, -1 );
}
SALOMEDS::SObject_var aSO;
for (int i = 0; i < aLen; i++) {
aGO = GEOM::GEOM_Object::_duplicate( theListOfGO[i] );
- aSO = theFolder->GetStudy()->FindObjectID( aGO->GetStudyEntry() );
+ aSO = getStudyServant()->FindObjectID( aGO->GetStudyEntry() );
objects[i] = aSO;
}
if ( objects->length() > 0 )
{
if ( CORBA::is_nil( where ) ) return;
- SALOMEDS::Study_var study = where->GetStudy();
+ SALOMEDS::Study_var study = getStudyServant();
SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
SALOMEDS::SComponent_var father = where->GetFatherComponent();
// function : GetDependencyTree
// purpose : Collects dependencies of the given objects from other ones
//=======================================================================
-SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
- const GEOM::string_array& theObjectEntries ) {
+SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( const GEOM::string_array& theObjectEntries )
+{
// fill in the tree structure
GEOMUtils::TreeModel tree;
for ( int i = 0; i < theObjectEntries.length(); i++ ) {
// process objects one-by-one
entry = theObjectEntries[i].in();
- GEOM::GEOM_BaseObject_var anObj = GetObject( theStudy->StudyId(), entry.c_str() );
+ GEOM::GEOM_BaseObject_var anObj = GetObject(entry.c_str() );
if ( anObj->_is_nil() )
continue;
std::map< std::string, std::set<std::string> > passedEntries;
std::map< std::string, std::set<std::string> > &passedEntries,
int level ) {
std::string aGboEntry = gbo->GetEntry();
- Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(gbo->GetStudyID());
+ Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument();
Handle(TDataStd_TreeNode) aNode, aRoot;
HANDLE_NAMESPACE(GEOM_Function) aFunction;
if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
if(aLabel.IsNull()) continue;
TCollection_AsciiString anEntry;
TDF_Tool::Entry(aLabel, anEntry);
- GEOM::GEOM_BaseObject_var geomObj = GetObject( gbo->GetStudyID(), anEntry.ToCString() );
+ GEOM::GEOM_BaseObject_var geomObj = GetObject(anEntry.ToCString() );
if( CORBA::is_nil( geomObj ) )
continue;
// get dependencies for current object in the tree
// function : GetEntriesToReduceStudy
// purpose : Fills 3 lists that is used to clean study of redundant objects
//==============================================================================
-void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
- GEOM::string_array& theSelectedEntries,
- GEOM::string_array& theParentEntries,
- GEOM::string_array& theSubEntries,
- GEOM::string_array& theOtherEntries)
+void GEOM_Gen_i::GetEntriesToReduceStudy(GEOM::string_array& theSelectedEntries,
+ GEOM::string_array& theParentEntries,
+ GEOM::string_array& theSubEntries,
+ GEOM::string_array& theOtherEntries)
{
std::set<std::string> aSelected, aParents, aChildren, anOthers;
for ( int i = 0; i < theSelectedEntries.length(); i++ ) {
aSelected.insert( CORBA::string_dup( theSelectedEntries[i] ) );
}
- Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(theStudy->StudyId());
+ Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument();
Handle(TDataStd_TreeNode) aNode, aRoot;
HANDLE_NAMESPACE(GEOM_Function) aFunction;
if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
continue;
TDF_Tool::Entry(aLabel, anAsciiEntry);
anEntry = anAsciiEntry.ToCString();
- GEOM::GEOM_BaseObject_var geomObj = GetObject( theStudy->StudyId(), anEntry.c_str() );
+ GEOM::GEOM_BaseObject_var geomObj = GetObject(anEntry.c_str() );
if( CORBA::is_nil( geomObj ) )
continue;
// filling list of sub-objects
for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
- includeSubObjects( theStudy, *it, aSelected, aParents, aChildren, anOthers );
+ includeSubObjects( *it, aSelected, aParents, aChildren, anOthers );
}
// if some selected object is not a main shape,
// because they could not be modified anyhow.
std::set<std::string> aToBeInSelected;
for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
- HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), (*it).c_str(), false);
+ HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((*it).c_str(), false);
if ( handle_object.IsNull() )
continue;
// function : includeSubObjects
// purpose :
//==============================================================================
-void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
- const std::string& aSelectedEntry,
+void GEOM_Gen_i::includeSubObjects(const std::string& aSelectedEntry,
std::set<std::string>& aSelected,
std::set<std::string>& aParents,
std::set<std::string>& aChildren,
std::set<std::string>& anOthers)
{
std::set<std::string>::iterator foundIt;
- HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false);
+ HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject(aSelectedEntry.c_str(), false);
if ( handle_object.IsNull() )
return;
anOthers.erase( foundIt );
}
}
- includeSubObjects( theStudy, aSubEntryStr, aSelected, aParents, aChildren, anOthers );
+ includeSubObjects( aSubEntryStr, aSelected, aParents, aChildren, anOthers );
}
}
//=====================================================================================
public:
// Create operations
virtual GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl) = 0;
// return the name of IDL module
// Get Naming Service object
SALOME_NamingService* GetNS() { return name_service; }
+ // Get Study
+ SALOMEDS::Study_var getStudyServant();
+
//-----------------------------------------------------------------------//
// Inherited methods from SALOMEDS::Driver //
//-----------------------------------------------------------------------//
CORBA::Boolean isASCII);
bool CanPublishInStudy(CORBA::Object_ptr theIOR);
- 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) ;
- GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
- CORBA::Object_ptr theObject);
+ GEOM::ListOfGO* PublishNamedShapesInStudy(CORBA::Object_ptr theObject);
CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
/*! \brief Adds theObject in the study with a name = theName, if
* theFather is not null the object is placed under theFather
*/
- SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_BaseObject_ptr theObject,
+ SALOMEDS::SObject_ptr AddInStudy (GEOM::GEOM_BaseObject_ptr theObject,
const char* theName,
GEOM::GEOM_BaseObject_ptr theFather);
/*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments.
* To be used from python scripts out of geompy.addToStudy (non-default usage)
*/
- GEOM::ListOfGO* RestoreSubShapesO (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+ GEOM::ListOfGO* RestoreSubShapesO (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
/*! \brief Publish sub-shapes, standing for given in \a theArgs arguments and sub-shapes.
* To be used from python scripts, generated by Dump Python.
*/
- GEOM::ListOfGO* RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+ GEOM::ListOfGO* RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
/*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments.
* To be used from GUI and from geompy.addToStudy
*/
- GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+ GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix);
//Collects dependencies of the given objects from other ones
- SALOMEDS::TMPFile* GetDependencyTree(SALOMEDS::Study_ptr theStudy,
- const GEOM::string_array& theObjectEntries);
+ SALOMEDS::TMPFile* GetDependencyTree(const GEOM::string_array& theObjectEntries);
//-----------------------------------------------------------------------//
// Transaction methods //
//-----------------------------------------------------------------------//
- //Undos one transaction in the document associated with theStudyID
- virtual void Undo(CORBA::Long theStudyID);
+ //Undos one transaction in the document
+ virtual void Undo();
- //Redos one transaction in the document associated with theStudyID
- virtual void Redo(CORBA::Long theStudyID);
+ //Redos one transaction in the document
+ virtual void Redo();
//-----------------------------------------------------------------------//
// Operations methods //
//-----------------------------------------------------------------------//
//Returns a pointer to BasicOperations interface
- virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to TransformOperations interface
- virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to 3DPrimOperations interface
- virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to ShapesOperations interface
- virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to BlocksOperations interface
- virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to BooleanOperations interface
- virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to CurvesOperations interface
- virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to LocalOperations interface
- virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to HealingOperations interface
- virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to InsertOperations interface
- virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to MeasureOperations interface
- virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to GroupOperations interface
- virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to FiedlOperations interface
- virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations (CORBA::Long theStudyID)
+ virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations()
throw (SALOME::SALOME_Exception);
//Returns a pointer to corresponding plugin operations interface
- virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (CORBA::Long theStudyID,
- const char* theLibName)
+ virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (const char* theLibName)
throw (SALOME::SALOME_Exception);
//Adds a new sub-shape
virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
- virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
+ virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript);
// Object information
virtual bool hasObjectInfo();
- virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
+ virtual char* getObjectInfo(const char* entry);
// Version information
virtual char* getVersion();
/*! \brief Fills 3 lists that is used to clean study of redundant objects.
* To be used from GUI.
*/
- void GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
- GEOM::string_array& theSelectedEntries,
+ void GetEntriesToReduceStudy(GEOM::string_array& theSelectedEntries,
GEOM::string_array& theParentEntries,
GEOM::string_array& theSubEntries,
GEOM::string_array& theOtherEntries);
// Internal methods //
//-----------------------------------------------------------------------//
- virtual GEOM::GEOM_BaseObject_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
+ virtual GEOM::GEOM_BaseObject_ptr GetObject(const char* theEntry);
private:
- GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+ GEOM::ListOfGO* RestoreSubShapes (GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix);
- GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theOldSO,
+ GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
GEOM::ListOfGO& theOutArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theAddPrefix);
- GEOM::ListOfGO* RestoreGivenSubShapes (SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_ptr theObject,
+ GEOM::ListOfGO* RestoreGivenSubShapes (GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
CORBA::Boolean theInheritFirstArg,
CORBA::Boolean theAddPrefix);
- GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theOldSO,
+ GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
std::set<std::string> theArgs,
CORBA::Boolean theAddPrefix);
// auxilary for PublishNamedShapesInStudy
- void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy,
- GEOM::GEOM_Object_var theMainShape,
+ void CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape,
const TopTools_IndexedMapOfShape& anIndices,
const TopTools_SequenceOfShape& SeqS,
const TColStd_SequenceOfAsciiString& SeqN,
std::set<std::string>& aChildren,
std::set<std::string>& anOthers);
- void includeSubObjects(SALOMEDS::Study_ptr theStudy,
- const std::string& aSelectedEntry,
+ void includeSubObjects(const std::string& aSelectedEntry,
std::set<std::string>& aSelected,
std::set<std::string>& aParents,
std::set<std::string>& aChildren,
return CORBA::string_dup(_impl->GetErrorCode());
}
-//=============================================================================
-/*!
- * GetStudyID
- */
-//=============================================================================
-CORBA::Long GEOM_IOperations_i::GetStudyID()
-{
- return _impl->GetDocID();
-}
-
//=============================================================================
/*!
* StartOperation
if (theObject.IsNull()) return GO._retn();
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- GO = _engine->GetObject(theObject->GetDocID(), (char*) anEntry.ToCString());
+ GO = _engine->GetObject((char*) anEntry.ToCString());
return GO._retn();
}
HANDLE_NAMESPACE(GEOM_BaseObject) anImpl;
if (!CORBA::is_nil(theObject)) {
CORBA::String_var anEntry = theObject->GetEntry();
- anImpl = GetImpl()->GetEngine()->GetObject( theObject->GetStudyID(), anEntry );
+ anImpl = GetImpl()->GetEngine()->GetObject( anEntry );
}
return anImpl;
}
virtual char* GetErrorCode();
- virtual CORBA::Long GetStudyID();
-
virtual GEOM::GEOM_BaseObject_ptr GetBaseObject(HANDLE_NAMESPACE(GEOM_BaseObject) theObject);
virtual HANDLE_NAMESPACE(GEOM_BaseObject) GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject);
virtual GEOM::GEOM_Object_ptr GetObject(HANDLE_NAMESPACE(GEOM_Object) theObject);
{
TCollection_AsciiString anEntry = anIt.Value();
HANDLE_NAMESPACE(GEOM_BaseObject) anObj =
- GEOM_Engine::GetEngine()->GetObject( _impl->GetDocID(), anEntry.ToCString(), false );
+ GEOM_Engine::GetEngine()->GetObject( anEntry.ToCString(), false );
if ( anObj.IsNull() ) continue;
TCollection_AsciiString aSubName = anObj->GetName();
TCollection_AsciiString anEntry;
TDF_Tool::Entry(aLabel, anEntry);
return GEOM::GEOM_Object::_narrow
- ( _engine->GetObject(_impl->GetDocID(), anEntry.ToCString()) );
+ ( _engine->GetObject( anEntry.ToCString()) );
}
return obj._retn();
if ( !CORBA::is_nil( shapePtr ) ) {
CORBA::String_var entry = shapePtr->GetEntry();
HANDLE_NAMESPACE(GEOM_Object) otherObject = HANDLE_NAMESPACE(GEOM_Object)::DownCast
- ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), entry, false ));
+ ( GEOM_Engine::GetEngine()->GetObject( entry, false ));
if ( !otherObject.IsNull() ) {
TopoDS_Shape thisShape = _impl->GetValue();
TopoDS_Shape otherShape = otherObject->GetValue();
setGeomEngine();
- myStudyID = -1;
- myLastStudyID = -1;
-
myBasicOp = GEOM::GEOM_IBasicOperations::_nil();
my3DPrimOp = GEOM::GEOM_I3DPrimOperations::_nil();
myBoolOp = GEOM::GEOM_IBooleanOperations::_nil();
myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
}
-//=============================================================================
-// SetStudyID:
-//=============================================================================
-void GEOM_Superv_i::SetStudyID( CORBA::Long theId )
-{
- // mkr : PAL10770 -->
- myLastStudyID = myStudyID;
-
- CORBA::Object_ptr anObject = name_service->Resolve("/Kernel/Session");
- if ( !CORBA::is_nil(anObject) ) {
- SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
- if ( !CORBA::is_nil(aSession) ) {
- int aStudyID = aSession->GetActiveStudyId();
- if ( theId != aStudyID && aStudyID > 0) { // mkr : IPAL12128
- MESSAGE("Warning : given study ID theId="<<theId<<" is wrong and will be replaced by the value "<<aStudyID);
- myStudyID = aStudyID;
- }
- else
- myStudyID = theId; // mkr : IPAL12128
- }
- }
-
- if ( isNewStudy(myLastStudyID,myStudyID) ) {
- if (CORBA::is_nil(myGeomEngine)) setGeomEngine();
- std::string anEngine = _orb->object_to_string( myGeomEngine );
-
- CORBA::Object_var anObj = name_service->Resolve("/myStudyManager");
- if ( !CORBA::is_nil(anObj) ) {
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(anObj);
- if ( !CORBA::is_nil(aStudyManager) ) {
- _PTR(Study) aDSStudy = ClientFactory::Study(aStudyManager->GetStudyByID(myStudyID));
- if ( aDSStudy ) {
- _PTR(SComponent) aSCO = aDSStudy->FindComponent(myGeomEngine->ComponentDataType());
- if ( aSCO ) {
- _PTR(StudyBuilder) aBuilder = aDSStudy->NewBuilder();
- if ( aBuilder ) aBuilder->LoadWith( aSCO, anEngine );
- }
- }
- }
- }
- }
- // mkr : PAL10770 <--
-}
-
//=============================================================================
// CreateListOfGO:
//=============================================================================
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IBasicOperations interface
- if (CORBA::is_nil(myBasicOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID);
+ if (CORBA::is_nil(myBasicOp)) {
+ myBasicOp = myGeomEngine->GetIBasicOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_I3DPrimOperations interface
- if (CORBA::is_nil(my3DPrimOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID);
+ if (CORBA::is_nil(my3DPrimOp)) {
+ my3DPrimOp = myGeomEngine->GetI3DPrimOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IBooleanOperations interface
- if (CORBA::is_nil(myBoolOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID);
+ if (CORBA::is_nil(myBoolOp)) {
+ myBoolOp = myGeomEngine->GetIBooleanOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IInsertOperations interface
- if (CORBA::is_nil(myInsOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myInsOp = myGeomEngine->GetIInsertOperations(myStudyID);
+ if (CORBA::is_nil(myInsOp)) {
+ myInsOp = myGeomEngine->GetIInsertOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_ITransformOperations interface
- if (CORBA::is_nil(myTransfOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myTransfOp = myGeomEngine->GetITransformOperations(myStudyID);
+ if (CORBA::is_nil(myTransfOp)) {
+ myTransfOp = myGeomEngine->GetITransformOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IShapesOperations interface
- if (CORBA::is_nil(myShapesOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID);
+ if (CORBA::is_nil(myShapesOp)) {
+ myShapesOp = myGeomEngine->GetIShapesOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IBlocksOperations interface
- if (CORBA::is_nil(myBlocksOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID);
+ if (CORBA::is_nil(myBlocksOp)) {
+ myBlocksOp = myGeomEngine->GetIBlocksOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_ICurvesOperations interface
- if (CORBA::is_nil(myCurvesOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID);
+ if (CORBA::is_nil(myCurvesOp)) {
+ myCurvesOp = myGeomEngine->GetICurvesOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_ILocalOperations interface
- if (CORBA::is_nil(myLocalOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myLocalOp = myGeomEngine->GetILocalOperations(myStudyID);
+ if (CORBA::is_nil(myLocalOp)) {
+ myLocalOp = myGeomEngine->GetILocalOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM_IGroupOperations interface
- if (CORBA::is_nil(myGroupOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID);
+ if (CORBA::is_nil(myGroupOp)) {
+ myGroupOp = myGeomEngine->GetIGroupOperations();
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::IAdvancedOperations interface
- if (CORBA::is_nil(myAdvancedOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "AdvancedEngine"));
+ if (CORBA::is_nil(myAdvancedOp)) {
+ myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations("AdvancedEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::ISTLOperations interface
- if (CORBA::is_nil(mySTLOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STLPluginEngine"));
+ if (CORBA::is_nil(mySTLOp)) {
+ mySTLOp = GEOM::ISTLOperations::_narrow(myGeomEngine->GetPluginOperations("STLPluginEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM:IBREPOperations interface
- if (CORBA::is_nil(myBREPOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "BREPPluginEngine"));
+ if (CORBA::is_nil(myBREPOp)) {
+ myBREPOp = GEOM::IBREPOperations::_narrow(myGeomEngine->GetPluginOperations("BREPPluginEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::ISTEPOperations interface
- if (CORBA::is_nil(mySTEPOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "STEPPluginEngine"));
+ if (CORBA::is_nil(mySTEPOp)) {
+ mySTEPOp = GEOM::ISTEPOperations::_narrow(myGeomEngine->GetPluginOperations("STEPPluginEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::IIGESOperations interface
- if (CORBA::is_nil(myIGESOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "IGESPluginEngine"));
+ if (CORBA::is_nil(myIGESOp)) {
+ myIGESOp = GEOM::IIGESOperations::_narrow(myGeomEngine->GetPluginOperations("IGESPluginEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::IXAOOperations interface
- if (CORBA::is_nil(myXAOOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "XAOPluginEngine"));
+ if (CORBA::is_nil(myXAOOp)) {
+ myXAOOp = GEOM::IXAOOperations::_narrow(myGeomEngine->GetPluginOperations("XAOPluginEngine"));
}
}
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
// get GEOM::IVTKOperations interface
- if (CORBA::is_nil(myVTKOp) || isNewStudy(myLastStudyID,myStudyID)) {
- //rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
- // Try to get id of the study from the SALOME Session
- if(myStudyID < 0 ) SetStudyID(-1);
- myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine"));
+ if (CORBA::is_nil(myVTKOp)) {
+ myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations("VTKPluginEngine"));
}
}
#endif
// function : PublishInStudy
// purpose :
//============================================================================
-SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
+SALOMEDS::SObject_ptr GEOM_Superv_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject,
const char* theName) throw (SALOME::SALOME_Exception)
{
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
- return myGeomEngine->PublishInStudy(theStudy, theSObject, theObject, theName);
+ return myGeomEngine->PublishInStudy(theSObject, theObject, theName);
}
//============================================================================
// purpose :
//============================================================================
GEOM::ListOfGO*
-GEOM_Superv_i::PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
- //SALOMEDS::SObject_ptr theSObject,
+GEOM_Superv_i::PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject)
{
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
- return myGeomEngine->PublishNamedShapesInStudy(theStudy, theObject);
+ return myGeomEngine->PublishNamedShapesInStudy(theObject);
}
//============================================================================
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
PortableServer::POA_ptr thePOA);
- //-----------------------------------------------------------------------//
- // Set current stydy ID //
- //-----------------------------------------------------------------------//
- void SetStudyID( CORBA::Long theId );
-
//-----------------------------------------------------------//
// Create ListOfGO and add items to it //
//-----------------------------------------------------------//
CORBA::Boolean isASCII);
CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR);
- 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) ;
- GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
- //SALOMEDS::SObject_ptr theSObject,
+ GEOM::ListOfGO* PublishNamedShapesInStudy(//SALOMEDS::SObject_ptr theSObject,
CORBA::Object_ptr theObject);
CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
private:
SALOME_NamingService * name_service;
GEOM::GEOM_Gen_var myGeomEngine;
- CORBA::Long myStudyID;
- CORBA::Long myLastStudyID; // mkr : PAL10770
PortableServer::POA_var myPOA;
GEOM::GEOM_IBasicOperations_var myBasicOp;
from salome.kernel import termcolor
logger = Logger("salome.geom.geomtools", color = termcolor.RED)
-from salome.kernel.studyedit import getActiveStudyId, getStudyEditor
+from salome.kernel.studyedit import getStudyEditor
from salome.kernel.services import IDToObject, IDToSObject
from salome.kernel.deprecation import is_called_by_sphinx
+from salome.geom import geomBuilder
try:
if not is_called_by_sphinx():
except:
pass
-_geompys = {}
+_geompy = geomBuilder.New()
-## Return an object behaving exactly like geompy module, except that it is
-# associated with the study \em studyId. If \em studyId is \b None, return
-# a pseudo geompy object for the current study.
+## Return an object behaving exactly like geompy module.
# \ingroup geomtools
-def getGeompy(studyId = None):
+def getGeompy():
"""
- Return an object behaving exactly like geompy module, except that it is
- associated with the study `studyId`. If `studyId` is :const:`None`, return
- a pseudo geompy object for the current study.
+ Return an object behaving exactly like geompy module.
"""
- # We can't use geompy module because it initializes GEOM with
- # salome.myStudy, which may not exist. So we use this trick to create
- # a pseudo geompy module.
salome.salome_init()
- if studyId is None:
- studyId = getActiveStudyId()
- if not _geompys.has_key(studyId):
- from salome.geom import geomBuilder
- study = salome.myStudyManager.GetStudyByID(studyId)
- _geompys[studyId] = geomBuilder.New(study)
- return _geompys[studyId]
+ return _geompy
ModeWireFrame = 0
:param folderName: the name of a folder in the GEOM part of the study
"""
study = self.editor.study
- studyId = study._get_StudyId()
- geompy = getGeompy(studyId)
+ geompy = getGeompy()
if folderName is None:
# Insert the shape in the study by the standard way
The underlying GEOM object is returned (so that it can be destroyed)
"""
study = self.editor.study
- studyId = study._get_StudyId()
shape = self.getGeomObjectFromEntry(shapeStudyEntry)
studyObject = IDToSObject(shapeStudyEntry)
self.editor.removeItem(studyObject,True)
box = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudy( box, 'box' )
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
def TEST_getGeomObjectSelected():
import salome
salome.salome_init()
study = salome.myStudy
- studyId = salome.myStudyId
from salome.geom import geomtools
- geompy = geomtools.getGeompy(studyId)
+ geompy = geomtools.getGeompy()
from salome.kernel.studyedit import getStudyEditor
- studyEditor = getStudyEditor(studyId)
+ studyEditor = getStudyEditor()
gst = geomtools.GeomStudyTools(studyEditor)
# Put it in the study
from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
+ geompy = geomBuilder.New()
geompy.addToStudy( wire, 'mysketch' )
Additionnal examples can be found as unit tests in the source code.
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
+ geompy = geomBuilder.New()
pass
pass
except:
# structElemManager = StructuralElementManager()
# elem = structElemManager.createElement(commandList)
# elem.display()
-# salome.sg.updateObjBrowser(True)
+# salome.sg.updateObjBrowser()
# \endcode
#
# \defgroup orientation
structElemManager = StructuralElementManager()
elem = structElemManager.createElement(commandList)
elem.display()
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
"""
import GEOM
## This class manages the structural elements in the study. It is used to
-# create a new structural element from a list of commands. The parameter
-# \em studyId defines the ID of the study in which the manager will create
-# structural elements. If it is \b None or not specified, it will use
-# the ID of the current study as defined by
-# \b salome.kernel.studyedit.getActiveStudyId() function.
+# create a new structural element from a list of commands.
# \ingroup structelem
class StructuralElementManager:
"""
This class manages the structural elements in the study. It is used to
- create a new structural element from a list of commands. The parameter
- `studyId` defines the ID of the study in which the manager will create
- structural elements. If it is :const:`None` or not specified, it will use
- the ID of the current study as defined by
- :func:`salome.kernel.studyedit.getActiveStudyId` function.
+ create a new structural element from a list of commands.
"""
- def __init__(self, studyId = None):
- self._studyEditor = getStudyEditor(studyId)
+ def __init__(self):
+ self._studyEditor = getStudyEditor()
## Create a structural element from the list of commands \em commandList.
# Each command in this list represent a part of the structural element,
logger.debug("StructuralElementManager.createElement: START")
logger.debug("Command list: %s" % commandList)
- element = StructuralElement(self._studyEditor.studyId)
+ element = StructuralElement()
orientationCmdList = []
for command in commandList:
(parttype, parameters) = command
# Create the part
try:
- part = parts.__dict__[parttype](
- self._studyEditor.studyId, meshGroup,
- groupGeomObj, newparams)
+ part = parts.__dict__[parttype](meshGroup,
+ groupGeomObj, newparams)
element.addPart(part)
except InvalidParameterError, e:
logger.error("Invalid parameter error: %s" % e)
## This class represents a structural element, i.e. a set of geometrical
-# objects built along geometrical primitives. The parameter \em studyId
-# defines the ID of the study that will contain the structural element. If
-# it is \b None or not specified, the constructor will use the ID of
-# the active study as defined by \b salome.kernel.studyedit.getActiveStudyId
-# function. Structural elements are normally created by the class
-# StructuralElementManager, so this class should not be
-# instantiated directly in the general case.
+# objects built along geometrical primitives. Structural elements are
+# normally created by the class StructuralElementManager, so this class
+# should not be instantiated directly in the general case.
# \ingroup structelem
class StructuralElement:
"""
This class represents a structural element, i.e. a set of geometrical
- objects built along geometrical primitives. The parameter `studyId`
- defines the ID of the study that will contain the structural element. If
- it is :const:`None` or not specified, the constructor will use the ID of
- the active study as defined by :func:`salome.kernel.studyedit.getActiveStudyId`
- function. Structural elements are normally created by the class
- :class:`StructuralElementManager`, so this class should not be
- instantiated directly in the general case.
+ objects built along geometrical primitives. Structural elements
+ are normally created by the class :class:`StructuralElementManager`,
+ so this class should not be instantiated directly in the general case.
"""
_counter = 1
MAIN_FOLDER_NAME = "Structural Elements"
- def __init__(self, studyId = None):
+ def __init__(self):
# _parts is the dictionary mapping group name to structural element
# part. _shapeDict is the dictionary mapping SubShapeID objects to
# structural element parts. Both are used to avoid duplicate shapes
self._shapeDict = {}
self._id = StructuralElement._counter
StructuralElement._counter += 1
- self._studyEditor = getStudyEditor(studyId)
- logger.debug("Creating structural element in study %s" %
- self._studyEditor.studyId)
+ self._studyEditor = getStudyEditor()
+ logger.debug("Creating structural element in study")
self._SObject = None
## Find or create the study object corresponding to the structural
numerical ID.
"""
if self._SObject is None:
- geompy = getGeompy(self._studyEditor.studyId)
+ geompy = getGeompy()
geomComponent = self._studyEditor.study.FindComponent("GEOM")
mainFolder = self._studyEditor.findItem(geomComponent,
name = StructuralElement.MAIN_FOLDER_NAME,
different parts of the structural element, and add them to the study.
"""
gg = salome.ImportComponentGUI("GEOM")
- geompy = getGeompy(self._studyEditor.studyId)
+ geompy = getGeompy()
for part in self._parts.itervalues():
# Build the structural element part
logger.debug("Building %s" % part)
"""
if theSObject is not None:
gg = salome.ImportComponentGUI("GEOM")
- aStudy = theSObject.GetStudy()
- useCaseBuilder = aStudy.GetUseCaseBuilder()
- editor = getStudyEditor(aStudy._get_StudyId())
+ useCaseBuilder = salome.myStudy.GetUseCaseBuilder()
+ editor = getStudyEditor()
aIterator = useCaseBuilder.GetUseCaseIterator(theSObject)
aIterator.Init(False)
while aIterator.More():
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
+ geompy = geomBuilder.New()
import SALOMEDS
- geompy.init_geom(salome.myStudy)
+ geompy.init_geom()
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
edges = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["EDGE"])
geompy.addToStudy(Box_1, "Box_1")
elem = structElemManager.createElement(liste_commandes)
if salome.hasDesktop():
elem.display()
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
# Main function only used to test the module
## This class is the base class for all structural element parts. It should
# not be instantiated directly (consider it as an "abstract" class).
-# \param studyId (integer) the ID of the study in which the part is created.
# \param groupName (string) the name of the underlying geometrical primitive
# in the study.
# \param groupGeomObj (GEOM object) the underlying geometrical primitive.
This class is the base class for all structural element parts. It should
not be instantiated directly (consider it as an "abstract" class).
- :type studyId: integer
- :param studyId: the ID of the study in which the part is created.
-
:type groupName: string
:param groupName: the name of the underlying geometrical primitive in the
study.
DEFAULT_NAME = "StructElemPart"
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = DEFAULT_NAME, color = None):
self._parameters = parameters
self.groupName = groupName
self._orientation = None
self._paramUserName = {}
self.name = name
- self.geom = getGeompy(studyId)
+ self.geom = getGeompy()
self.baseShapesSet = set()
self.isMainShape = (groupGeomObj.GetType() != 37) # See geompyDC.ShapeIdToType for type codes
if not self.isMainShape:
mindim, value)
## Build the geometric shapes and the markers corresponding to the
- # structural element part in the study \em studyId.
+ # structural element part in the study.
def build(self):
"""
Build the geometric shapes and the markers corresponding to the
- structural element part in the study `studyId`.
+ structural element part in the study.
"""
shape = self._buildPart()
markers = self._buildMarkers()
DEFAULT_NAME = "Beam"
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = DEFAULT_NAME, color = None):
- StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj,
+ StructuralElementPart.__init__(self, groupName, groupGeomObj,
parameters, name, color)
self._orientation = orientation.Orientation1D()
"""
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = Beam.DEFAULT_NAME, color = None):
if color is None:
if parameters.has_key("R1"): # variable section
else: # constant section
color = RED
- Beam.__init__(self, studyId, groupName, groupGeomObj, parameters,
+ Beam.__init__(self, groupName, groupGeomObj, parameters,
name, color)
self.R1 = self._getParameter(["R1", "R"])
"""
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = Beam.DEFAULT_NAME, color = None):
if color is None:
if parameters.has_key("HY1") or parameters.has_key("H1"):
else: # constant section
color = BLUE
- Beam.__init__(self, studyId, groupName, groupGeomObj, parameters,
+ Beam.__init__(self, groupName, groupGeomObj, parameters,
name, color)
self.HY1 = self._getParameter(["HY1", "HY", "H1", "H"])
parameters.
"""
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = Beam.DEFAULT_NAME, color = None):
self.IY1 = getParameterInDict(["IY1", "IY"], parameters)
self.IZ1 = getParameterInDict(["IZ1", "IZ"], parameters)
else: # constant section
color = GREEN
- RectangularBeam.__init__(self, studyId, groupName, groupGeomObj, parameters,
+ RectangularBeam.__init__(self, groupName, groupGeomObj, parameters,
name, color)
## This class is an "abstract" class for all 2D structural element parts. It
DEFAULT_NAME = "StructuralElementPart2D"
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = DEFAULT_NAME):
- StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj,
+ StructuralElementPart.__init__(self, groupName, groupGeomObj,
parameters, name)
self._orientation = orientation.Orientation2D(
self._getParameter(["angleAlpha"]),
DEFAULT_NAME = "ThickShell"
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = DEFAULT_NAME):
- StructuralElementPart2D.__init__(self, studyId, groupName,
+ StructuralElementPart2D.__init__(self, groupName,
groupGeomObj, parameters, name)
self.thickness = self._getParameter(["Epais"])
logger.debug(repr(self))
DEFAULT_NAME = "Grid"
- def __init__(self, studyId, groupName, groupGeomObj, parameters,
+ def __init__(self, groupName, groupGeomObj, parameters,
name = DEFAULT_NAME):
- StructuralElementPart2D.__init__(self, studyId, groupName,
+ StructuralElementPart2D.__init__(self, groupName,
groupGeomObj, parameters, name)
self.xr = self._getParameter(["origAxeX"])
self.yr = self._getParameter(["origAxeY"])
## Alias for class GeneralBeam.
# \ingroup parts
-def VisuPoutreGenerale(studyId, groupName, groupGeomObj, parameters,
+def VisuPoutreGenerale(groupName, groupGeomObj, parameters,
name = "POUTRE"):
"""
Alias for class :class:`GeneralBeam`.
"""
- return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name)
+ return GeneralBeam(groupName, groupGeomObj, parameters, name)
## Alias for class CircularBeam.
# \ingroup parts
-def VisuPoutreCercle(studyId, groupName, groupGeomObj, parameters,
+def VisuPoutreCercle(groupName, groupGeomObj, parameters,
name = "POUTRE"):
"""
Alias for class :class:`CircularBeam`.
"""
- return CircularBeam(studyId, groupName, groupGeomObj, parameters, name)
+ return CircularBeam(groupName, groupGeomObj, parameters, name)
## Alias for class RectangularBeam.
# \ingroup parts
-def VisuPoutreRectangle(studyId, groupName, groupGeomObj, parameters,
+def VisuPoutreRectangle(groupName, groupGeomObj, parameters,
name = "POUTRE"):
"""
Alias for class :class:`RectangularBeam`.
"""
- return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name)
+ return RectangularBeam(groupName, groupGeomObj, parameters, name)
## Alias for class GeneralBeam.
# \ingroup parts
-def VisuBarreGenerale(studyId, groupName, groupGeomObj, parameters,
+def VisuBarreGenerale(groupName, groupGeomObj, parameters,
name = "BARRE"):
"""
Alias for class :class:`GeneralBeam`.
"""
- return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name,
+ return GeneralBeam(groupName, groupGeomObj, parameters, name,
color = ORANGE)
## Alias for class RectangularBeam.
# \ingroup parts
-def VisuBarreRectangle(studyId, groupName, groupGeomObj, parameters,
+def VisuBarreRectangle(groupName, groupGeomObj, parameters,
name = "BARRE"):
"""
Alias for class :class:`RectangularBeam`.
"""
- return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name,
+ return RectangularBeam(groupName, groupGeomObj, parameters, name,
color = ORANGE)
## Alias for class CircularBeam.
# \ingroup parts
-def VisuBarreCercle(studyId, groupName, groupGeomObj, parameters,
+def VisuBarreCercle(groupName, groupGeomObj, parameters,
name = "BARRE"):
"""
Alias for class :class:`CircularBeam`.
"""
- return CircularBeam(studyId, groupName, groupGeomObj, parameters, name,
+ return CircularBeam(groupName, groupGeomObj, parameters, name,
color = ORANGE)
## Alias for class CircularBeam.
# \ingroup parts
-def VisuCable(studyId, groupName, groupGeomObj, parameters, name = "CABLE"):
+def VisuCable(groupName, groupGeomObj, parameters, name = "CABLE"):
"""
Alias for class :class:`CircularBeam`.
"""
- return CircularBeam(studyId, groupName, groupGeomObj, parameters, name,
+ return CircularBeam(groupName, groupGeomObj, parameters, name,
color = PURPLE)
## Alias for class ThickShell.
# \ingroup parts
-def VisuCoque(studyId, groupName, groupGeomObj, parameters, name = "COQUE"):
+def VisuCoque(groupName, groupGeomObj, parameters, name = "COQUE"):
"""
Alias for class :class:`ThickShell`.
"""
- return ThickShell(studyId, groupName, groupGeomObj, parameters, name)
+ return ThickShell(groupName, groupGeomObj, parameters, name)
## Alias for class Grid.
# \ingroup parts
-def VisuGrille(studyId, groupName, groupGeomObj, parameters, name = "GRILLE"):
+def VisuGrille(groupName, groupGeomObj, parameters, name = "GRILLE"):
"""
Alias for class :class:`Grid`.
"""
- return Grid(studyId, groupName, groupGeomObj, parameters, name)
+ return Grid(groupName, groupGeomObj, parameters, name)
__libraryName__ = "AdvancedEngine"
def GetAdvancedOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(IAdvancedOperations)
## Create a T-shape object with specified caracteristics for the main
__libraryName__ = "BREPPluginEngine"
def GetBREPPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(IBREPOperations)
## Export the given shape into a file with given name in BREP format.
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#Sketcher_1 creation
Sketcher_1 = geompy.MakeSketcher("Sketcher:F 100 -57.7:TT 100 57.7:TT 0 115.47:TT -100 57.7:TT -100 -57.7:TT 0 -115.47:WW")
Cut_1 = geompy.MakeBoolean(Chamfer_2, theShapeForCut, 2)
geompy.addToStudy(Cut_1, "Cut_1")
-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()
# Create several objects
obj1 = geompy.MakeVertex(0.,0.,0.)
hasInfo = geompy.hasObjectInfo()
print "Check if GEOM module provides information about its objects: ", hasInfo
if hasInfo == True:
- print "Information about first object: ", geompy.getObjectInfo(salome.myStudyId, obj1_entry)
- print "Information about second object: ", geompy.getObjectInfo(salome.myStudyId, obj2_entry)
- print "Information about third object: ", geompy.getObjectInfo(salome.myStudyId, obj3_entry)
- print "Information about fourth object: ", geompy.getObjectInfo(salome.myStudyId, obj4_entry)
- print "Information about fifth object: ", geompy.getObjectInfo(salome.myStudyId, obj5_entry)
+ print "Information about first object: ", geompy.getObjectInfo(obj1_entry)
+ print "Information about second object: ", geompy.getObjectInfo(obj2_entry)
+ print "Information about third object: ", geompy.getObjectInfo(obj3_entry)
+ print "Information about fourth object: ", geompy.getObjectInfo(obj4_entry)
+ print "Information about fifth object: ", geompy.getObjectInfo(obj5_entry)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
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
# --
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
boolean_common = 1
boolean_cut = 2
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
vecy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
vecx = geompy.MakeVectorDXDYDZ(1.,0.,0.)
# import couplex2_01_GEOM
# reload(couplex2_01_GEOM)
# Dimensions de alveolus
-# Parall\89pip\88de rectangle de taille alDx, alDy, alDz
+# Parall�pip�de rectangle de taille alDx, alDy, alDz
#
alDx = 2.5
alDy = 20.0
alSepx = 18.0
# Dimensions de backfill
-# Parall\89pip\88de rectangle de taille baDx, baDy, baDz
+# Parall�pip�de rectangle de taille baDx, baDy, baDz
baDx = 27.0
baDy = 4.8
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# -- Construction de backfill
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
-# -- Dimensions de la boite enti\88re
+# -- Dimensions de la boite enti�re
LX, LY, LZ = 300.0, 150.0, 150.0
p0 = geompy.MakeVertex(0.,0.,0.)
vy = geompy.MakeVectorDXDYDZ(0.,1.,0.)
-# -- D\89finition du plan de sym\89trie (O,Ox,Oz)
+# -- D�finition du plan de sym�trie (O,Ox,Oz)
symPlane = geompy.MakePlane(p0, vy, 10.0)
# -- Galerie perpendiculaire
# -- Dimensions de la galerie perpendiculaire
-# -- La longueur est compt\89e \80 partir du centre
+# -- La longueur est compt�e � partir du centre
# -- de la galerie principale
gpe_long, gpe_diam = 200.0, 60.0
gpe = geompy.MakeTranslation(gpe, gpe_x, 0, 0)
# -- Dimensions d'une alveole
-# -- Construction d'une alv\89ole
+# -- Construction d'une alv�ole
alv_long, alv_diam = 60.0, 18.0
alv01 = geompy.MakeCylinder(p0, vy, alv_diam/2, alv_long)
alv02 = geompy.MakeMirrorByPlane(alv01, symPlane)
alv0 = geompy.MakeCompound([alv01, alv02])
-# -- Construction des alv\89oles
+# -- Construction des alv�oles
alv_del, alv_sep = 40.0, 35.0
alv1 = geompy.MakeTranslation(alv0, gal_x-gal_diam/2-alv_sep, 0.0, 0.0)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#SKETCHER INFOS
#Init Sketcher
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
import GEOM_Spanner
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()
geomgui = salome.ImportComponentGUI("GEOM")
import salome_ComponentGUI
def addToStudy(shape, name):
i = geompy.addToStudy(shape, name)
- salome.sg.updateObjBrowser(False)
+ salome.sg.updateObjBrowser()
if not isinstance(geomgui, type(salome_ComponentGUI)):
geomgui.createAndDisplayGO(i)
return i
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
ind = 0
boxlist = []
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
myBuilder = salome.myStudy.NewBuilder()
-BasicOp = geom.GetIBasicOperations(salome.myStudyId)
-PrimOp = geom.GetI3DPrimOperations(salome.myStudyId)
-InsertOp = geom.GetIInsertOperations(salome.myStudyId)
-TrsfOp = geom.GetITransformOperations(salome.myStudyId)
+BasicOp = geom.GetIBasicOperations()
+PrimOp = geom.GetI3DPrimOperations()
+InsertOp = geom.GetIInsertOperations()
+TrsfOp = geom.GetITransformOperations()
point0 = BasicOp.MakePointXYZ(0.,0.,0.)
pointz1 = BasicOp.MakePointXYZ(0.,0.,1.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
from time import sleep
import salome_ComponentGUI
gg = salome.ImportComponentGUI("GEOM")
-BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
-PrimOp = geompy.GetI3DPrimOperations(salome.myStudyId)
-InsertOp = geompy.GetIInsertOperations(salome.myStudyId)
-TrsfOp = geompy.GetITransformOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations()
+PrimOp = geompy.GetI3DPrimOperations()
+InsertOp = geompy.GetIInsertOperations()
+TrsfOp = geompy.GetITransformOperations()
point0 = BasicOp.MakePointXYZ(0.,0.,0.)
pointz1 = BasicOp.MakePointXYZ(0.,0.,1.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#Create Points
-BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations()
Vertex1 = BasicOp.MakePointXYZ(0., 0., 0.)
Vertex2 = BasicOp.MakePointXYZ(100., 20., 30.)
Vertex3 = BasicOp.MakePointXYZ(150., 100., -25.)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
ind = 1
circlelist = []
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
data_dir = os.getenv('DATA_DIR')
if data_dir:
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
#Variables modifiables
PosRot = PosZ + 0.9 * HauteurT
#Points
-BasicOp = geompy.GetIBasicOperations(salome.myStudyId)
+BasicOp = geompy.GetIBasicOperations()
OO = BasicOp.MakePointXYZ(0, 0, 0)
P0 = BasicOp.MakePointXYZ(0, 0, 1)
P1 = BasicOp.MakePointXYZ(PosX, PosY, PosZ)
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
# Interface with geometry
# -----------------------
def addToStudy(shape, name):
i = geompy.addToStudy(shape, name)
- salome.sg.updateObjBrowser(False)
+ salome.sg.updateObjBrowser()
# geomgui.createAndDisplayGO(i)
return i
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#
# base de l'assemblage
#
assemblage = geompy.Partition([base ,weld ,trav])
assemblageId = geompy.addToStudy(assemblage, "assemblage")
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
#
# Display
#
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#
# base de l'assemblage
#
#
import salome
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
import math
__libraryName__ = "IGESPluginEngine"
def GetIGESPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(IIGESOperations)
## Export the given shape into a file with given name in IGES format.
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
#Points creation (2.2)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
Line_1 = geompy.MakeLineTwoPnt(Vertex_4, Vertex_5)
geompy.addToStudy(Line_1, "Line_1")
-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 os
if os.access(theFilenameToSave, os.F_OK):
if os.access(theFilenameToSave, os.W_OK):
os.remove(theFilenameToSave)
- salome.myStudyManager.SaveAs(theFilenameToSave, salome.myStudy, 0)
+ salome.myStudy.SaveAs(theFilenameToSave, 0, 0)
else:
print "You have no enough permissions to overwrite HDF file: ",theFilenameToSave
else:
- salome.myStudyManager.SaveAs(theFilenameToSave, salome.myStudy, 0)
+ salome.myStudy.SaveAs(theFilenameToSave, 0, 0)
-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()
# Stage 2: "Creation of geometry"
id_Compound_2 = geompy.addToStudy(Compound_2, "Compound_2")
id_Solid_2 = geompy.addToStudyInFather(Compound_2,Compound_2_solids[1], "Solid_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()
#Points creation (2.2)
Vertex_1 = geompy.MakeVertex(0, 0, 0)
Wire_1 = geompy.MakeWire([Edge_1, Edge_2, Edge_3, Edge_4])
geompy.addToStudy(Wire_1, "Wire_1")
-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()
#Box creation (2.2)
Box_1 = geompy.MakeBoxDXDYDZ(200, 400, 300)
name = "Vertex_" + str(NbExplodedVertices_Box_1+NbExplodedVertices_Face_7+NbExplodedVertices_Face_10+NbExplodedVertices_Face_15+i+1)
geompy.addToStudyInFather(ListOfFaces_Partition_1[NbExplodedFaces_Partition_1-1], ListOfVertices_Face_18[i], name)
-salome.sg.updateObjBrowser(True)
+salome.sg.updateObjBrowser()
__libraryName__ = "STEPPluginEngine"
def GetSTEPPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(ISTEPOperations)
## Export the given shape into a file with given name in STEP format.
__libraryName__ = "STLPluginEngine"
def GetSTLPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(ISTLOperations)
## Export the given shape into a file with given name in STL format.
__libraryName__ = "VTKPluginEngine"
def GetVTKPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(IVTKOperations)
## Export the given shape into a file with given name in VTK format.
__libraryName__ = "XAOPluginEngine"
def GetXAOPluginOperations(self):
- anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ anOp = self.GetPluginOperations(__libraryName__)
return anOp._narrow(IXAOOperations)
## Export a shape to XAO format
## @code
## import salome
## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
## geompy.addToStudy(box, "box") # explicit publishing
## @endcode
## @code
## import salome
## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
## geompy.addToStudyAuto() # enable automatic publication
## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
## # the box is created and published in the study with default name
## @code
## import salome
## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
## # the box was created and published in the study
## folder = geompy.NewFolder("Primitives")
## For example,
## \code
## from salome.geom import geomBuilder
-## geompy = geomBuilder.New(salome.myStudy)
+## geompy = geomBuilder.New()
## texture = geompy.readtexture('mytexture.dat')
## texture = geompy.AddTexture(*texture)
## obj.SetMarkerTexture(texture)
Example of usage:
from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
+ geompy = geomBuilder.New()
texture = geompy.readtexture('mytexture.dat')
texture = geompy.AddTexture(*texture)
obj.SetMarkerTexture(texture)
GEOM._objref_GEOM_Gen.__init__(self)
self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
self.myBuilder = None
- self.myStudyId = 0
self.father = None
self.BasicOp = None
## @addtogroup l1_geomBuilder_auxiliary
## @{
- def init_geom(self,theStudy):
- self.myStudy = theStudy
- self.myStudyId = self.myStudy._get_StudyId()
+ def init_geom(self):
+ self.myStudy = salome.myStudy
self.myBuilder = self.myStudy.NewBuilder()
self.father = self.myStudy.FindComponent("GEOM")
- notebook.myStudy = theStudy
+ notebook.myStudy = salome.myStudy
if self.father is None:
self.father = self.myBuilder.NewComponent("GEOM")
A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
self.myBuilder.DefineComponentInstance(self.father,self)
pass
- self.BasicOp = self.GetIBasicOperations (self.myStudyId)
- self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
- self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
- self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
- self.HealOp = self.GetIHealingOperations (self.myStudyId)
- self.InsertOp = self.GetIInsertOperations (self.myStudyId)
- self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
- self.TrsfOp = self.GetITransformOperations(self.myStudyId)
- self.LocalOp = self.GetILocalOperations (self.myStudyId)
- self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
- self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
- self.GroupOp = self.GetIGroupOperations (self.myStudyId)
- self.FieldOp = self.GetIFieldOperations (self.myStudyId)
+ self.BasicOp = self.GetIBasicOperations ()
+ self.CurvesOp = self.GetICurvesOperations ()
+ self.PrimOp = self.GetI3DPrimOperations ()
+ self.ShapesOp = self.GetIShapesOperations ()
+ self.HealOp = self.GetIHealingOperations ()
+ self.InsertOp = self.GetIInsertOperations ()
+ self.BoolOp = self.GetIBooleanOperations ()
+ self.TrsfOp = self.GetITransformOperations()
+ self.LocalOp = self.GetILocalOperations ()
+ self.MeasuOp = self.GetIMeasureOperations ()
+ self.BlocksOp = self.GetIBlocksOperations ()
+ self.GroupOp = self.GetIGroupOperations ()
+ self.FieldOp = self.GetIFieldOperations ()
# set GEOM as root in the use case tree
self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
self.myBuilder.LoadWith(self.father, self)
pass
- def GetPluginOperations(self, studyID, libraryName):
- op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
+ def GetPluginOperations(self, libraryName):
+ op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
return op
## Enable / disable results auto-publishing
## Dump component to the Python script
# This method overrides IDL function to allow default values for the parameters.
- def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
+ def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
"""
Dump component to the Python script
This method overrides IDL function to allow default values for the parameters.
"""
- return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
+ return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
## Get name for sub-shape aSubObj of shape aMainObj
#
"""
# Example: see GEOM_TestAll.py
try:
- aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
+ aSObject = self.AddInStudy(aShape, aName, None)
if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
if doRestoreSubShapes:
- self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
+ self.RestoreSubShapesSO(aSObject, theArgs,
theFindMethod, theInheritFirstArg, True )
except:
print "addToStudy() failed"
"""
# Example: see GEOM_TestAll.py
try:
- aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
+ aSObject = self.AddInStudy(aShape, aName, aFather)
if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
except:
print "addToStudyInFather() failed"
list of published sub-shapes
"""
# Example: see GEOM_TestAll.py
- return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
+ return self.RestoreSubShapesO(theObject, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix)
## Publish sub-shapes, standing for arguments and sub-shapes of arguments
list of published sub-shapes
"""
# Example: see GEOM_TestAll.py
- return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
+ return self.RestoreGivenSubShapesO(theObject, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix)
# end of l3_restore_ss
self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
+ left_str + "length" + right_str + `max_length`)
- sg.updateObjBrowser(True)
+ sg.updateObjBrowser()
return group_edges
# import salome
# salome.salome_init()
# from salome.geom import geomBuilder
-# geompy = geomBuilder.New(salome.myStudy)
+# geompy = geomBuilder.New()
# \endcode
-# @param study SALOME study, generally obtained by salome.myStudy.
# @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
# @return geomBuilder instance
-def New( study, instance=None):
+def New( instance=None):
"""
Create a new geomBuilder instance.The geomBuilder class provides the Python
interface to GEOM operations.
import salome
salome.salome_init()
from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
+ geompy = geomBuilder.New()
Parameters:
- study SALOME study, generally obtained by salome.myStudy.
instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
Returns:
geomBuilder instance
doLcc = True
geom = geomBuilder()
assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
- geom.init_geom(study)
+ geom.init_geom()
return geom
try:
# get GEOM engine and initialize GEOM with current study
engineGeom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
- geom = geomBuilder.New(salome.myStudy, engineGeom)
+ geom = geomBuilder.New(engineGeom)
# export the methods of geomBuilder
for k in dir( geom ):
-------
import geompy
-geompy.init_geom(theStudy)
+geompy.init_geom()
with
----
from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
See also GEOM User's Guide for more details
# @code
# import GEOM
# from salome.geom import geomBuilder
-# geompy = geomBuilder.New(salome.myStudy)
+# geompy = geomBuilder.New()
#
# # create a wire for sketcher
# geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
# geompy.addToStudy( Sketch_1, 'Sketch_1' )
#
# # update object browser
-# salome.sg.updateObjBrowser(True)
+# salome.sg.updateObjBrowser()
# @endcode
# @n Additionnal examples can be found as unit tests in the source code.
# @}
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
- GEOM_Displayer( study ).Display( io, myUpdateViewer );
+ GEOM_Displayer().Display( io, myUpdateViewer );
}
};
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
- GEOM_Displayer( study ).Erase( io, true, myUpdateViewer );
+ GEOM_Displayer().Erase( io, true, myUpdateViewer );
}
};
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
-
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
- GEOM_Displayer( study ).UpdateViewer();
+ GEOM_Displayer().UpdateViewer();
}
};
if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aMainShape ) && !CORBA::is_nil( aSubShape ) ) {
// get shapes operations interface
GEOM::GEOM_IShapesOperations_var anIShapesOperations =
- aGeomGen->GetIShapesOperations( aMainShape->GetStudyID() );
+ aGeomGen->GetIShapesOperations();
if ( !CORBA::is_nil( anIShapesOperations ) )
index = anIShapesOperations->GetTopologyIndex( aMainShape, aSubShape );
}
if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aShape ) ) {
// get shapes operations interface
GEOM::GEOM_IShapesOperations_var anIShapesOperations =
- aGeomGen->GetIShapesOperations( aShape->GetStudyID() );
+ aGeomGen->GetIShapesOperations();
if ( !CORBA::is_nil( anIShapesOperations ) )
aTypeName = anIShapesOperations->GetShapeTypeString( aShape );
}
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !study ) return;
- GEOM_Displayer displayer( study );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
//=================================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_FillingDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_PipeDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
// purpose : virtual method to restore tree of argument's sub-shapes under
// the resulting shape. Redefined from GEOMBase_Helper class.
//=================================================================================
-void GenerationGUI_PipeDlg::restoreSubShapes
- (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject)
+void GenerationGUI_PipeDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject)
{
QCheckBox *aGenGroupCheck = NULL;
QLineEdit *aPrefixEdit = NULL;
}
aName += tr((*it)->GetName());
- getGeomEngine()->AddInStudy(theStudy, (*it).get(),
- aName.toStdString().c_str(), aFather);
+ getGeomEngine()->AddInStudy((*it).get(), aName.toStdString().c_str(), aFather);
}
}
}
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
virtual bool extractPrefix() const;
- virtual void restoreSubShapes
- (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes(SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_PipePathDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_RevolDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//==============================================================================
GEOM::GEOM_IOperations_ptr GenerationGUI_ThicknessDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//==============================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr GroupGUI_BooleanDlg::createOperation()
{
- return getGeomEngine()->GetIGroupOperations(getStudyId());
+ return getGeomEngine()->GetIGroupOperations();
}
//=================================================================================
SUIT_OverrideCursor wc;
myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations(getStudyId());
+ getGeomEngine()->GetIShapesOperations();
if (subSelectionWay() == GET_IN_PLACE) {
GEOM::GEOM_Object_var aGetInPlaceObj = aShapesOp->GetInPlace(myMainObj, anObj);
setInPlaceObj(aGetInPlaceObj);
// build map of indices
myMain2InPlaceIndices.Clear();
if (!myInPlaceObj->_is_nil()) {
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
- GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
+ GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations();
GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false);
for ( int i = 0; i < aSubObjects->length(); i++ )
return;
GEOM::ListOfLong_var aSubShapes;
- GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations();
aSubShapes = aShOp->SubShapeAllIDs(myMainObj, getShapeType(), false);
if (aSubShapes->length() > 0) {
if (subSelectionWay() == ALL_SUBSHAPES)
myIsShapeType &&
getShapeType() != TopAbs_VERTEX);
// manage of 'Plot' button access
- GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations();
GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false );
bool hasCurrentEntities = aSubShapes->length() > 0;
#ifndef DISABLE_PLOT2DVIEWER
SALOME_ListIO aSelList;
// To highlight the selected sub-shape in Object Browser, if it's already published under the main shape
- GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations();
QMap<int, QString> childsMap;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if (appStudy) {
//=================================================================================
GEOM::GEOM_IOperations_ptr GroupGUI_GroupDlg::createOperation()
{
- return getGeomEngine()->GetIGroupOperations(getStudyId());
+ return getGeomEngine()->GetIGroupOperations();
}
#define RETURN_WITH_MSG(a, b) \
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" );
IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
if ( igesOp.isNull() ) return false;
{
GEOM::GEOM_Object_var main = result[0];
QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
- SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
- SALOMEDS::SObject::_nil(),
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(),
main.in(),
publishName.toUtf8().constData() );
entryList.append( so->GetID() );
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
}
}
- getGeometryGUI()->updateObjBrowser( true );
+ getGeometryGUI()->updateObjBrowser();
app->browseObjects( entryList );
if ( errors.count() > 0 )
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" );
IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
if ( igesOp.isNull() ) return false;
* Export
*/
//=============================================================================
-bool IGESPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+bool IGESPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
TCollection_AsciiString aVersion = ( theFormatName == "IGES_5_3" ) ? "5.3" : "5.1";
aPluginOperations->ExportIGES( theOriginal, theFileName, aVersion );
return true;
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-IGESPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+IGESPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
bool anIsIgnoreUnits = ( theFormatName == "IGES_SCALE" ) ? true : false;
return aPluginOperations->ImportIGES( theFileName, anIsIgnoreUnits );
}
*/
//=============================================================================
TCollection_AsciiString
-IGESPlugin_IECallBack::ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName )
+IGESPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ReadValue( theFileName, theParameterName );
}
IGESPlugin_IECallBack();
~IGESPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theParameterName );
};
* Constructor
*/
//=============================================================================
-IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "IGESPlugin_IOperations::IGESPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( IGESPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- IGESPlugin_IOperations( GEOM_Engine*, int );
+ IGESPlugin_IOperations( GEOM_Engine* );
~IGESPlugin_IOperations();
void ExportIGES( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, IGESPlugin_IOperations*> IGESPlugin_OperationsCreator::_mapOfOperations;
+IGESPlugin_IOperations* IGESPlugin_OperationsCreator::_operation;
IGESPlugin_OperationsCreator::IGESPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* IGESPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "IGESPlugin_OperationsCreator::Create" );
- return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new IGESPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new IGESPlugin_IOperations( theGenImpl );
+ return _operation;
}
~IGESPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
private:
- static IGESPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static IGESPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, IGESPlugin_IOperations*> _mapOfOperations;
+ static IGESPlugin_IOperations* _operation;
friend class IGESPlugin_IECallBack;
};
if ( !anApp )
return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
- if ( !anActiveStudy )
- return;
Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO();
if ( anIObject.IsNull()
SUIT_OverrideCursor wc;
- GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() );
+ GEOMGUI_DimensionProperty aDimensions( QString(anIObject->getEntry()) );
for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt ) {
aDimensions.SetVisible( anIt, theIsVisible );
}
- aDimensions.SaveToAttribute( anActiveStudy, anIObject->getEntry() );
+ aDimensions.SaveToAttribute( anIObject->getEntry() );
- GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true );
+ GEOM_Displayer().Redisplay( anIObject, true );
}
//=======================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_AnnotationDlg::createOperation()
{
- return getGeomEngine()->GetILocalOperations( getStudyId() );
+ return getGeomEngine()->GetILocalOperations( );
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations(getStudyId());
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_CenterMassDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_CheckCompoundOfBlocksDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations( getStudyId() );
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_CheckSelfIntersectionsDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
}
}
- GEOM::ShapesOpPtr shapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::ShapesOpPtr shapesOper = getGeomEngine()->GetIShapesOperations();
// Explode sub-shapes
GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_CheckShapeDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
}
if (myShapesOper->_is_nil()) {
- myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+ myShapesOper = getGeomEngine()->GetIShapesOperations();
}
GEOM::ListOfGO_var aList = myShapesOper->MakeSubShapes(myObj, anArray);
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations(getStudyId());
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
{
GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
- GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
+ GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations();
GEOM::ListOfDouble_var aDbls;
int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls);
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_FastCheckIntersectionsDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
}
if (myShapesOper->_is_nil())
- myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+ myShapesOper = getGeomEngine()->GetIShapesOperations();
GEOM::ListOfGO_var aObjLstCreate = myShapesOper->MakeSubShapes(anObj.get(), anArray);
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_GetNonBlocksDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations(getStudyId());
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
QVariant() )
.value<GEOMGUI_DimensionProperty>();
- mySavedPropertyState.SaveToAttribute( aStudy, myEditObject->GetStudyEntry() );
+ mySavedPropertyState.SaveToAttribute( myEditObject->GetStudyEntry() );
myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
return;
}
- mySavedPropertyState.LoadFromAttribute( getStudy(), myEditObject->GetStudyEntry() );
+ mySavedPropertyState.LoadFromAttribute( myEditObject->GetStudyEntry() );
// set property state for preview
aStudy->setObjectProperty( GEOM::sharedPropertiesId(),
aSelMgr->GetIndexes(aSelList.First(), aMap);
if (aMap.Extent() == 1) // Local Selection
{
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
int anIndex = aMap(1);
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aName += QString(":face_%1").arg(anIndex);
aSelMgr->GetIndexes(aSelList.First(), aMap);
if (aMap.Extent() == 1) // Local Selection
{
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
int anIndex = aMap(1);
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aName += QString(":vertex_%1").arg(anIndex);
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_NormaleDlg::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations(getStudyId());
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
#include <LightApp_SelectionMgr.h>
#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
#include <Plot2d_Histogram.h>
#include <Plot2d_ViewFrame.h>
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_ShapeStatisticsDlg::createOperation()
{
- return getGeomEngine()->GetIGroupOperations(getStudyId());
+ return getGeomEngine()->GetIGroupOperations();
}
#define RETURN_WITH_MSG(a, b) \
myShapes.push_back( aShape );
GEOM::ListOfLong_var aSubShapes;
- GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations();
if ( hasEdges != 0 )
hasEdges = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_EDGE ) > 0;
if ( hasFaces != 0 )
int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
QString aTypePrefix = myCBTypes->currentText().replace(' ', '_');
QString objIOR, aMin, aMax, aGroupName;
- SalomeApp_Study* study = getStudy();
GEOMUtils::Distribution aShapesDistr =
GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
//=================================================================================
GEOM::GEOM_IOperations_ptr MeasureGUI_Skeleton::createOperation()
{
- return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ return getGeomEngine()->GetIMeasureOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_ArchimedeDlg::createOperation()
{
- return getGeomEngine()->GetILocalOperations( getStudyId() );
+ return getGeomEngine()->GetILocalOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_ChamferDlg::createOperation()
{
- return getGeomEngine()->GetILocalOperations(getStudyId());
+ return getGeomEngine()->GetILocalOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_ExtractionDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_ExtrudedFeatureDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName );
if ( aFindedObject->_is_nil()) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
anObj = aShapesOp->GetSubShape( anObj, anIndex );
}
else
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_Fillet1d2dDlg::createOperation()
{
- return getGeomEngine()->GetILocalOperations(getStudyId());
+ return getGeomEngine()->GetILocalOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation()
{
- return getGeomEngine()->GetILocalOperations(getStudyId());
+ return getGeomEngine()->GetILocalOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_GetShapesOnShapeDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_GetSharedShapesDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
if ( !myListTools.length() )
return;
else if ( myListTools.length() == 1 && getConstructorId() == 1 ) {
- GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations( getStudyId() );
+ GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations();
GEOM::ListOfLong_var intList;
GEOM::ListOfDouble_var dblList;
GEOM::GEOM_IKindOfShape::shape_kind kind = mOp->KindOfShape( myListTools[0].in(), intList.out(), dblList.out() );
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation()
{
- return getGeomEngine()->GetIBooleanOperations( getStudyId() );
+ return getGeomEngine()->GetIBooleanOperations();
}
// function : restoreSubShapes
// purpose :
//=================================================================================
-void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
/*theInheritFirstArg=*/myListShapes.length() == 1 && myListTools.length() == 0,
mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr OperationGUI_TransferDataDlg::createOperation()
{
- return getGeomEngine()->GetIInsertOperations(getStudyId());
+ return getGeomEngine()->GetIInsertOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_ConeDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_CylinderDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_DiskDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
// //=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_FaceDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetI3DPrimOperations( getStudyId() );
+ return myGeomGUI->GetGeomGen()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations( getStudyId() );
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
GEOM::GEOM_IOperations_ptr PrimitiveGUI_TorusDlg::createOperation()
{
- return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+ return getGeomEngine()->GetI3DPrimOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_ChangeOrientationDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations( getStudyId() );
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_CloseContourDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations( getStudyId() );
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_FreeBoundDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_FreeFacesDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations( getStudyId() );
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(anObj, aName);
if (aFindedObject->_is_nil()) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
anObj = aShapesOp->GetSubShape(anObj, anIndex);
}
else
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_FuseEdgesDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_GlueDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_GlueDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
GEOM::find_shape_method aFindMethod = GEOM::FSM_GetInPlace;
aFindMethod = GEOM::FSM_GetInPlaceByHistory;
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
aFindMethod, /*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
void RepairGUI_InspectObjectDlg::clickOnPublish()
{
- _PTR(Study) studyDS = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() )->studyDS();
-
// find main object
TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
anArray->length(j);
// get selected sub-shapes
- GEOM::GEOM_IShapesOperations_var anOper = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::GEOM_IShapesOperations_var anOper = getGeomEngine()->GetIShapesOperations();
GEOM::ListOfGO_var aList = anOper->MakeSubShapes( aMainObject, anArray );
// publish sub-shapes
for ( int i = 0; i < aList->length(); i++ )
- GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), aList[i],
+ GeometryGUI::GetGeomGen()->AddInStudy( aList[i],
anIndices.values().at(i).toStdString().c_str(), aMainObject );
updateObjBrowser();
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_LimitToleranceDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_RemoveExtraEdgesDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations( getStudyId() );
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_RemoveHolesDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_RemoveIntWiresDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_RemoveWebsDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations( getStudyId() );
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
void RepairGUI_ShapeProcessDlg::loadDefaults()
{
- GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations( getStudyId() );
+ GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations();
GEOM::string_array_var anOperators, aParams, aValues;
anOp->GetShapeProcessParameters( anOperators, aParams, aValues );
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations( getStudyId() );
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_SuppressFacesDlg::createOperation()
{
- return getGeomEngine()->GetIHealingOperations(getStudyId());
+ return getGeomEngine()->GetIHealingOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_UnionFacesDlg::createOperation()
{
- return getGeomEngine()->GetIBlocksOperations( getStudyId() );
+ return getGeomEngine()->GetIBlocksOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" );
STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
if ( stepOp.isNull() ) return false;
{
GEOM::GEOM_Object_var main = result[0];
QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
- SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
- SALOMEDS::SObject::_nil(),
- main.in(),
- publishName.toUtf8().constData() );
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(),
+ main.in(),
+ publishName.toUtf8().constData() );
entryList.append( so->GetID() );
for ( int i = 1, n = result->length(); i < n; i++ ) {
GEOM::GEOM_Object_ptr group = result[i];
CORBA::String_var grpName = group->GetName();
- GeometryGUI::GetGeomGen()->AddInStudy( dsStudy, group, grpName.in(), main );
+ GeometryGUI::GetGeomGen()->AddInStudy( group, grpName.in(), main );
}
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
}
}
- getGeometryGUI()->updateObjBrowser( true );
+ getGeometryGUI()->updateObjBrowser();
app->browseObjects( entryList );
if ( errors.count() > 0 )
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" );
STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
if ( stepOp.isNull() ) return false;
*/
//=============================================================================
bool
-STEPPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+STEPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit );
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-STEPPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+STEPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
bool anIsIgnoreUnits = ( theFormatName == "STEP_SCALE" ) ? true : false;
return aPluginOperations->ImportSTEP( theFileName, anIsIgnoreUnits, false );
}
*/
//=============================================================================
TCollection_AsciiString
-STEPPlugin_IECallBack::ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName )
+STEPPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ReadValue( theFileName, theParameterName );
}
STEPPlugin_IECallBack();
~STEPPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+ bool Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theParameterName );
};
* Constructor
*/
//=============================================================================
-STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
public:
- STEPPlugin_IOperations( GEOM_Engine*, int );
+ STEPPlugin_IOperations( GEOM_Engine* );
~STEPPlugin_IOperations();
void ExportSTEP( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, STEPPlugin_IOperations*> STEPPlugin_OperationsCreator::_mapOfOperations;
+STEPPlugin_IOperations* STEPPlugin_OperationsCreator::_operation;
STEPPlugin_OperationsCreator::STEPPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* STEPPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "STEPPlugin_OperationsCreator::Create" );
- return new STEPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new STEPPlugin_IOperations_i( thePOA, theEngine, get(theGenImpl) );
}
-STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new STEPPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new STEPPlugin_IOperations( theGenImpl );
+ return _operation;
}
~STEPPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
-
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
private:
- static STEPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static STEPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, STEPPlugin_IOperations*> _mapOfOperations;
+ static STEPPlugin_IOperations* _operation;
friend class STEPPlugin_IECallBack;
};
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" );
STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
if ( stlOp.isNull() ) return false;
{
GEOM::GEOM_Object_var main = result[0];
QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
- SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
- SALOMEDS::SObject::_nil(),
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( SALOMEDS::SObject::_nil(),
main.in(),
publishName.toUtf8().constData() );
entryList.append( so->GetID() );
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
transaction.abort();
}
}
- getGeometryGUI()->updateObjBrowser( true );
+ getGeometryGUI()->updateObjBrowser();
app->browseObjects( entryList );
if ( errors.count() > 0 )
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" );
STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
if ( stlOp.isNull() ) return false;
*/
//=============================================================================
bool
-STLPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+STLPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() );
bool anIsASCII = ( theFormatName == "STL_Bin") ? false : true;
const double aDeflection = 0.001;
const bool anIsRelative = true;
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-STLPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+STLPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ImportSTL( theFileName );
}
STLPlugin_IECallBack();
~STLPlugin_IECallBack();
- virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ virtual bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "STLPlugin_IOperations::STLPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( STLPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class STLPLUGINENGINE_EXPORT STLPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- STLPlugin_IOperations( GEOM_Engine*, int );
+ STLPlugin_IOperations( GEOM_Engine* );
~STLPlugin_IOperations();
void ExportSTL( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, STLPlugin_IOperations*> STLPlugin_OperationsCreator::_mapOfOperations;
+STLPlugin_IOperations* STLPlugin_OperationsCreator::_operation;
STLPlugin_OperationsCreator::STLPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* STLPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "STLPlugin_OperationsCreator::Create" );
- return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new STLPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new STLPlugin_IOperations( theGenImpl );
+ return _operation;
}
~STLPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+
private:
- static STLPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static STLPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, STLPlugin_IOperations*> _mapOfOperations;
+ static STLPlugin_IOperations* _operation;
friend class STLPlugin_IECallBack;
};
import salome_pluginsmanager
-def t_shape_fluid(context):
- activeStudy = context.study
+def t_shape_fluid():
#from salome.geom.t_shape import t_shape_builder
from salome.geom.t_shape import t_shape_dialog
dialog = t_shape_dialog.getDialog()
- dialog.setContext(context)
dialog.show()
salome_pluginsmanager.AddFunction('T shape fluid',
geompy = None
-def demidisk(study, r1, a1, roty=0, solid_thickness=0):
+def demidisk(r1, a1, roty=0, solid_thickness=0):
if solid_thickness < 1e-7:
with_solid = False
else:
with_solid = True
-
- #geompy = geomBuilder.New(study)
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
else:
return v, l, arc1, part1
-def pointsProjetes(study, vref, face):
- #geompy = geomBuilder.New(study)
+def pointsProjetes(vref, face):
vface = geompy.ExtractShapes(face, geompy.ShapeType["VERTEX"], True)
vord = range(len(vref))
plan = geompy.MakePlaneThreePnt(vref[0], vref[1], vref[-1], 10000)
vord[dist[0][1]] = vface[i]
return vord
-def arcsProjetes(study, vf, face):
- #geompy = geomBuilder.New(study)
+def arcsProjetes(vf, face):
lface = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
lord = range(3)
ends = [vf[1], vf[6], vf[7], vf[3]]
pass
return lord
-def build_shape(study, r1, r2, h1, h2, solid_thickness=0, progressBar=None ):
+def build_shape(r1, r2, h1, h2, solid_thickness=0, progressBar=None ):
""" Builds the final shape """
if progressBar is not None:
with_solid = True
global geompy
- geompy = geomBuilder.New(study)
+ geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
a1 = 45.0*(1.0 -ratio)/seuilmax
# --- Creation of the jonction faces
- [faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(study, r1, r2,\
+ [faci, sect45, arc1, l1, lord90, lord45, edges, arcextru] = jonction(r1, r2,\
h1, h2, a1)
if progressBar is not None:
progressBar.addSteps(2)
# The same code is executed again with different external radiuses in order
# to get the needed faces and edges to build the solid layer of the pipe
[faci_ext, sect45_ext, arc1_ext, l1_ext, \
- lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(study, r1 + solid_thickness, r2 + solid_thickness,\
+ lord90_ext, lord45_ext, edges_ext, arcextru_ext] = jonction(r1 + solid_thickness, r2 + solid_thickness,\
h1, h2, a1)
faces_jonction_ext = []
for i,l in enumerate(lord90):
# --- Partie inférieure
- v3, l3, arc3, part3 = demidisk(study, r1, a1, 180.0, solid_thickness)
+ v3, l3, arc3, part3 = demidisk(r1, a1, 180.0, solid_thickness)
extru3 = geompy.MakePrismVecH(part3, OX, h1)
# --- Symétrie
return final
-def jonction(study, r1, r2, h1, h2, a1):
+def jonction(r1, r2, h1, h2, a1):
""" Builds the jonction faces and
returns what is needed to build the whole pipe
"""
- #geompy = geomBuilder.New(study)
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
# --- sections droites des deux demi cylindres avec le partionnement
- v1, l1, arc1, part1 = demidisk(study, r1, a1, 0.)
- v2, l2, arc2, part2 = demidisk(study, r2, a1, 90.0)
+ v1, l1, arc1, part1 = demidisk(r1, a1, 0.)
+ v2, l2, arc2, part2 = demidisk(r2, a1, 90.0)
# --- extrusion des sections --> demi cylindres de travail, pour en extraire les sections utilisées au niveau du Té
# et enveloppe cylindrique du cylindre principal
# --- liste ordonnée des points projetés sur les deux sections
- vord45 = pointsProjetes(study, v1, sect45)
- vord90 = pointsProjetes(study, v2, sect90)
+ vord45 = pointsProjetes(v1, sect45)
+ vord90 = pointsProjetes(v2, sect90)
# --- identification des projections des trois arcs de cercle, sur les deux sections.
- lord45 = arcsProjetes(study, vord45, sect45)
- lord90 = arcsProjetes(study, vord90, sect90)
+ lord45 = arcsProjetes(vord45, sect45)
+ lord90 = arcsProjetes(vord90, sect90)
# --- abaissement des quatre points centraux de la section du cylindre secondaire
def test_t_shape_builder():
"""For testing purpose"""
salome.salome_init()
- theStudy = salome.myStudy
- geompy = geomBuilder.New(theStudy)
+ geompy = geomBuilder.New()
for r1 in [1., 100.]:
for r2 in [0.9*r1, 0.5*r1, 0.1*r1, 0.05*r1]:
for thickness in [r1/100., r1/10., r1/2.]:
h1 = r1 * 2.0
h2 = h1
try:
- res = build_shape(theStudy, r1, r2, h1, h2, thickness)
+ res = build_shape(r1, r2, h1, h2, thickness)
geompy.addToStudy(res, "res_%f_%f_%f"%(r1,r2, thickness))
except:
print "problem with res_%f_%f_%f"%(r1,r2, thickness)
self.dsb_smallRadius.setValue(40.0)
self.dsb_bigHeight.setValue(80.0)
self.dsb_smallHeight.setValue(80.0)
-
- def setContext(self, context):
- self._activeStudy = context.study
def accept(self):
from salome.geom.t_shape import t_shape_progress
self.close()
r1, r2, h1, h2, thickness = self.getData()
#QMessageBox.about(None, "Building in progress", "building shape, please be patient")
- #shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness)
+ #shape = t_shape_builder.build_shape(r1, r2, h1, h2, thickness)
shapeBuilder = t_shape_progress.t_shape_progress()
- shape = shapeBuilder.run(self._activeStudy, r1, r2, h1, h2, thickness)
- entry = xalome.addToStudy(self._activeStudy, shape, "T_shape_fluid" )
+ shape = shapeBuilder.run(r1, r2, h1, h2, thickness)
+ entry = xalome.addToStudy(shape, "T_shape_fluid" )
xalome.displayShape(entry)
def getData(self):
QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, Qt.Tool)
self.show()
- def run(self, activeStudy, r1, r2, h1, h2, thickness):
- shape = t_shape_builder.build_shape(activeStudy, r1, r2, h1, h2, thickness, self)
+ def run(self, r1, r2, h1, h2, thickness):
+ shape = t_shape_builder.build_shape(r1, r2, h1, h2, thickness, self)
self.setValue(self._nmaxSteps)
return shape
break;
case GEOMOp::OpReimport: // RELOAD IMPORTED SHAPE
{
- SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
-
GEOM::GEOM_ITransformOperations_var anOp =
- GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id());
+ GeometryGUI::GetGeomGen()->GetITransformOperations();
if (anOp->_is_nil()) return false;
- GEOM_Displayer aDisp (anAppStudy);
+ GEOM_Displayer aDisp;
SUIT_Desktop* desk = app->desktop();
QList<SUIT_ViewWindow*> wnds = desk->windows();
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_ExtensionDlg::createOperation()
{
- return getGeomEngine()->GetIShapesOperations(getStudyId());
+ return getGeomEngine()->GetIShapesOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_MirrorDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
myBase = aSelectedObject;
// recompute myAng and myStep (Mantis issue 0021718)
- GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId());
+ GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations();
double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
if (anOper->IsDone()) {
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myBase.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
myBase = aSelectedObject;
// recompute myStepU (Mantis issue 0021718)
- GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId());
+ GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations();
double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
if (anOper->IsDone()) {
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_MultiTranslationDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myBase.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_OffsetDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations( getStudyId() );
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_PositionDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual void addSubshapesToStudy();
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionOnCylDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_RotationDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myCurrObject.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
{
- return getGeomEngine()->GetITransformOperations(getStudyId());
+ return getGeomEngine()->GetITransformOperations();
}
//=================================================================================
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myCurrObject.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
#include "GeometryGUI.h"
#include "GEOM_Operation.h"
#include "GEOMBase.h"
-#include "GEOM_Displayer.h"
#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
- SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
- GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "VTKPluginEngine" );
+ GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "VTKPluginEngine" );
VTKOpPtr vtkOp = GEOM::IVTKOperations::_narrow( op );
if ( vtkOp.isNull() ) return false;
* Export
*/
//=============================================================================
-bool VTKPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+bool VTKPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine() );
const double aDeflection = 0.001;
aPluginOperations->ExportVTK( theOriginal, theFileName, aDeflection );
return true;
VTKPlugin_IECallBack();
~VTKPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
};
#endif
* Constructor
*/
//=============================================================================
-VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "VTKPlugin_IOperations::VTKPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( VTKPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- VTKPlugin_IOperations( GEOM_Engine*, int );
+ VTKPlugin_IOperations( GEOM_Engine* );
~VTKPlugin_IOperations();
void ExportVTK( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, VTKPlugin_IOperations*> VTKPlugin_OperationsCreator::_mapOfOperations;
+VTKPlugin_IOperations* VTKPlugin_OperationsCreator::_operation;
VTKPlugin_OperationsCreator::VTKPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* VTKPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "VTKPlugin_OperationsCreator::Create" );
- return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new VTKPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new VTKPlugin_IOperations( theGenImpl );
+ return _operation;
}
~VTKPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
private:
- static VTKPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
+ static VTKPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static std::map <int, VTKPlugin_IOperations*> _mapOfOperations;
+ static VTKPlugin_IOperations* _operation;
friend class VTKPlugin_IECallBack;
};
else
{
ledShape->setText(GEOMBase::GetName(m_mainObj));
- GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations();
// add groups names
GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true);
lstGroups->sortItems(Qt::AscendingOrder);
// add fields
- GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(getStudyId());
+ GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations();
GEOM::ListOfFields_var fields = fieldOp->GetFields(m_mainObj);
for (int i = 0, n = fields->length(); i < n; i++)
//=================================================================================
GEOM::GEOM_IOperations_ptr XAOPlugin_ExportDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" );
+ return getGeomEngine()->GetPluginOperations( "XAOPluginEngine" );
}
//=================================================================================
*/
//=============================================================================
bool
-XAOPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+XAOPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theShapeFileName )
{
- XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
- GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations( theDocId );
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() );
+ GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations();
Handle(TColStd_HSequenceOfTransient) groups = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Groups );
Handle(TColStd_HSequenceOfTransient) fields = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Fields );
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-XAOPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+XAOPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() );
Handle(TColStd_HSequenceOfTransient) result = new TColStd_HSequenceOfTransient();
Handle(TColStd_HSequenceOfTransient) subshapes = new TColStd_HSequenceOfTransient();
XAOPlugin_IECallBack();
~XAOPlugin_IECallBack();
- virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+ virtual bool Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theshapeFileName );
virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "XAOPlugin_IOperations::XAOPlugin_IOperations" );
}
if (lastFunction.IsNull()) return false;
// add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_IMPORT);
// add an Export function
Handle(GEOM_Function) exportFunction = result->AddFunction(XAOPlugin_Driver::GetID(), EXPORT_SHAPE);
anArray = new TColStd_HArray1OfInteger(1, 1);
anArray->SetValue(1, iref);
- subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ subShape = GetEngine()->AddObject(GEOM_SUBSHAPE);
Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull())
return;
}
// create the shape
- shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
+ shape = GetEngine()->AddObject(GEOM_IMPORT);
Handle(GEOM_Function) function = shape->AddFunction(XAOPlugin_Driver::GetID(), IMPORT_SHAPE);
if (function.IsNull()) return false;
if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- XAOPlugin_IOperations( GEOM_Engine*, int );
+ XAOPlugin_IOperations( GEOM_Engine* );
~XAOPlugin_IOperations();
bool ExportXAO( Handle(GEOM_Object) shape,
//=================================================================================
GEOM::GEOM_IOperations_ptr XAOPlugin_ImportDlg::createOperation()
{
- return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" );
+ return getGeomEngine()->GetPluginOperations( "XAOPluginEngine" );
}
//=================================================================================
if ( !aStudy || theField->_is_nil() )
return QString();
- SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy);
-
SALOMEDS::SObject_var aSO =
- getGeomEngine()->AddInStudy(aStudyDS, theField, theField->GetName(), theFather);
+ getGeomEngine()->AddInStudy(theField, theField->GetName(), theFather);
theField->UnRegister();
QString anEntry;
GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]);
QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
SALOMEDS::SObject_wrap aSOField =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
+ getGeomEngine()->AddInStudy( step, stepName.toLatin1().constData(), theField );
step->UnRegister();
}
GEOM::GEOM_Object_var fatherObj;
if (object->GetType() != GEOM_IMPORT && m_mainShape != NULL)
{
- //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(getStudyId());
+ //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations();
//fatherObj = groupOper->GetMainShape(object);
fatherObj = m_mainShape;
}
// OCCT includes
#include <TFunction_DriverTable.hxx>
-std::map <int, XAOPlugin_IOperations*> XAOPlugin_OperationsCreator::_mapOfOperations;
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::_operation;
XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator()
{
}
GEOM_IOperations_i* XAOPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl )
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "XAOPlugin_OperationsCreator::Create" );
- return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+ return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId )
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
- _mapOfOperations[theStudyId] = new XAOPlugin_IOperations( theGenImpl, theStudyId );
- return _mapOfOperations[theStudyId];
+ if( !_operation )
+ _operation = new XAOPlugin_IOperations( theGenImpl );
+ return _operation;
}
~XAOPlugin_OperationsCreator();
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl );
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
private:
- static XAOPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
- int theStudyId );
-
+ static XAOPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
+
private:
- static std::map <int, XAOPlugin_IOperations*> _mapOfOperations;
+ static XAOPlugin_IOperations* _operation;
friend class XAOPlugin_IECallBack;
};