SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
+SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
# Find KERNEL
# ===========
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
"SALOME_BUILD_GUI" OFF)
-CMAKE_DEPENDENT_OPTION(SALOME_GEOM_BUILD_CC "Enable curve creator (experimental)" OFF
- "SALOME_BUILD_GUI" OFF)
-MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV SALOME_GEOM_BUILD_CC)
-
-# Debug options (!!! FOR DEVELOPERS ONLY !!! TO BE REMOVED LATER !!!)
-IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
- CMAKE_DEPENDENT_OPTION(SALOME_GEOM_DEBUG_CC "Debug curve creator" OFF
- "SALOME_GEOM_BUILD_CC" OFF)
- MARK_AS_ADVANCED(SALOME_GEOM_DEBUG_CC)
-
- IF(SALOME_GEOM_DEBUG_CC)
- ADD_DEFINITIONS(-DDEBUG_CURVE_CREATOR)
- ENDIF(SALOME_GEOM_DEBUG_CC)
-ENDIF()
+MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
# Prerequisites
# =============
##
FIND_PACKAGE(SalomeCAS REQUIRED)
-FIND_PACKAGE(SalomeVTK 6.1 REQUIRED)
+FIND_PACKAGE(SalomeVTK REQUIRED)
# OpenCV
IF(SALOME_GEOM_USE_OPENCV)
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
- GEOMArchimede BREPExport BREPImport BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
- GEOMUtils GEOMEngine GEOM_SupervEngine IGESExport IGESImport GEOMSketcher
- SalomeIDLGEOM STEPExport STEPImport STLExport STLImport ShHealOper XAO AdvancedEngine OCC2VTK
- VTKExport
+ GEOMArchimede BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
+ GEOMUtils GEOMEngine GEOM_SupervEngine GEOMSketcher
+ SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine OCC2VTK
+ SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin SalomeIDLVTKPlugin
+ STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine VTKPluginEngine
)
IF(SALOME_BUILD_GUI)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
- AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef EntityGUI GEOMBase
+ AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef CurveCreator EntityGUI GEOMBase
GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject
- OperationGUI PrimitiveGUI RepairGUI TransformationGUI ImportExportGUI
+ OperationGUI PrimitiveGUI RepairGUI TransformationGUI DependencyTree
+ STLPluginGUI BREPPluginGUI STEPPluginGUI IGESPluginGUI XAOPluginGUI VTKPluginGUI
)
ENDIF(SALOME_BUILD_GUI)
)
ENDIF(SALOME_GEOM_USE_OPENCV)
-IF(SALOME_GEOM_BUILD_CC)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- CurveCreator
- )
-ENDIF(SALOME_GEOM_BUILD_CC)
-
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
# Exposed GEOM targets:
SET(GEOM_GEOMArchimede GEOMArchimede)
-SET(GEOM_BREPExport BREPExport)
-SET(GEOM_BREPImport BREPImport)
SET(GEOM_BlockFix BlockFix)
SET(GEOM_GEOMbasic GEOMbasic)
SET(GEOM_GEOMAlgo GEOMAlgo)
SET(GEOM_GEOMUtils GEOMUtils)
SET(GEOM_GEOMEngine GEOMEngine)
SET(GEOM_GEOM_SupervEngine GEOM_SupervEngine)
-SET(GEOM_IGESExport IGESExport)
-SET(GEOM_IGESImport IGESImport)
SET(GEOM_GEOMSketcher GEOMSketcher)
SET(GEOM_SalomeIDLGEOM SalomeIDLGEOM)
-SET(GEOM_STEPExport STEPExport)
-SET(GEOM_STEPImport STEPImport)
-SET(GEOM_STLExport STLExport)
-SET(GEOM_STLImport STLImport)
+SET(GEOM_SalomeIDLGEOMSuperv SalomeIDLGEOMSuperv)
+SET(GEOM_SalomeIDLAdvancedGEOM SalomeIDLAdvancedGEOM)
+SET(GEOM_SalomeIDLSTLPlugin SalomeIDLSTLPlugin)
+SET(GEOM_SalomeIDLBREPPlugin SalomeIDLBREPPlugin)
+SET(GEOM_SalomeIDLSTEPPlugin SalomeIDLSTEPPlugin)
+SET(GEOM_SalomeIDLIGESPlugin SalomeIDLIGESPlugin)
+SET(GEOM_SalomeIDLXAOPlugin SalomeIDLXAOPlugin)
+SET(GEOM_SalomeIDLVTKPlugin SalomeIDLVTKPlugin)
SET(GEOM_ShHealOper ShHealOper)
SET(GEOM_XAO XAO)
SET(GEOM_AdvancedEngine AdvancedEngine)
SET(GEOM_GEOMFiltersSelection GEOMFiltersSelection)
SET(GEOM_GEOM GEOM)
SET(GEOM_GEOMToolsGUI GEOMToolsGUI)
+SET(GEOM_DependencyTree DependencyTree)
SET(GEOM_GenerationGUI GenerationGUI)
SET(GEOM_GroupGUI GroupGUI)
SET(GEOM_Material Material)
SET(GEOM_MeasureGUI MeasureGUI)
SET(GEOM_GEOMObject GEOMObject)
SET(GEOM_OCC2VTK OCC2VTK)
-SET(GEOM_VTKExport VTKExport)
SET(GEOM_OperationGUI OperationGUI)
SET(GEOM_PrimitiveGUI PrimitiveGUI)
SET(GEOM_RepairGUI RepairGUI)
SET(GEOM_TransformationGUI TransformationGUI)
-SET(GEOM_ImportExportGUI ImportExportGUI)
+SET(GEOM_STLPluginGUI STLPluginGUI)
+SET(GEOM_STLPluginEngine STLPluginEngine)
+SET(GEOM_BREPPluginGUI BREPPluginGUI)
+SET(GEOM_BREPPluginEngine BREPPluginEngine)
+SET(GEOM_STEPPluginGUI STEPPluginGUI)
+SET(GEOM_STEPPluginEngine STEPPluginEngine)
+SET(GEOM_IGESPluginGUI IGESPluginGUI)
+SET(GEOM_IGESPluginEngine IGESPluginEngine)
+SET(GEOM_XAOPluginGUI XAOPluginGUI)
+SET(GEOM_XAOPluginEngine XAOPluginEngine)
+SET(GEOM_VTKPluginGUI VTKPluginGUI)
+SET(GEOM_VTKPluginEngine VTKPluginEngine)
SET(GEOM_GEOMShapeRec GEOMShapeRec)
SET(GEOM_CurveCreator CurveCreator)
SET(GEOM_INCLUDE_DIRS ${GEOM_ROOT_DIR}/include/salome)
FIND_LIBRARY(GEOM_GEOMArchimede GEOMArchimede ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_BREPExport BREPExport ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_BREPImport BREPImport ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_BlockFix BlockFix ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMbasic GEOMbasic ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMAlgo GEOMAlgo ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMUtils GEOMUtils ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMEngine GEOMEngine ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_SupervEngine GEOM_SupervEngine ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_IGESExport IGESExport ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_IGESImport IGESImport ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMSketcher GEOMSketcher ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_SalomeIDLGEOM SalomeIDLGEOM ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_STEPExport STEPExport ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_STLImport STLImport ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLGEOMSuperv SalomeIDLGEOMSuperv ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLSTLPlugin SalomeIDLSTLPlugin ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLBREPPlugin SalomeIDLBREPPlugin ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLSTEPPlugin SalomeIDLSTEPPlugin ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLIGESPlugin SalomeIDLIGESPlugin ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLVTKPlugin SalomeIDLVTKPlugin ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_SalomeIDLXAOPlugin SalomeIDLXAOPlugin ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_ShHealOper ShHealOper ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_XAO XAO ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_AdvancedEngine AdvancedEngine ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMFiltersSelection GEOMFiltersSelection ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOM GEOM ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMToolsGUI GEOMToolsGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_DependencyTree DependencyTree ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GenerationGUI GenerationGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GroupGUI GroupGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_Material Material ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMObject GEOMObject ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(GEOM_ImportExportGUI ImportExportGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_STLPluginGUI STLPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_STLPluginEngine STLPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_BREPPluginGUI BREPPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_BREPPluginEngine BREPPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_STEPPluginGUI STEPPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_STEPPluginEngine STEPPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_IGESPluginGUI IGESPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_IGESPluginEngine IGESPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_XAOPluginGUI XAOPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_XAOPluginEngine XAOPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_VTKPluginGUI VTKPluginGUI ${GEOM_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(GEOM_VTKPluginEngine VTKPluginEngine ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_GEOMShapeRec GEOMShapeRec ${GEOM_ROOT_DIR}/lib/salome)
FIND_LIBRARY(GEOM_CurveCreator CurveCreator ${GEOM_ROOT_DIR}/lib/salome)
csf_list = ["Plugin", "GEOMDS_Resources", "ShHealing"]
- for csf_file in csf_list:
- uniteFiles( os.path.join( res_dir, csf_file ), os.path.join( env_dir, csf_file ) )
- pass
-
- for csf_string in csf_list:
- csf_var = "CSF_" + csf_string + "Defaults"
+ for csf in csf_list:
+ uniteFiles( os.path.join( res_dir, csf ), os.path.join( env_dir, csf ) )
+ csf_var = "CSF_%sDefaults" % csf
if not os.getenv( csf_var ):
os.environ[ csf_var ] = env_dir
pass
pass
- # find plugins
+ # collect plugins
plugin_list = []
resource_path_list = []
- plugins_dir_var = "GEOM_ENGINE_RESOURCES_DIR"
- if os.environ.has_key(plugins_dir_var):
- # reverse the user's paths list, because the used 'add_path' prepends a new path,
- # but we want to append it: [a, b, c] => [c, b, a]
- plugins_dirs = os.environ[plugins_dir_var].split(os.pathsep)
- plugins_dirs.reverse()
- os.environ[plugins_dir_var] = string.join(plugins_dirs, os.pathsep)
- pass
+
+ # standard plugins
+ plugin_list.append("BREPPlugin")
+ plugin_list.append("STEPPlugin")
+ plugin_list.append("IGESPlugin")
+ plugin_list.append("STLPlugin")
+ plugin_list.append("XAOPlugin")
+ plugin_list.append("VTKPlugin")
+ plugin_list.append("AdvancedGEOM")
+
+ # find additional plugins
for env_var in os.environ.keys():
value = os.environ[env_var]
if env_var[-9:] == "_ROOT_DIR" and value:
plugin = env_var[:-9] # plugin name may have wrong case
# look for NAMEOFPlugin.xml file among resource files
- resource_dir = os.path.join(plugin_root,"share",salome_subdir,"resources",plugin.lower())
- if not os.access( resource_dir, os.F_OK ): continue
- for resource_file in os.listdir( resource_dir ):
- if resource_file.endswith( ".xml") and \
+ resource_dir = os.path.join(plugin_root, "share", salome_subdir, "resources", plugin.lower())
+ if not os.access(resource_dir, os.F_OK): continue
+
+ for resource_file in os.listdir(resource_dir):
+ if resource_file.endswith(".xml") and \
resource_file.lower() == plugin.lower() + ".xml":
# use "name" attribute of "geom-plugin" as name of plugin in a right case
- from xml.dom.minidom import parse
try:
- xml_doc = parse( os.path.join( resource_dir, resource_file ))
+ from xml.dom.minidom import parse
+ xml_doc = parse(os.path.join(resource_dir, resource_file))
plugin_nodes = xml_doc.getElementsByTagName("geom-plugin")
- except:
- continue
- if not plugin_nodes or not plugin_nodes[0].hasAttribute("name"): continue
- plugin = plugin_nodes[0].getAttribute("name")
- if plugin in plugin_list: continue
+ if not plugin_nodes or not plugin_nodes[0].hasAttribute("name"): continue
- # add paths of plugin
- plugin_list.append(plugin)
- if not os.environ.has_key("SALOME_"+plugin+"Resources"):
- resource_path = os.path.join(plugin_root,"share",salome_subdir,"resources",plugin.lower())
- os.environ["SALOME_"+plugin+"Resources"] = resource_path
- resource_path_list.append( resource_path )
- add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH")
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH")
+ plugin = plugin_nodes[0].getAttribute("name")
+ if plugin in plugin_list: continue
- if sys.platform == "win32":
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
- add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
- else:
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
- add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
- add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH")
+ plugin_list.append(plugin)
+
+ # add paths of plugin
+ if not os.environ.has_key("SALOME_"+plugin+"Resources"):
+ resource_path = os.path.join(plugin_root, "share", salome_subdir, "resources", plugin.lower())
+ os.environ["SALOME_"+plugin+"Resources"] = resource_path
+ resource_path_list.append(resource_path)
+ add_path(os.path.join(plugin_root, get_lib_dir(), python_version, "site-packages", salome_subdir), "PYTHONPATH")
+ add_path(os.path.join(plugin_root, get_lib_dir(), salome_subdir), "PYTHONPATH")
+ if sys.platform == "win32":
+ add_path(os.path.join(plugin_root, get_lib_dir(), salome_subdir), "PATH")
+ add_path(os.path.join(plugin_root, "bin", salome_subdir), "PYTHONPATH")
+ else:
+ add_path(os.path.join(plugin_root, get_lib_dir(), salome_subdir), "LD_LIBRARY_PATH")
+ add_path(os.path.join(plugin_root, "bin", salome_subdir), "PYTHONPATH")
+ add_path(os.path.join(plugin_root, "bin", salome_subdir), "PATH")
+ pass
pass
pass
- pass
- elif resource_file == "ImportExport" and plugin.upper() != "GEOM":
- # add 'ImportExport' plugin file path into variable
- add_path(resource_dir, plugins_dir_var)
- # add plugin's library path into environment
- if sys.platform == "win32":
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
- else:
- add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
- pass
+ except:
+ continue
pass
pass
- plugin_list.append("GEOMActions")
+ pass
+ pass
+
os.environ["GEOM_PluginsList"] = ":".join(plugin_list)
os.environ["SalomeAppConfig"] = os.environ["SalomeAppConfig"] + psep + psep.join(resource_path_list)
-
- if os.environ.has_key(plugins_dir_var):
- # reverse back the plugin paths:
- # [f, e, d, c, b, a] => [a, b, c, d, e, f]
- plugins_dirs = os.environ[plugins_dir_var].split(os.pathsep)
- plugins_dirs.reverse()
- os.environ[plugins_dir_var] = string.join(plugins_dirs, os.pathsep)
- pass
pass
# import shapes
Shape1 = geompy.ImportIGES(theFileName1)
Shape2 = geompy.ImportIGES(theFileName2)
-Shape3 = geompy.ImportFile(theFileName2,"IGES_SCALE")
+Shape3 = geompy.ImportIGES(theFileName2, True)
[Xmin1,Xmax1, Ymin1,Ymax1, Zmin1,Zmax1] = geompy.BoundingBox(Shape1)
[Xmin2,Xmax2, Ymin2,Ymax2, Zmin2,Zmax2] = geompy.BoundingBox(Shape2)
[Xmin3,Xmax3, Ymin3,Ymax3, Zmin3,Zmax3] = geompy.BoundingBox(Shape3)
--- /dev/null
+# 2D polyline
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+gg = salome.ImportComponentGUI("GEOM")
+
+# create vertices
+p1 = geompy.MakeVertex(70., 0., 0.)
+p2 = geompy.MakeVertex(70., 70., 80.)
+p3 = geompy.MakeVertex( 0., 70., 0.)
+
+#create a vector from two points
+vector_arc = geompy.MakeVector(p1, p3)
+
+# create an arc from three points
+arc = geompy.MakeArc(p1, p2, p3)
+
+# create a wire
+wire = geompy.MakeWire([vector_arc, arc])
+
+# create a planar face
+isPlanarWanted = 1
+face = geompy.MakeFace(wire, isPlanarWanted)
+
+# Create a 2D polyline with Polyline2D interface
+pl = geompy.Polyline2D()
+pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10])
+polyline1 = pl.result([100, 0, 0, 1, 1, 1, -1, 1, 0])
+
+pl = geompy.Polyline2D()
+pl.addSection("section 2", GEOM.Interpolation, False)
+pl.addPoints([20, 0, 30, 0, 30, 10])
+polyline2 = pl.result(face)
+
+# add objects in the study
+id_face = geompy.addToStudy(face,"Face")
+id_polyline1 = geompy.addToStudy(polyline1, "Polyline1")
+id_polyline2 = geompy.addToStudy(polyline2, "Polyline2")
+
+# display the first polyline and the second polyline with its planar face
+gg.createAndDisplayGO(id_face)
+gg.setDisplayMode(id_face,1)
+gg.setTransparency(id_face,0.5)
+gg.createAndDisplayGO(id_polyline1)
+gg.createAndDisplayGO(id_polyline2)
# Creation of a Cylinder
+import math
+
import salome
salome.salome_init()
import GEOM
# create a vertex and a vector
p1 = geompy.MakeVertex(25, 35, 45)
p2 = geompy.MakeVertex(70, 70, 70)
-v = geompy.MakeVector(p1, p2)
+v = geompy.MakeVector(p1, p2)
# create cylinders
-height = 40
-
+height = 40
radius1 = 15
+radius2 = 30
+angle1 = 45. * math.pi / 180.
+angle2 = 210. * math.pi / 180.
+
cylinder1 = geompy.MakeCylinder(p1, v, radius1, height)
-radius2 = 30
cylinder2 = geompy.MakeCylinderRH(radius2, height)
+cylinder3 = geompy.MakeCylinderA(p1, v, radius1, height, angle1)
+geompy.TranslateDXDYDZ(cylinder3, 80., 0., 0.)
+
+cylinder4 = geompy.MakeCylinderRHA(radius2, height, angle2)
+geompy.TranslateDXDYDZ(cylinder4, 80., 0., 0.)
+
# add objects in the study
id_cylinder1 = geompy.addToStudy(cylinder1,"Cylinder1")
id_cylinder2 = geompy.addToStudy(cylinder2,"Cylinder2")
+id_cylinder3 = geompy.addToStudy(cylinder3,"Cylinder3")
+id_cylinder4 = geompy.addToStudy(cylinder4,"Cylinder4")
# display the cylinders
gg.createAndDisplayGO(id_cylinder1)
gg.setDisplayMode(id_cylinder1,1)
gg.createAndDisplayGO(id_cylinder2)
gg.setDisplayMode(id_cylinder2,1)
+gg.createAndDisplayGO(id_cylinder3)
+gg.setDisplayMode(id_cylinder3,1)
+gg.createAndDisplayGO(id_cylinder4)
+gg.setDisplayMode(id_cylinder4,1)
sphere = geompy.MakeSphere(50,50,50, 30)
fuse = geompy.MakeBoolean(box,sphere,3)
fuse_id = geompy.addToStudy(fuse,"Fuse")
-box_id = geompy.addToStudy(box2, "Box")
gg = salome.ImportComponentGUI("GEOM")
gg.createAndDisplayGO(fuse_id)
gg.setDisplayMode(fuse_id,1)
-gg.createAndDisplayGO(box_id)
-gg.setVectorsMode(box_id, 1)
+gg.setVectorsMode(fuse_id, 1)
+gg.setVerticesMode(fuse_id, 1)
SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
+# Generate a temporary python file, needed for the genaration of the documentation
+# of the built-in Geometry plugins.
+SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin)
+SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
+SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
+SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})
+SALOME_GENERATE_ENVIRONMENT_SCRIPT(plugins_cmd env_script "${PYTHON_EXECUTABLE}" "${plugins_cmd_options}")
+# Install a script
+SALOME_INSTALL_SCRIPTS(collect_geom_methods.py ${SALOME_INSTALL_BINS})
+
SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
IF(WIN32)
STRING(REPLACE "/" "\\" f ${f})
ENDIF(WIN32)
ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
+ COMMAND ${CMAKE_COMMAND} -E make_directory tmp1
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomtools.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/geomtools.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/structelem.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/__init__.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/parts.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/parts.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/orientation.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/orientation.py
+ COMMAND ${plugins_cmd}
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
COMMAND ${CMAKE_COMMAND} -E remove_directory tmp
+ COMMAND ${CMAKE_COMMAND} -E remove_directory tmp1
VERBATIM
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ADD_DEPENDENCIES(usr_docs html_docs)
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+#################################################################################
+#
+# File: collect_geom_methods.py
+# Author: Roman NIKOLAEV, Open CASCADE S.A.S (roman.nikolaev@opencascade.com)
+#
+#################################################################################
+#
+# Extraction of the methods dynamically added by the Geometry
+# module plug-in(s) to the geomBuilder class.
+#
+# This script is intended for internal usage - only
+# for generatation of the extra developer documentation for
+# the Geometry module plug-in(s).
+#
+# Usage:
+# collect_geom_methods.py <plugin_name>
+# where
+# <plugin_name> is a name of the plug-in module
+#
+# Notes:
+# - the script is supposed to be run in correct environment
+# i.e. PYTHONPATH, GEOM_PluginsList and other important
+# variables are set properly; otherwise the script will fail.
+#
+################################################################################
+
+import sys
+import inspect
+
+def generate(plugin_name, output):
+ plugin_module_name = plugin_name + "Builder"
+ plugin_module = "salome.%s.%s" % (plugin_name, plugin_module_name)
+ import_str = "from salome.%s import %s" % (plugin_name, plugin_module_name)
+ exec( import_str )
+ exec( "import %s" % plugin_module )
+ exec( "mod = %s" % plugin_module )
+ functions = []
+ for attr in dir( mod ):
+ if attr.startswith( '_' ): continue # skip an internal methods
+ item = getattr( mod, attr )
+ if type( item ).__name__ == 'function':
+ if item not in functions:
+ functions.append( item )
+ pass
+ pass
+ pass
+ if functions:
+ for function in functions:
+ comments = inspect.getcomments(function)
+ if comments:
+ comments = comments.strip().split("\n")
+ comments = "\t" + "\n\t".join(comments)
+ output.append(comments)
+ pass
+ sources = inspect.getsource(function)
+ if sources is not None:
+ sources_list = sources.split("\n")
+ sources_new_list = []
+ found = False
+ for item in sources_list:
+ if '"""' in item:
+ if found == True:
+ found = False
+ continue
+ else:
+ found = True
+ continue
+ pass
+ pass
+ if found == False :
+ sources_new_list.append(item)
+ pass
+ pass
+ sources = "\n".join(sources_new_list)
+ sources = "\t" + sources.replace("\n", "\n\t")
+ output.append(sources)
+ pass
+ pass
+ pass
+ pass
+
+if __name__ == "__main__":
+ import optparse
+ parser = optparse.OptionParser(usage="%prog [options] plugin")
+ h = "Output file (geomBuilder.py by default)"
+ parser.add_option("-o", "--output", dest="output",
+ action="store", default=None, metavar="file",
+ help=h)
+ h = "If this option is True, dummy help for geomBuiler class is added. "
+ h += "This option should be False (default) when building documentation for Geometry module "
+ h += "and True when building documentation for Geometry module plug-ins."
+ parser.add_option("-d", "--dummy-geom-help", dest="dummygeomhelp",
+ action="store_true", default=False,
+ help=h)
+ (options, args) = parser.parse_args()
+ if len( args ) < 1: sys.exit("Plugin name is not specified")
+
+ f = open(options.output, "w")
+
+ output = []
+ if options.dummygeomhelp:
+ output.append( "## @package geomBuilder" )
+ output.append( "# Documentation of the methods dynamically added by the " + plugin_name + " Geometry plug-in to the geomBuilder class." )
+ # Add dummy Geometry help
+ # This is supposed to be done when generating documentation for Geometry module plug-ins
+ output.append( "# @note The documentation below does not provide complete description of class @b %geomBuilder" )
+ output.append( "# from @b geomBuilder package. This documentation provides only information about" )
+ output.append( "# the methods dynamically added to the %geomBuilder class by the " + plugin_name + " plugin" )
+ output.append( "# For more details on the %geomBuilder class, please refer to the SALOME %Geometry module" )
+ output.append( "# documentation." )
+ pass
+ else:
+ # Extend documentation for geomBuilder class with information about dynamically added methods.
+ # This is supposed to be done only when building documentation for Geometry module
+ output.append( "## @package geomBuilder" )
+ output.append( "# @note Some methods are dynamically added to the @b %geomBuilder class in runtime by the" )
+ output.append( "# plug-in modules. If you fail to find help on some methods in the documentation of Geometry module, " )
+ output.append( "# try to look into the documentation for the Geometry module plug-ins." )
+ pass
+ output.append("class geomBuilder():")
+
+ for arg in args:
+ generate( arg, output )
+ pass
+
+ for line in output: f.write( line + "\n" )
+ f.close()
#---------------------------------------------------------------------------
#Input related options
#---------------------------------------------------------------------------
-INPUT = tmp @CMAKE_SOURCE_DIR@/idl/GEOM_Gen.idl
+INPUT = tmp tmp1 @CMAKE_SOURCE_DIR@/idl/GEOM_Gen.idl \
+ @CMAKE_SOURCE_DIR@/idl/AdvancedGEOM_Gen.idl \
+ @CMAKE_SOURCE_DIR@/idl/STLPlugin.idl \
+ @CMAKE_SOURCE_DIR@/idl/BREPPlugin.idl \
+ @CMAKE_SOURCE_DIR@/idl/STEPPlugin.idl \
+ @CMAKE_SOURCE_DIR@/idl/IGESPlugin.idl \
+ @CMAKE_SOURCE_DIR@/idl/XAOPlugin.idl \
+ @CMAKE_SOURCE_DIR@/idl/VTKPlugin.idl
FILE_PATTERNS =
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/src/GEOM_SWIG
and then displays only the children of the selected object(s).
</li>
+\anchor publish_hidden_objects
<li><b>Unpublish</b> - hides the selected geometric object from the Object Browser
and erases it from all viewers. To publish unpublished geometric objects select in the
context menu of the <b>Geometry</b> root object <b>Publish...</b> item.
unpublished objects are sorted by name in ascending order. It is possible
to change the order (ascending / descending) by clicking the corresponding title bar of the objects list.
</li>
+
+<li>\ref dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
+in new 2D View Window.</li>
+
+<li>\ref reduce_study_page "Reduce study" - allows to reduce study
+by automatic removing objects according to user's options.</li>
</ul>
<h2> Folders </h2>
<li>\subpage create_isoline_page</li>
<li>\subpage create_sketcher_page</li>
<li>\subpage create_3dsketcher_page</li>
+<li>\subpage create_polyline_page</li>
<li>\subpage create_vector_page</li>
<li>\subpage create_plane_page</li>
<li>\subpage create_lcs_page</li>
\n Firstly, you can define a \b Cylinder by the <b>Base Point</b> (the central
point of the cylinder base), the \b Vector (the axis of the cylinder),
-and its dimensions: the Radius and the Height.
+and its dimensions: the \b Radius and the \b Height. Also, you can optionally specify
+the \b Angle in order to create a portion of cylinder.
+
\n <b>TUI Command:</b> <em>geompy.MakeCylinder(Point, Axis, Radius, Height)</em>
\n <b>Arguments:</b> Name + 1 vertex + 1 vector + 2 values
(Dimensions: radius and height).
+\n <b>TUI Command:</b> <em>geompy.MakeCylinderA(Point, Axis, Radius, Height, Angle)</em>
+\n <b>Arguments:</b> Name + 1 vertex + 1 vector + 3 values
+(Dimensions: radius, height and angle).
+
\image html cylinder1.png
-\n Secondly, you can define a \b Cylinder by the given radius and the
-height at the origin of coordinate system. The axis of the cylinder
-will be collinear to the OZ axis of the coordinate system.
+\n Secondly, you can define a \b Cylinder by the given \b Radius and
+\b Height at the origin of coordinate system. The axis of the cylinder
+will be collinear to the OZ axis of the coordinate system.
+Similarly to first constructor, you can optionally specify the \b Angle
+in order to create a portion of cylinder.
+
\n <b>TUI Command:</b> <em>geompy.MakeCylinderRH(Radius, Height)</em>
\n <b>Arguments:</b> Name + 2 values (Dimensions at origin: radius and
height).
+\n <b>TUI Command:</b> <em>geompy.MakeCylinderRHA(Radius, Height, Angle)</em>
+\n <b>Arguments:</b> Name + 3 values
+(Dimensions at origin: radius, height and angle).
+
\image html cylinder2.png
<b>Example:</b>
sub-shapes of a given Type and returns a List of IDs of
sub-shapes.</li>
<li><em>geompy.SubShapeAllSortedCentres(Shape, Type)</em> explodes a
-shape on sub-shapes of a given type and sorts them by coordinates of
-their gravity centers, returning a list of sub-shapes.</li>
+shape on sub-shapes of a given type and sorts them taking into account
+their gravity centers, to provide stable order of sub-shapes.
+It returns a list of sub-shapes.</li>
<li><em>geompy.SubShapeAllSortedCentresIDs(Shape, Type)</em> explodes
-a shape on sub-shapes of a given type and sorts them by coordinates of
-their gravity centers, returning a List of IDs of sub-shapes.</li>
+a shape on sub-shapes of a given type and sorts them taking into
+account their gravity centers, to provide stable order of sub-shapes.
+It returns a List of IDs of sub-shapes.</li>
<li><em>geompy.SubShape(Shape, Type, ListOfInd)</em> allows to obtain
a compound of sub-shapes of the Shape, selected by they indices in a
list of all sub-shapes of the given Type. Each index is in the range
--- /dev/null
+/*!
+
+\page create_polyline_page 2D Polyline
+
+The 2D Polyline allows drawing arbitrary 2D shapes.
+
+To create a <b>2D Polyline</b> select in the main menu <b>New Entity -> Basic -> 2D Polyline</b>.
+
+\image html polyline_dlg.png
+
+A polyline represents a section or a set of sections. Each section is constructed from a sequence of 2D points
+connected either by linear setgments or an interpolation curve. Every section has its own attributes:
+- \b Name,
+- \b Type (Polyline or Spline),
+- \b Closed flag.
+
+A Polyline created represents a shape that lies on the XOY plane. It can have the following types:
+- \b Vertex for a single section with only 1 point.
+- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline.
+A single edge in the result wire is obtained for a Spline or Polyline with 2 points.
+- \b Compound of Wires and/or Vertices if there are several sections.
+
+For the moment only one reference coordinate system for polyline creation is supported. The XOY plane of the <b>Global coordinate system</b>
+is suggested. Implementation of another reference coordinate system is a subject of further development of this functionality.
+Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
+For the moment this button works with only one plane.
+
+It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. To do it an imported object should satisfy conditions
+for polyline shapes mentioned above. If a valid shape is selected, when dialog is opened, it is initialized by this shape.
+Though the shape can be on any plane, an imported polyline will be defined on XOY plane only due to the limitation.
+
+The group \b Sections in this dialog represents the Polyline construction framework. Its toolbar has the following operations:
+- \b Undo
+- \b Redo
+- <b>Insert new section</b>
+- <b>Addition mode</b>
+- <b>Modification mode</b> - not implemented
+- <b>Detection mode</b> - not implemented
+- \b Remove
+- <b>Join selected sections</b>
+
+<b>Undo/Redo</b> buttons allows to undo/redo changes of the polyline.
+
+<b>Insert new section</b> button opens a dialog that allows to add a new section:
+
+\image html polyline_dlg_add_section.png
+
+In this dialog it is possible to choose:
+- \b Name of section
+- \b Type of section
+- \b Closed flag
+
+To create a new section \b Add button should be clicked. \b Cancel button is used to cancel this operation.
+After clicking \b Add button a new section is appeared on the list. Its name supplemented by its type and closedness
+information (see icon) and the number of points (equal to 0 after creation).
+
+To modify section parameters it is possible to double-click on a section in the list. In this case the following dialog appears:
+
+\image html polyline_dlg_edit_section.png
+
+To apply modifications the button \b Ok should be clicked.
+
+<b>Addition mode</b> allows to add points to a section. It is necessary to select a particular section in a list of sections
+and make some mouse clicks in the viewer. A section preview is recomputed after each click.
+
+<b>Modification mode</b> and <b>Detection mode</b> are not implemented for the moment.
+
+\b Remove button allows to remove a section. It is available if all modes are deactivated and one section is selected.
+
+<b>Join selected sections</b> button is available in modification mode if two or more sections are selected. It is used to
+merge several sections into the first one from selection list. Joined section has parameters of the first selected one. Points of
+the other sections are appended at the end of the list of the first section points.
+
+Some actions are available via popup menu by right mouse button click.
+
+If all modes are deactivated:
+- <b>Join all sections</b> - join all defined sections into the first one.
+- \b Join - join sections. Available if two or more sections are selected.
+
+In <b>Addition mode</b>:
+- <b>Join all sections</b> - join all defined sections into the first one.
+
+In <b>Modification mode</b>:
+- <b>Join all sections</b> - join all defined sections into the first one.
+- \b Join - join sections. Available if two or more sections are selected.
+- <b>Clear all</b> - remove all sections. Available if at least one section is selected.
+- <b>Set closed</b> - set all selected section's Closed flag. Available if at least one section is selected.
+- <b>Set open</b> - reset all selected section's Closed flag. Available if at least one section is selected.
+- <b>Set polyline</b> - set all selected section's type to Polyline. Available if at least one section is selected.
+- <b>Set spline</b> - set all selected section's type to Spline. Available if at least one section is selected.
+
+In <b>Detection mode</b>:
+- <b>Join all sections</b> - join all defined sections into the first one.
+- \b Join - join sections. Available if two or more sections are selected.
+
+<h2>TUI Commands</h2>
+
+
+To create the 2D polyline in TUI Polyline2D interface is used.
+
+<em>pl = geompy.Polyline2D()</em> - returns an instance of Polyline2D interface <i>pl</i>.
+
+See the \ref gsketcher.Polyline2D "Polyline2D" interface documentation for more information.
+
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_polyline_page "2D Polyline".
+*/
--- /dev/null
+/*!
+
+\page dependency_tree_page Dependency Tree
+
+<ul>
+<li>\ref dependency_tree_general_description_anchor "General description"</li>
+<li>\ref dependency_tree_nodes_anchor "Nodes" </li>
+<li>\ref dependency_tree_links_anchor "Links" </li>
+<li>\ref dependency_tree_operations_anchor "Operations" </li>
+<li>\ref dependency_tree_navigation_anchor "Navigation" </li>
+<li>\ref dependency_tree_popup_menu_anchor "Context menu"</li>
+</ul>
+
+\anchor dependency_tree_general_description_anchor <h2>General description</h2>
+
+In order to better understand the relations between the %GEOM
+objects in a study the user has a possibility to display the
+ascendants and descendant of the object(s) in a family tree.
+
+User can build the dependency tree by selecting desirable object
+in Object Browser or OCC Viewer and calling "Show dependency tree"
+popup item. It will open a new or clear the existing "Dependency
+Tree" view window (only one view is supported) and display a
+dependency tree for the selected object or objects (multiple
+selection is supported). Also user can rebuild the tree if to select
+some object(s) right in the "Dependency Tree" view and call
+"Rebuild the tree" popup menu item.
+
+\image html tree_example.png
+
+User can change all necessary parameters of Dependency Tree Viewer
+in \ref pref_dependency_tree "Preferences".
+
+<hr>
+\anchor dependency_tree_nodes_anchor <h2>Nodes</h2>
+
+Tree nodes in the Dependency Viewer are named according to the study
+names of the corresponding objects.
+
+Non-published objects are shown in the tree as "unpublished" and
+colored in special color.
+
+All nodes have the fixed size, so the long names are cut and shown
+with ellipsis; full name of the object can be seen in the tooltip
+if to keep the cursor over the node.
+
+"Dependency Tree" view supports the following states of nodes:
+
+<ul><li><b>Main node</b> - node of main object(s), which were selected in Object
+Browser, OCC Viewer or Dependency Tree Viewer in order to build the
+dependency tree;</li></ul>
+\image html tree_main_node.png
+
+<ul><li><b>Default node</b> - node of published in study object, which participate in building of
+dependency tree as ascendant or descendant;</li></ul>
+\image html tree_default_node.png
+
+<ul><li><b>Unpublished node</b> - the same as "Default node", but
+corresponding object was not published in study;</li></ul>
+\image html tree_unpublished_node.png
+
+<ul><li><b>Highlighted node</b> - the state of node when mouse
+cursor is over it;</li></ul>
+\image html tree_highlighted_node.png
+
+<ul><li><b>Selected node</b> - the state of node when user
+clicks the left mouse button on node.</li></ul>
+\image html tree_selected_node.png
+
+<hr>
+\anchor dependency_tree_links_anchor <h2>Links</h2>
+
+Dependency Tree Viewer shows oriented links between nodes to
+represent dependency direction. Viewer supports the following states
+of links:
+
+<ul><li><b>Unidirectional link</b> - shows that A object depends on
+B object;</li></ul>
+\image html tree_unidir_link.png
+
+<ul><li><b>Bidirectional link</b> - shows that A object depends on
+B object and, at the same time, B object depends on
+A object;</li></ul>
+\image html tree_bidir_link.png
+
+<ul><li><b>Self-dependency link</b> - shows that object depends on
+itself;</li></ul>
+\image html tree_selfdep_link.png
+
+<ul><li><b>Cyclic dependency links</b> - shows cyclic dependency of
+some nodes.</li></ul>
+\image html tree_cycldep_link.png
+
+<hr>
+\anchor dependency_tree_operations_anchor <h2>Operations</h2>
+
+The dependency tree of a chosen %GEOM object is displayed in
+the dedicated 2D view window.
+\n The functionalities of 2D viewer are available via its Viewer
+Toolbar.
+
+Buttons marked with small downward triangles have extended
+functionality which can be accessed by locking on them with left
+mouse button.
+
+\image tree_tool_bar
+
+<b>Dump View</b> - exports an object from the viewer in bmp, png or
+jpeg image format.
+\image html tree_view_dump.png
+
+<b>Fit all</b> - scales the presentation so that it could fit within
+the Viewer boundaries.
+\image html tree_view_fitall.png
+
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
+\image html tree_view_fitarea.png
+
+<b>Fit selection</b> - resizes the view to fit in the visible area
+only currently selected objects.
+\image html tree_view_fitselect.png
+
+<b>Zoom</b> - allows to zoom in and out.
+\image html tree_view_zoom.png
+
+<b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality,
+click on this button and you'll be able to drag the scene to see its
+remote parts.
+\image html tree_view_pan.png
+
+<b>Global panning</b> - allows to select a point to be the center of
+the presentation showing all displayed objects in the visible ares.
+\image html tree_view_glpan.png
+
+<b>Hierarchy depth</b> - allows to change the number of hierarchy
+levels to be shown in the dependency tree.
+\image html tree_hierarchy_type.png
+<ul>
+<li>Level 1 corresponds to the parents and children of the selected
+object(s);</li>
+<li>Level 2 is Level 1 plus the grand-parents and grand-children
+of the selected object(s);</li>
+<li>etc...</li>
+</ul>
+
+<b>Display ascendants</b> - allows user to control the displaying
+of ascendants.
+\image html tree_disp_ascendants.png
+
+<b>Display descendants</b> - allows user to control the displaying
+of descendants.
+\image html tree_disp_descendants.png
+
+<b>Move nodes</b> - enables/disables of moving the nodes.
+\image html tree_move_nodes.png
+
+<b>Update</b> - allows user to update a dependency tree model and the view.
+\image html tree_button_update.png
+
+<hr>
+\anchor dependency_tree_navigation_anchor <h2>Navigation</h2>
+
+Dependency Tree 2D Viewer supports the following navigation mode:
+
+<ul>
+<li>rectangle selection in this mode is performed by the left mouse
+button</li>;
+<li>multiple selection is available when \b Shift button
+is pressed.</li>
+</ul>
+
+Also, holding \b Ctrl key with pressed mouse buttons performs
+the following view transformations:
+<ul>
+<li>Ctrl + left mouse button - zooming;</li>
+<li>Ctrl + middle mouse button - panning;</li>
+</ul>
+
+<hr>
+\anchor dependency_tree_popup_menu_anchor <h2>Popup Menu</h2>
+
+After the object has appeared in the Dependency Tree 2D Viewer,
+user can select it with left mouse click to change its presentation
+parameters and get access to other useful options by right-clicking on
+the selected object.
+
+\image html tree_popup_menu1.png
+
+<ul>
+<li>\b Show - allows to show selected object(s) in OCC 3D Viewer;</li>
+<li><b> Show Only</b> - allows to show only selected object(s)
+in OCC 3D Viewer;</li>
+<li><b> Rebuild the tree</b> - allows to rebuild the dependency tree
+for selected object(s);</li>
+<li>\ref reduce_study_page "Reduce study" - allows to reduce study.</li>
+</ul>
+
+Some functionalities are available through right-clicking on
+the viewer background:
+
+\image html tree_popup_menu2.png
+
+Dependency Tree 2D Viewer background can be customized using the
+"Change background" popup menu command that opens standard
+"Select Color" dialog box:
+
+\image html selectcolor.png
+
+*/
\n <b>TUI Command:</b> <em>gg.setVectorsMode(ID, Bool)</em>
+\n Also it is possible to show the vertices of the selected
+shape. For this, choose in the context menu of the shape
+<b>Display mode -> Show Vertices</b>, or apply this
+functionality for all objects in the current view via the main menu
+<b> View -> Display Mode -> Show/Hide Vertices.</b>
+
+\image html vertices_mode.png
+<center><em>Vertices Mode (Show Vertices)</em></center>
+
+\n <b>TUI Command:</b> <em>gg.setVerticesMode(ID, Bool)</em>
+
Our <b>TUI Scripts</b> provide you with useful examples of
\ref tui_change_disp_mode "Changing Display Parameters".
\page geometry_preferences_page Geometry preferences
+\anchor pref_settings <h2>Settings</h2>
+
In the \b Geometry module you can set preferences for visualisation of
geometrical figures, which can be used in later sessions with this module.
There is also a special group of preferences controlling input
vertices.</li>
<li><b>Color of isolines</b> - allows to select default color for
isolines.</li>
-<li><b>Step value for spin boxes</b> - allows to define the increment
-of values set in spin boxes.</li>
+<li><b>Top level color</b> - allows to select default color for objects which
+were brought to the viewer foreground.</li>
+<li><b>Top level display mode</b> - allows to select default top level display mode between:</li>
+<ul>
+<li><b>Show additional wireframe actor</b> - allows to have the shading actor at its usual
+place (in the back) and add the additional wireframe actor in the viewer foreground.</li>
+<li><b>Keep current display mode</b> - allows to use current display mode of object.</li>
+<li><b>Wireframe</b> - allows to switch display mode to wireframe mode after
+"top-level" operation.</li>
+<li><b>Shading</b> - allows to switch display mode to shading mode after
+"top-level" operation.</li>
+<li><b>Shading With Edges</b> - allows to switch display mode to shading with edges mode after
+"top-level" operation.</li>
+</ul>
+<li><b>Transparency</b> - allows to define default transparency value.</li>
<li><b>Deflection coefficient</b> - allows to define default deflection
coefficient for lines and surfaces. A smaller coefficient provides
better quality of a shape in the viewer.</li>
<li><b>Isolines width</b> - allows to define default width of the isolines.</li>
<li><b>Preview edges width</b> - allows to define width of the edges for preview.</li>
<li><b>Measures line width</b> - allows to define lines width of measurements tools.</li>
+<li><b>Step value for spin boxes</b> - allows to define the increment
+of values set in spin boxes.</li>
<li><b>Automatic bring to front</b> - when the option is on, the objects selected by the user automatically become "top-level".</li>
</ul>
</ul>
</ul>
+\anchor pref_dependency_tree <h2>Dependency Tree</h2>
+
+Also user can set preferences for visualisation of <b>Dependency Tree</b> in 2D Viewer.
+
+\image html pref_dep_tree.png
+
+<ul>
+<li><b>General</b></li>
+<ul>
+<li><b>Hierarchy type</b> - allows to choose default displaying mode of dependency tree.</li>
+<li><b>Possibility to move nodes</b> - enable/disable the possibility of moving nodes by default.</li>
+</ul>
+</ul>
+
+<ul>
+<li><b>Color</b></li>
+<ul>
+<li><b>Background color</b> - allows to select default background color.</li>
+<li><b>Default node color</b> - allows to select default node color.</li>
+<li><b>Main node color</b> - allows to select default main node color.</li>
+<li><b>Unpublished node color</b> - allows to select default node color
+for unpublished objects.</li>
+<li><b>Selected node color</b> - allows to select default selected node color.</li>
+<li><b>Default arrow color</b> - allows to select default arrow color.</li>
+<li><b>Highlighted arrow color</b> - allows to select default highlighted
+arrow color.</li>
+<li><b>Selected arrow color</b> - allows to select default selected
+arrow color.</li>
+</ul>
+</ul>
*/
\page import_export_geom_obj_page Importing/exporting geometrical objects
-In Geometry module you can import and export geometrical objects
-from/into BREP, IGES, STEP, ACIS and STL files. The mechanisms of import and export
-are implemented via plug-ins, which gives the opportunity to
-expand the range of available formats by adding more plug-ins (for
-example, CATIA 5).
+\tableofcontents
+
+\section io_general General information
-The \subpage xao_format_page "import and export of shapes in XAO format" is implemented differently.
+In Geometry module you can import and export geometrical objects
+from/into \b BREP, \b IGES, \b STEP, \b STL, \b XAO, \b VTK (only export)
+and others files.
+The mechanisms of import and export are implemented via plugins,
+which gives the opportunity to expand the range of available formats
+by adding more plugins (for example, CATIA 5 or ACIS).
\note If a plugin supports import of materials associated with shapes, these
shapes are grouped corresponding to the imported materials. For the moment STEP
import is the only plugin that supports this feature.
-<em>To import geometrical objects from a BREP, IGES, STEP, ACIS or STL file:</em>
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_import_export_page
+
+\section io_import Import file
+
+<em>To import geometrical objects from a BREP, IGES, STEP or STL file:</em>
\par
-From the \b File menu choose \b Import. In the opening dialog box \b Import
-select the required format of the file for importation and search for
-a *.brep, *.iges, *.step, *.sat or *.stl file.
+From the \b File menu choose <b>Import/<FormatName></b>, where <b><FormatName></b> is a name
+of desirable format. In the <b>Import <FormatName></b> dialog box select the file to import
+and press \b Open. The file will be imported in the module and its contents (geometrical object)
+will be displayed in the <b>Object Browser</b>.
+
+The dialog box to import the file can provide additional parameters.
+
+For example, dialog box for importing files in STL format:
\image html geomimport.png
-\par
-Select the required file and click \b Open. Your file will be imported in
-the module and its contents (geometrical object) will be displayed in
-the <b>Object Browser</b>.
+\par
-\note If the selected file is in IGES or STEP format and the length
-is not expressed in meters, it will be asked whether to take or not these
+\note If the selected file is in IGES or STEP format and the model size
+is not expressed in meters, the user will be asked whether to take or not the
units into account (see the picture below). This feature can be
helpful if some wrong units have been written to the IGES or STEP file by a
3rd-party software.
\par
-\note If the selected file is in ACIS format (the use of this format
-requires licensing) and the file contains names for some shapes, it
-will be suggested to create groups by types (solid, face, edge and
-vertex) for all named shapes:
-
-\image html sat_named_shapes.png
-
-\par
-
\note It is possible to re-open from the initial file a previously imported shape if
the file has been changed on disk. For this, select
<b>Reload From Disk</b> in the context menu of the imported
\image html geomimport_reopen.png
-\n <em>To export geometrical objects into a BREP, IGES, STEP, ACIS or STL
+\section io_export Export file
+
+\n <em>To export geometrical objects into a BREP, IGES, STEP, STL or VTK
file:</em>
\par
Select the object you wish to export, then from the \b File menu choose
-\b Export. In the opening dialog box \b Export define the required format,
-the name and the location of the file for exportation.
+<b>Export/<FormatName></b>, where <b><FormatName></b> is a name of desirable format.
+In the <b>Export <FormatName></b> dialog box define the name and the location
+of the file to export and press \b Save.
+
+The dialog box to export the file can provide additional advanced parameters.
+
+For example, dialog box for exporting files in STL format:
\image html geomexport.png
\par
-Click \b Save to confirm your exportation.
-Our <b>TUI Scripts</b> provide you with useful examples of the use of
-\ref tui_import_export_page
+\section io_xao Import and export of shapes in XAO format
-*/
+XAO is a file format which describes a shape with its topology, groups and fields.
+
+<em>To import a shape in the \b XAO format:</em>
+
+\par
+In the \b File menu select <b>Import/XAO</b>.
+
+\image html importxao_dlg.png
+
+\par
+
+<em>To export a shape in the \b XAO format:</em>
+
+\par
+In the \b File menu select <b>Export/XAO</b>.
+\image html exportxao_dlg.png
+
+In this dialog:
+- Click the arrow button and select in the Object Browser or in the Viewer the <b>Shape</b> to be exported.
+- Input the <b>File name</b> to create a new file or click browse button to save in an existing file.
+- Select the \b Groups of the chosen shape to be exported.
+- Select the \b Fields of the chosen shape to be exported.
+- Press "Apply" or "Apply & Close" button to get the result.
+
+It also possible to export a shape using the TUI Command: <em>geompy.ExportXAO(Shape, FileName, Groups, Fields)</em>
+
+*/
\b Geometry module of SALOME is destined for:
- \subpage import_export_geom_obj_page "import and export of geometrical models"
- in IGES, BREP, STEP, ACIS and STL formats;
+ in IGES, BREP, STEP, STL, XAO and VTK formats;
- \subpage create_geom_obj_page "construction of geometrical objects"
using a wide range of functions;
- \subpage view_geom_obj_page "viewing geometrical objects" in the OCC
--- /dev/null
+/*!
+
+\page reduce_study_page Reduce Study
+
+The user sometimes needs to keep in the study only some objects that
+present the final result(s) of the design operations and to delete all
+other objects which do not contribute to these results.
+
+The feature is especially useful when the user designs the whole model
+through the GUI and wants to generate simplified "clean" Python dump only
+at the end of the model construction with no "useless" objects in the
+%GEOM module.
+
+User can open dialog box by selecting desirable object(s) in Object
+Browser or OCC Viewer and calling "Reduce study" popup item.
+
+\image html reduce_study_dialog.png
+
+<ul>
+
+<li><b> Objects to be kept</b> - objects that will be kept in the study after
+applying operation of reduce study. The list of objects being selected by
+the user are highlighted in bold font.</li>
+
+<li><b> Objects to be removed</b> - objects that will be deleted.</li>
+
+\note Mentioned views provide possibility to show/hide object(s) in
+current Viewer using "eye" icon near each item of tree. Also user can
+show/hide ALL objects in tree by clicking "eye" icon in the head of tree view.
+
+<li><b> Intermediate objects</b> group box allows to choose an action
+that will be performed with the objects that took part in the operations
+chain to produce the selected object(s):
+<ul>
+<li>Keep - object(s) will be kept in the study;</li>
+<li>Unpublish - object(s) will be unpublished (hidden) from the study;</li>
+<li>Remove - object(s) will be removed from the study. \note Since use of
+this option can lead to the broken Dump Python script, the warning message
+will be shown at the operation commiting to confirm/reject removing
+intermediate objects.</li>
+</ul>
+</li>
+
+<li><b> Sub-objects</b> group box allows to choose the same operations for
+sub-objects of selected item(s): keep, unpublish or remove.</li>
+
+<li><b> Remove empty folders</b> - if this option is checked, then all folders,
+which will become empty after removing unused objects from the study,
+will be also removed; otherwise, empty folders will be kept.</li>
+
+<li><b> Soft removal</b> - if this option is checked, operation will just
+unpublish the redundant objects from the study instead of their hard delete.
+\n Soft removal would keep all the data in the study to give the user a
+chance to revert this operation using \ref publish_hidden_objects
+"Publish Objects" dialog box.</li>
+
+</ul>
+*/
gg = salome.ImportComponentGUI("GEOM")
# create ExportXAO object
-exportxao = geompy.MakeExportXAO([value], [value], [value], [value])
+exportxao = geompy.ExportXAO([value], [value], [value], [value])
# add object in the study
id_exportxao = geompy.addToStudy(exportxao,"ExportXAO")
--- /dev/null
+/*!
+
+\page tui_polyline_page 2D Polyline
+\tui_script{polyline.py}
+
+*/
object.</li>
<li><b>Delete</b> - irreversibly deletes the selected object from the
viewer and from the Object Browser.</li>
+<li><b>Create Group</b> - allows to create group.</li>
<li>\subpage display_mode_page "Display Mode" - allows to select between
Wireframe and Shading presentation.</li>
<li>\subpage bring_to_front_page "Bring To Front" - allows to bring to
<li><b>Show all dimensions</b> - shows all of the persistent dimensions created for the selected geometrical object.</li>
<li><b>Hide all dimensions</b> - hides all of the persistent dimensions created for the selected geometrical object.</li>
+<li>\subpage dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
+in new 2D View Window.</li>
+<li>\subpage reduce_study_page "Reduce study" - allows to reduce study
+by automatic removing objects according to user's options.</li>
<li><b>Dump view</b> - exports an object from the viewer in bmp, png,
jpg or jpeg image format.</li>
<li><b>Change background</b> - allows to redefine the background
+++ /dev/null
-/*!
-
-\page xao_format_page Import and export of shapes in XAO format
-
-XAO is a file format which describes a shape with its topology, groups and fields.
-
-To import a shape in the \b XAO format, in the <b>Main Menu</b> select <b>New Entity ->
-Import / Export -> Import XAO. </b>
-
-To export a shape in the \b XAO format, in the <b>Main Menu</b> select <b>New Entity ->
-Import / Export -> Export XAO. </b>
-
-\image html exportxao_dlg.png
-
-In this dialog:
-- Click the arrow button and select in the Object Browser or in the Viewer the <b>Shape</b> to be exported.
-- Input the <b>File name</b> to create a new file or click browse button to save in an existing file.
-- Select the \b Groups of the chosen shape to be exported.
-- Select the \b Fields of the chosen shape to be exported.
-- Press "Apply" or "Apply & Close" button to get the result.
-
-It also possible to export a shape using the TUI Command: <em>geompy.MakeExportXAO(Shape, FileName, Groups, Fields)</em>
-
-*/
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : AdvancedGEOM.idl
+// Author : Roman NIKOLAEV
+
+#ifndef __AdvancedGEOM_IDL__
+#define __AdvancedGEOM_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Pattern for block division of the disk
+ */
+ enum pattern {
+ /*! Square */
+ SQUARE,
+ /*! Hexagon */
+ HEXAGON
+ };
+
+ /*!
+ * \brief Interface for advanced modeling functions.
+ */
+ interface IAdvancedOperations : GEOM::GEOM_IOperations
+ {
+ // T-Shape WITHOUT Thickness reduction
+
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2,
+ in GEOM::GEOM_Object theP3);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ *
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeChamfer (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theH, in double theW, in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A chamfer is created on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theH, in double theW, in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2,
+ in GEOM::GEOM_Object theP3);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A fillet is created on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRF, in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A fillet is created on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRF, in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2,
+ in GEOM::GEOM_Object theP3);
+
+ // T-Shape WITH Thickness reduction
+
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTR (in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTRWithPosition(in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2, in GEOM::GEOM_Object theP3);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ *
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTRChamfer(in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in double theH, in double theW, in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A chamfer is created on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTRChamferWithPosition(in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in double theH, in double theW, in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2, in GEOM::GEOM_Object theP3);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A fillet is created on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTRFillet(in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in double theRF, in boolean theHexMesh);
+ /*!
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ *
+ * A fillet is created on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ *
+ * \param theRL Internal radius of left thickness reduction
+ * \param theWL Width of left thickness reduction
+ * \param theLtransL Length of left transition part
+ * \param theLthinL Length of left thin part
+ *
+ * \param theRR Internal radius of right thickness reduction
+ * \param theWR Width of right thickness reduction
+ * \param theLtransR Length of right transition part
+ * \param theLthinR Length of right thin part
+ *
+ * \param theRI Internal radius of incident thickness reduction
+ * \param theWI Width of incident thickness reduction
+ * \param theLtransI Length of incident transition part
+ * \param theLthinI Length of incident thin part
+ *
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Object, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO MakePipeTShapeTRFilletWithPosition(in double theR1, in double theW1, in double theL1,
+ in double theR2, in double theW2, in double theL2,
+ in double theRL, in double theWL, in double theLtransL, in double theLthinL,
+ in double theRR, in double theWR, in double theLtransR, in double theLthinR,
+ in double theRI, in double theWI, in double theLtransI, in double theLthinI,
+ in double theRF, in boolean theHexMesh,
+ in GEOM::GEOM_Object theP1, in GEOM::GEOM_Object theP2,
+ in GEOM::GEOM_Object theP3);
+
+ /*!
+ * This function allows to create a disk already divided into blocks. It
+ * can be use to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \param theOrientation Plane on which the disk will be built
+ * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ * \return New GEOM_Object, containing the created shape.
+ */
+ GEOM::GEOM_Object MakeDividedDisk (in double theR,
+ in double theRatio,
+ in short theOrientation,
+ in GEOM::pattern thePattern);
+
+ /*!
+ * \brief Create a Disk prepared for hexa meshing with given center, normal vector and radius.
+ * \param thePnt disk center.
+ * \param theVec Vector, normal to the plane of the disk.
+ * \param theR Disk radius.
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ * \return New GEOM_Object, containing the created disk.
+ */
+ GEOM::GEOM_Object MakeDividedDiskPntVecR ( in GEOM::GEOM_Object thePnt,
+ in GEOM::GEOM_Object theVec,
+ in double theR,
+ in double theRatio,
+ in GEOM::pattern thePattern);
+
+ /*!
+ * Builds a cylinder prepared for hexa meshes
+ * \param theR Radius of the cylinder
+ * \param theH Height of the cylinder
+ * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ * \return New GEOM_Object, containing the created shape.
+ */
+ GEOM::GEOM_Object MakeDividedCylinder (in double theR,
+ in double theH,
+ in GEOM::pattern thePattern );
+ /*!
+ *
+ * Create a smoothing surface from a set of points
+ * \param thelPoints list of points. Compounds of ggpoints are accepted as well.
+ * \param theNbMax maximum number of Bezier pieces in the resulting surface.
+ * \param theDegMax maximum degree of the resulting BSpline surface
+ * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
+ * \return New GEOM_Object, containing the created shape.
+ */
+ GEOM::GEOM_Object MakeSmoothingSurface (in GEOM::ListOfGO thelPoints,
+ in long theNbMax,
+ in long theDegMax,
+ in double theDMax);
+
+ /*@@ insert new functions before this line @@ do not remove this line @@*/
+ };
+};
+
+#endif // __AdvancedGEOM_IDL__
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __BREPPlugin_IDL__
+#define __BREPPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for BREPPlugin modeling functions.
+ */
+ interface IBREPOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in BREP format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ */
+ void ExportBREP( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+
+ /*!
+ * \brief Import a shape from the BREP file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportBREP( in string theFileName );
+ };
+};
+
+#endif // __BREPPlugin_IDL__
SET(SalomeIDLGEOM_IDLSOURCES
GEOM_Gen.idl
+)
+
+SET(SalomeIDLGEOMSuperv_IDLSOURCES
GEOM_Superv.idl
)
+SET(SalomeIDLAdvancedGEOM_IDLSOURCES
+ AdvancedGEOM.idl
+)
+
+SET(SalomeIDLSTLPlugin_IDLSOURCES
+ STLPlugin.idl
+)
+
+SET(SalomeIDLBREPPlugin_IDLSOURCES
+ BREPPlugin.idl
+)
+
+SET(SalomeIDLSTEPPlugin_IDLSOURCES
+ STEPPlugin.idl
+)
+
+SET(SalomeIDLIGESPlugin_IDLSOURCES
+ IGESPlugin.idl
+)
+
+SET(SalomeIDLXAOPlugin_IDLSOURCES
+ XAOPlugin.idl
+)
+
+SET(SalomeIDLVTKPlugin_IDLSOURCES
+ VTKPlugin.idl
+)
+
SET(IDL_INCLUDE_DIRS
${KERNEL_ROOT_DIR}/idl/salome
${CMAKE_CURRENT_SOURCE_DIR}
)
+
SET(IDL_LINK_FLAGS
${KERNEL_SalomeIDLKernel}
)
+SET(IDL_LINK_PLUGIN_FLAGS
+ ${KERNEL_SalomeIDLKernel}
+ SalomeIDLGEOM
+)
+
+SET(IDL_LINK_SUPERV_FLAGS
+ ${KERNEL_SalomeIDLKernel}
+ SalomeIDLGEOM
+ SalomeIDLAdvancedGEOM
+)
+
OMNIORB_ADD_MODULE(SalomeIDLGEOM "${SalomeIDLGEOM_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
INSTALL(TARGETS SalomeIDLGEOM EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLAdvancedGEOM "${SalomeIDLAdvancedGEOM_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLAdvancedGEOM EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLSTLPlugin "${SalomeIDLSTLPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLSTLPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLBREPPlugin "${SalomeIDLBREPPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLBREPPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLSTEPPlugin "${SalomeIDLSTEPPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLSTEPPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLIGESPlugin "${SalomeIDLIGESPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLIGESPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLXAOPlugin "${SalomeIDLXAOPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLXAOPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+INSTALL(TARGETS SalomeIDLVTKPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+OMNIORB_ADD_MODULE(SalomeIDLGEOMSuperv "${SalomeIDLGEOMSuperv_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_SUPERV_FLAGS}")
+INSTALL(TARGETS SalomeIDLGEOMSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
/*!
* \brief Kind of the curves.
*
- * Used in the functions GEOM_ICurvesOperations.MakeCurveParametric(), GEOM_ICurvesOperations.MakeCurveParametricNew()
+ * Used in the functions GEOM_ICurvesOperations.MakeCurveParametric(), GEOM_ICurvesOperations.MakeCurveParametricNew(),
+ * GEOM_ICurvesOperations.MakePolyline2D, GEOM_ICurvesOperations.MakePolyline2DOnPlane.
*/
enum curve_type {
/*! Polyline curve */
Interpolation
};
- /*!
- * \brief Pattern for block division of the disk
- *
- * Used in the functions GEOM_IAdvancedOperations.MakeDividedDisk(), GEOM_ICurvesOperations.MakeDividedDiskPntVecR()
- */
- enum pattern {
- /*! Square */
- SQUARE,
-
- /*! Hexagon */
- HEXAGON
- };
-
/*!
* \brief Type of field data
*/
};
- typedef sequence<string> string_array;
- typedef sequence<short> short_array;
- typedef sequence<boolean> ListOfBool;
- typedef sequence<long> ListOfLong;
- typedef sequence<double> ListOfDouble;
+ typedef sequence<string> string_array;
+ typedef sequence<short> short_array;
+ typedef sequence<boolean> ListOfBool;
+ typedef sequence<long> ListOfLong;
+ typedef sequence<double> ListOfDouble;
+ typedef sequence<ListOfDouble> ListOfListOfDouble;
interface GEOM_Object;
interface GEOM_BaseObject;
*/
GEOM_Object MakeCylinderRH (in double theR, in double theH);
+ /*!
+ * \brief Create a portion of cylinder with given radius, height and angle at
+ * the origin of coordinate system.
+ *
+ * Axis of the cylinder will be collinear to the OZ axis of the coordinate system.
+ * \param theR Cylinder radius.
+ * \param theH Cylinder height.
+ * \param theA Cylinder angle.
+ * \return New GEOM_Object, containing the created cylinder.
+ */
+ GEOM_Object MakeCylinderRHA (in double theR, in double theH, in double theA);
+
/*!
* \brief Create a cylinder with given base point, axis, radius and height.
* \param thePnt Central point of cylinder base.
in GEOM_Object theAxis,
in double theR,
in double theH);
+ /*!
+ * \brief Create a portion of cylinder with given base point, axis, radius, height and angle.
+ * \param thePnt Central point of cylinder base.
+ * \param theAxis Cylinder axis.
+ * \param theR Cylinder radius.
+ * \param theH Cylinder height.
+ * \param theA Cylinder angle.
+ * \return New GEOM_Object, containing the created cylinder.
+ */
+ GEOM_Object MakeCylinderPntVecRHA (in GEOM_Object thePnt,
+ in GEOM_Object theAxis,
+ in double theR,
+ in double theH,
+ in double theA);
/*!
* \brief Create a cone with given height and radiuses at
* \return New GEOM_Object, containing the created wire.
*/
GEOM_Object Make3DSketcher (in ListOfDouble theCoordinates);
+
+ /*!
+ * \brief Create a 2D polyline (wire or a compound of wires).
+ *
+ * The polyline can have several sections. Each section represents a set
+ * of points in the form of list of coordinates of the following order:
+ * x1, y1, x2, y2, ..., xN, yN
+ * Each section has its own name, type of curve (can be either
+ * GEOM::Polyline or GEOM::Interpolation) and Closed flag.
+ * For each section a wire is created. It represents either a polyline or
+ * interpolation BSpline either closed or not depending on the Closed flag.
+ * The result represents a wire if there is only one section is defined.
+ * Otherwise a compound of wires is returned.
+ *
+ * \param theCoordsList the list of coordinates list. theCoordsList[0]
+ * is the coordinates list of the first section. theCoordsList[1]
+ * is for the second section etc.
+ * \param theNamesList the list of names. The order corresponds to
+ * theCoordsList.
+ * \param theTypesList the list of curve types. The order corresponds to
+ * theCoordsList.
+ * \param theClosedList the list of Closed flags. The order corresponds to
+ * theCoordsList.
+ * \param theWorkingPlane 9 double values, defining origin,
+ * OZ and OX directions of the working plane.
+ * \return New GEOM_Object, containing the created wire or a compound
+ * of wires.
+ */
+ GEOM_Object MakePolyline2D (in ListOfListOfDouble theCoordsList,
+ in string_array theNamesList,
+ in short_array theTypesList,
+ in ListOfBool theClosedList,
+ in ListOfDouble theWorkingPlane);
+
+ /*!
+ * \brief Create a 2D polyline (wire or a compound of wires).
+ *
+ * The polyline can have several sections. Each section represents a set
+ * of points in the form of list of coordinates of the following order:
+ * x1, y1, x2, y2, ..., xN, yN
+ * Each section has its own name, type of curve (can be either
+ * GEOM::Polyline or GEOM::Interpolation) and Closed flag.
+ * For each section a wire is created. It represents either a polyline or
+ * interpolation BSpline either closed or not depending on the Closed flag.
+ * The result represents a wire if there is only one section is defined.
+ * Otherwise a compound of wires is returned.
+ *
+ * \param theCoordsList the list of coordinates list. theCoordsList[0]
+ * is the coordinates list of the first section. theCoordsList[1]
+ * is for the second section etc.
+ * \param theNamesList the list of names. The order corresponds to
+ * theCoordsList.
+ * \param theTypesList the list of curve types. The order corresponds to
+ * theCoordsList.
+ * \param theClosedList the list of Closed flags. The order corresponds to
+ * theCoordsList.
+ * \param theWorkingPlane planar Face or LCS(Marker) of the working plane.
+ * \return New GEOM_Object, containing the created wire or a compound
+ * of wires.
+ */
+ GEOM_Object MakePolyline2DOnPlane (in ListOfListOfDouble theCoordsList,
+ in string_array theNamesList,
+ in short_array theTypesList,
+ in ListOfBool theClosedList,
+ in GEOM_Object theWorkingPlane);
+
};
// # GEOM_ILocalOperations:
GEOM_Object MakeCopy (in GEOM_Object theOriginal);
/*!
+ * \brief Deprecated method. Use Export<FormatName> (from the
+ * corresponding plugin) instead; here <FormatName> is a name of format.
+ *
* \brief Export the given shape into a file with given name.
* \param theObject Shape to be stored in the file.
* \param theFileName Name of the file to store the given shape in.
* \param theFormatName Specify format for the shape storage.
- * Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
*/
void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
/*!
- * \brief Import a shape from the BRep or IGES or STEP file
+ * \brief Deprecated method. Use Import<FormatName> (from the
+ * corresponding plugin) instead; here <FormatName> is a name of format.
+ *
+ * \brief Import a shape from the STL, BREP, IGES or STEP file
* (depends on given format) with given name.
* \param theFileName The file, containing the shape.
* \param theFormatName Specify format for the file reading.
- * Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
* If format 'IGES_SCALE' is used instead of 'IGES' or
* format 'STEP_SCALE' is used instead of 'STEP',
* file length unit will be ignored (set to 'meter') and result model will be scaled.
* \return List of GEOM_Object, containing the created shape and groups of materials.
*/
- ListOfGO ImportFile (in string theFileName, in string theFormatName);
+ ListOfGBO ImportFile (in string theFileName, in string theFormatName);
/*!
+ * \brief Deprecated method. Use ReadValue (from the corresponding plugin) instead.
+ *
* \brief Read a value of parameter from a file, containing a shape.
* \param theFileName The file, containing the shape.
* \param theFormatName Specify format for the file reading.
- * Available formats can be obtained with <VAR>ImportTranslators()</VAR> method.
* \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
* to obtain length units, in which the file is written.
* \return Value of requested parameter in form of text string.
*/
string ReadValue (in string theFileName, in string theFormatName, in string theParameterName);
- /*!
- * \brief Get the supported import formats and corresponding patterns for File dialog.
- * \param theFormats Output. List of formats, available for import.
- * \param thePatterns Output. List of file patterns, corresponding to available formats.
- * \return Returns available formats and patterns through the arguments.
- */
- void ImportTranslators (out string_array theFormats,
- out string_array thePatterns);
-
- /*!
- * \brief Get the supported export formats and corresponding patterns for File dialog.
- * \param theFormats Output. List of formats, available for export.
- * \param thePatterns Output. List of file patterns, corresponding to available formats.
- * \return Returns available formats and patterns through the arguments.
- */
- void ExportTranslators (out string_array theFormats,
- out string_array thePatterns);
-
/*!
* \brief Read a shape from the binary stream, containing its bounding representation (BRep).
* \note GEOM_Object::GetShapeStream() method can be used to obtain the shape's BRep stream.
* \return list of all texture IDs avaiable for the current study
*/
ListOfLong GetAllTextures();
-
- /*!
- * Export a shape to XAO format
- * \param shape The shape to export
- * \param groups The list of groups to export
- * \param fields The list of fields to export
- * \param author The author of the export
- * \param fileName The name of the file to export
- * \return boolean indicating if export was successful.
- */
- boolean ExportXAO(in GEOM_Object shape,
- in ListOfGO groups, in ListOfFields fields,
- in string author, in string fileName);
- /*!
- * Import a shape from XAO format
- * \param fileName The name of the file to import
- * \param shape The imported shape
- * \param subShapes The list of imported subShapes
- * \param groups The list of imported groups
- * \param fields The list of imported fields
- * \return boolean indicating if import was successful.
- */
- boolean ImportXAO(in string fileName, out GEOM_Object shape,
- out ListOfGO subShapes, out ListOfGO groups, out ListOfFields fields);
};
// # GEOM_IKindOfShape:
ListOfLong GetObjects (in GEOM_Object theGroup);
};
- // # GEOM_IAdvancedOperations:
- /*!
- * \brief Interface for advanced modeling functions.
- */
- interface GEOM_IAdvancedOperations : GEOM_IOperations
- {
- // T-Shape WITHOUT Thickness reduction
-
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- *
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeChamfer (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theH, in double theW, in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A chamfer is created on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theH, in double theW, in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A fillet is created on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRF, in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A fillet is created on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRF, in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
-
- // T-Shape WITH Thickness reduction
-
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTR (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTRWithPosition
- (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- *
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTRChamfer
- (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in double theH, in double theW, in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A chamfer is created on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTRChamferWithPosition
- (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in double theH, in double theW, in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A fillet is created on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTRFillet
- (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in double theRF, in boolean theHexMesh);
- /*!
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- *
- * A fillet is created on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- *
- * \param theRL Internal radius of left thickness reduction
- * \param theWL Width of left thickness reduction
- * \param theLtransL Length of left transition part
- * \param theLthinL Length of left thin part
- *
- * \param theRR Internal radius of right thickness reduction
- * \param theWR Width of right thickness reduction
- * \param theLtransR Length of right transition part
- * \param theLthinR Length of right thin part
- *
- * \param theRI Internal radius of incident thickness reduction
- * \param theWI Width of incident thickness reduction
- * \param theLtransI Length of incident transition part
- * \param theLthinI Length of incident thin part
- *
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true)
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Object, containing the created shape and propagation groups.
- */
- ListOfGO MakePipeTShapeTRFilletWithPosition
- (in double theR1, in double theW1, in double theL1,
- in double theR2, in double theW2, in double theL2,
- in double theRL, in double theWL, in double theLtransL, in double theLthinL,
- in double theRR, in double theWR, in double theLtransR, in double theLthinR,
- in double theRI, in double theWI, in double theLtransI, in double theLthinI,
- in double theRF, in boolean theHexMesh,
- in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3);
-
- /*!
- * This function allows to create a disk already divided into blocks. It
- * can be use to create divided pipes for later meshing in hexaedra.
- * \param theR Radius of the disk
- * \param theRatio Relative size of the central square diagonal against the disk diameter
- * \param theOrientation Plane on which the disk will be built
- * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- * \return New GEOM_Object, containing the created shape.
- */
- GEOM_Object MakeDividedDisk (in double theR,
- in double theRatio,
- in short theOrientation,
- in pattern thePattern);
-
- /*!
- * \brief Create a Disk prepared for hexa meshing with given center, normal vector and radius.
- * \param thePnt disk center.
- * \param theVec Vector, normal to the plane of the disk.
- * \param theR Disk radius.
- * \param theRatio Relative size of the central square diagonal against the disk diameter
- * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- * \return New GEOM_Object, containing the created disk.
- */
- GEOM_Object MakeDividedDiskPntVecR ( in GEOM_Object thePnt,
- in GEOM_Object theVec,
- in double theR,
- in double theRatio,
- in pattern thePattern);
-
- /*!
- * Builds a cylinder prepared for hexa meshes
- * \param theR Radius of the cylinder
- * \param theH Height of the cylinder
- * \param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- * \return New GEOM_Object, containing the created shape.
- */
- GEOM_Object MakeDividedCylinder (in double theR,
- in double theH,
- in pattern thePattern );
- /*!
- *
- * Create a smoothing surface from a set of points
- * \param thelPoints list of points. Compounds of points are accepted as well.
- * \param theNbMax maximum number of Bezier pieces in the resulting surface.
- * \param theDegMax maximum degree of the resulting BSpline surface
- * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
- * \return New GEOM_Object, containing the created shape.
- */
- GEOM_Object MakeSmoothingSurface (in ListOfGO thelPoints,
- in long theNbMax,
- in long theDegMax,
- in double theDMax);
-
- /*@@ insert new functions before this line @@ do not remove this line @@*/
- };
-
- // # GEOM_IFieldOperations:
+ // # GEOM_IFieldOperations:
/*!
* \brief Interface for field operation.
*/
void Move( in object_list what,
in SALOMEDS::SObject where,
in long row );
+
+ /*!
+ * \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);
+
+ /*!
+ * \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);
+
};
};
#define __GEOM_SUPERV__
#include "GEOM_Gen.idl"
+#include "AdvancedGEOM.idl"
module GEOM
{
in double theHeight) ;
GEOM_Object MakeCylinderRH (in double theR,
in double theH) ;
+ GEOM_Object MakeCylinderPntVecRHA (in GEOM_Object thePnt,
+ in GEOM_Object theAxis,
+ in double theRadius,
+ in double theHeight,
+ in double theAngle) ;
+ GEOM_Object MakeCylinderRHA (in double theR,
+ in double theH,
+ in double theA) ;
GEOM_Object MakeSphere (in double theX,
in double theY,
in double theZ,
GEOM_Object MakeCopy (in GEOM_Object theOriginal) ;
void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName) ;
GEOM_Object ImportFile (in string theFileName, in string theFormatName) ;
- void ImportTranslators (out string_array theFormats,
- out string_array thePatterns) ;
- void ExportTranslators (out string_array theFormats,
- out string_array thePatterns) ;
- boolean ExportXAO(in GEOM_Object shape,
- in ListOfGO groups, in ListOfFields fields,
- in string author, in string fileName);
- boolean ImportXAO(in string fileName, out GEOM_Object shape,
- out ListOfGO subShapes, out ListOfGO groups, out ListOfFields fields);
//-----------------------------------------------------------//
// TransformOperations //
in pattern thePattern);
GEOM_Object MakeSmoothingSurface (in GEOM_List thelPoints);
+
+ //-----------------------------------------------------------//
+ // Import/Export Operations //
+ //-----------------------------------------------------------//
+ void ExportSTL( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in boolean theIsASCII,
+ in double theDeflection,
+ in boolean theIsRelative );
+ GEOM_Object ImportSTL( in string theFileName );
+
+ void ExportBREP( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+ GEOM_Object ImportBREP( in string theFileName );
+
+ void ExportSTEP( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+ GEOM_Object ImportSTEP( in string theFileName,
+ in boolean theIsIgnoreUnits );
+
+ void ExportIGES( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in string theVersion );
+ GEOM_Object ImportIGES( in string theFileName,
+ in boolean theIsIgnoreUnits );
+
+ boolean ExportXAO( in GEOM_Object shape,
+ in ListOfGO groups,
+ in ListOfFields fields,
+ in string author,
+ in string fileName );
+ boolean ImportXAO( in string fileName,
+ out GEOM_Object shape,
+ out ListOfGO subShapes,
+ out ListOfGO groups,
+ out ListOfFields fields );
+
+ void ExportVTK( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in double theDeflection );
/*@@ insert new functions before this line @@ do not remove this line @@*/
};
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __IGESPlugin_IDL__
+#define __IGESPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for IGESPlugin modeling functions.
+ */
+ interface IIGESOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in IGES format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ * \param theVersion Version of IGES format which defines, whether to write
+ * only faces (5.1 IGES format) or shells and solids also (5.3 IGES format).
+ */
+ void ExportIGES( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in string theVersion );
+
+ /*!
+ * \brief Import a shape from the IGES file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+ * and result model will be scaled, if its units are not meters.
+ * If False (default), file length units will be taken into account.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportIGES( in string theFileName,
+ in boolean theIsIgnoreUnits );
+
+ /*!
+ * \brief Read a value of parameter from a file, containing a shape.
+ * \param theFileName The file, containing the shape.
+ * \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
+ * to obtain length units, in which the file is written.
+ * \return Value of requested parameter in form of text string.
+ */
+ string ReadValue( in string theFileName, in string theParameterName);
+ };
+};
+
+#endif // __IGESPlugin_IDL__
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __STEPPlugin_IDL__
+#define __STEPPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for STEPPlugin modeling functions.
+ */
+ interface ISTEPOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in STEP format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ */
+ void ExportSTEP( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+
+ /*!
+ * \brief Import a shape from the STEP file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+ * and result model will be scaled, if its units are not meters.
+ * If False (default), file length units will be taken into account.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportSTEP( in string theFileName,
+ in boolean theIsIgnoreUnits );
+
+ /*!
+ * \brief Read a value of parameter from a file, containing a shape.
+ * \param theFileName The file, containing the shape.
+ * \param theParameterName Specify the parameter. For example, pass "LEN_UNITS"
+ * to obtain length units, in which the file is written.
+ * \return Value of requested parameter in form of text string.
+ */
+ string ReadValue( in string theFileName,
+ in string theParameterName );
+
+ };
+};
+
+#endif // __STEPPlugin_IDL__
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __STLPlugin_IDL__
+#define __STLPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for STLPlugin modeling functions.
+ */
+ interface ISTLOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in STL format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ * \param theIsASCII The format of the exported file (ASCII or Binary).
+ * \param theDeflection Deflection of the given shape.
+ * \param theIsRelative Mode for writing the file. If True (default value), the
+ * deflection is calculated from the relative size of the
+ * shape; if False, the user defined deflection is used.
+ */
+ void ExportSTL( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in boolean theIsASCII,
+ in double theDeflection,
+ in boolean theIsRelative );
+
+ /*!
+ * \brief Import a shape from the STL file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportSTL( in string theFileName );
+ };
+};
+
+#endif // __STLPlugin_IDL__
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __VTKPlugin_IDL__
+#define __VTKPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for VTKPlugin modeling functions.
+ */
+ interface IVTKOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in VTK format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ * \param theDeflection Deflection of the given shape.
+ */
+ void ExportVTK( in GEOM::GEOM_Object theObject,
+ in string theFileName,
+ in double theDeflection );
+ };
+};
+
+#endif // __VTKPlugin_IDL__
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __XAOPlugin_IDL__
+#define __XAOPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module GEOM
+{
+ /*!
+ * \brief Interface for XAOPlugin modeling functions.
+ */
+ interface IXAOOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * Export a shape to XAO format
+ * \param shape The shape to export
+ * \param groups The list of groups to export
+ * \param fields The list of fields to export
+ * \param author The author of the export
+ * \param fileName The name of the file to export
+ * \return boolean indicating if export was successful.
+ */
+ boolean ExportXAO( in GEOM::GEOM_Object shape,
+ in GEOM::ListOfGO groups,
+ in GEOM::ListOfFields fields,
+ in string author,
+ in string fileName );
+
+ /*!
+ * Import a shape from XAO format
+ * \param fileName The name of the file to import
+ * \param shape The imported shape
+ * \param subShapes The list of imported subShapes
+ * \param groups The list of imported groups
+ * \param fields The list of imported fields
+ * \return boolean indicating if import was successful.
+ */
+ boolean ImportXAO( in string fileName,
+ out GEOM::GEOM_Object shape,
+ out GEOM::ListOfGO subShapes,
+ out GEOM::ListOfGO groups,
+ out GEOM::ListOfFields fields );
+ };
+};
+
+#endif // __XAOPlugin_IDL__
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+ CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="AdvancedGEOM"
+ server-lib="AdvancedEngine"
+ gui-lib="AdvancedGUI">
+ <actions>
+ <action label="TShape_Basic"
+ icon="pipetshape.png"
+ menu="NEW_ENTITY/PRIMITIVES/PIPETSHAPE"
+ tooltip="PRIMITIVES/PIPETSHAPE"
+ status-bar="PIPETSHAPE">
+ </action>
+ <action label="DividedDisk"
+ icon="divided_disk.png"
+ menu="NEW_ENTITY/BLOCKS/DIVIDEDDISK"
+ tooltip="BLOCKS/DIVIDEDDISK"
+ status-bar="DIVIDEDDISK">
+ </action>
+ <action label="DividedCylinder"
+ icon="dividedcylinder.png"
+ menu="NEW_ENTITY/BLOCKS/DIVIDEDCYLINDER"
+ tooltip="BLOCKS/DIVIDEDCYLINDER"
+ status-bar="DIVIDEDCYLINDER">
+ </action>
+ <action label="SmoothingSurface"
+ icon="smoothingsurface.png"
+ menu="NEW_ENTITY/ADVANCED/SMOOTHINGSURFACE"
+ tooltip="ADVANCED/SMOOTHINGSURFACE"
+ status-bar="SMOOTHINGSURFACE">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="BREPPlugin"
+ server-lib="BREPPluginEngine"
+ gui-lib="BREPPluginGUI">
+ <actions>
+ <action label="Import_BREP"
+ menu="FILE/IMPORT:10/IMPORTBREP"
+ status-bar="IMPORTBREP"
+ accel="Ctrl+I">
+ </action>
+ <action label="Export_BREP"
+ menu="FILE/EXPORT:10/EXPORTBREP"
+ status-bar="EXPORTBREP"
+ accel="Ctrl+E">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
# These files are data, module or lib files
SET( _res_files
- GEOMActions.xml
+ AdvancedGEOM.xml
+ STLPlugin.xml
+ BREPPlugin.xml
+ STEPPlugin.xml
+ IGESPlugin.xml
+ XAOPlugin.xml
+ VTKPlugin.xml
GEOM_en.xml
GEOM_fr.xml
GEOM.config
GEOMDS_Resources
- ImportExport
ShHealing
3dsketch.png
isoline.png
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii'?>
-<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
-<!--
- Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
--->
-
-<!-- GUI customization for GEOM component -->
-
-<geom-plugins>
-
- <geom-plugin name="AdvancedGUI"
- server-lib="AdvancedEngine"
- gui-lib="AdvancedGUI">
- <actions>
- <action label="TShape_Basic"
- icon="pipetshape.png"
- menu="NEW_ENTITY/PRIMITIVES/PIPETSHAPE"
- tooltip="PRIMITIVES/PIPETSHAPE"
- status-bar="PIPETSHAPE">
- </action>
- <action label="DividedDisk"
- icon="divided_disk.png"
- menu="NEW_ENTITY/BLOCKS/DIVIDEDDISK"
- tooltip="BLOCKS/DIVIDEDDISK"
- status-bar="DIVIDEDDISK">
- </action>
- <action label="DividedCylinder"
- icon="dividedcylinder.png"
- menu="NEW_ENTITY/BLOCKS/DIVIDEDCYLINDER"
- tooltip="BLOCKS/DIVIDEDCYLINDER"
- status-bar="DIVIDEDCYLINDER">
- </action>
- <action label="SmoothingSurface"
- icon="smoothingsurface.png"
- menu="NEW_ENTITY/ADVANCED/SMOOTHINGSURFACE"
- tooltip="ADVANCED/SMOOTHINGSURFACE"
- status-bar="SMOOTHINGSURFACE">
- </action>
- </actions>
- </geom-plugin>
-
-</geom-plugins>
<!-- XML component catalog -->
<begin-catalog>
-<!-- Path prefix information -->
+ <!-- Path prefix information -->
+ <path-prefix-list>
+ </path-prefix-list>
-<path-prefix-list>
-</path-prefix-list>
+ <!-- Geom data types -->
+ <type-list>
+ <!-- From GEOM_Gen.idl -->
+ <objref name="GEOM/GEOM_Gen" id="IDL:GEOM/GEOM_Gen:1.0" />
+ <objref name="GEOM/GEOM_BaseObject" id="IDL:GEOM/GEOM_BaseObject:1.0" />
+ <objref name="GEOM/GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0">
+ <base>GEOM/GEOM_BaseObject</base>
+ </objref>
+ <objref name="GEOM/GEOM_Field" id="IDL:GEOM/GEOM_Field:1.0">
+ <base>GEOM/GEOM_BaseObject</base>
+ </objref>
+ <objref name="GEOM/GEOM_FieldStep" id="IDL:GEOM/GEOM_FieldStep:1.0">
+ <base>GEOM/GEOM_BaseObject</base>
+ </objref>
+ <objref name="GEOM/GEOM_BoolFieldStep" id="IDL:GEOM/GEOM_BoolFieldStep:1.0">
+ <base>GEOM/GEOM_FieldStep</base>
+ </objref>
+ <objref name="GEOM/GEOM_IntFieldStep" id="IDL:GEOM/GEOM_IntFieldStep:1.0">
+ <base>GEOM/GEOM_FieldStep</base>
+ </objref>
+ <objref name="GEOM/GEOM_DoubleFieldStep" id="IDL:GEOM/GEOM_DoubleFieldStep:1.0">
+ <base>GEOM/GEOM_FieldStep</base>
+ </objref>
+ <objref name="GEOM/GEOM_StringFieldStep" id="IDL:GEOM/GEOM_StringFieldStep:1.0">
+ <base>GEOM/GEOM_FieldStep</base>
+ </objref>
+ <objref name="GEOM/GEOM_IOperations" id="IDL:GEOM/GEOM_IOperations:1.0" />
+ <objref name="GEOM/GEOM_IBasicOperations" id="IDL:GEOM/GEOM_IBasicOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_ITransformOperations" id="IDL:GEOM/GEOM_ITransformOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_I3DPrimOperations" id="IDL:GEOM/GEOM_I3DPrimOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IShapesOperations" id="IDL:GEOM/GEOM_IShapesOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IBlocksOperations" id="IDL:GEOM/GEOM_IBlocksOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IBooleanOperations" id="IDL:GEOM/GEOM_IBooleanOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_ICurvesOperations" id="IDL:GEOM/GEOM_ICurvesOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_ILocalOperations" id="IDL:GEOM/GEOM_ILocalOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IHealingOperations" id="IDL:GEOM/GEOM_IHealingOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IInsertOperations" id="IDL:GEOM/GEOM_IInsertOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IMeasureOperations" id="IDL:GEOM/GEOM_IMeasureOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IGroupOperations" id="IDL:GEOM/GEOM_IGroupOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IFieldOperations" id="IDL:GEOM/GEOM_IFieldOperations:1.0">
+ <base>GEOM/GEOM_IOperations</base>
+ </objref>
+ <objref name="GEOM/GEOM_IKindOfShape" id="IDL:GEOM/GEOM_IKindOfShape:1.0" />
+ <type name="GEOM/shape_type" kind="int" />
+ <type name="GEOM/marker_type" kind="int" />
+ <type name="GEOM/marker_size" kind="int" />
+ <type name="GEOM/shape_state" kind="int" />
+ <type name="GEOM/find_shape_method" kind="int" />
+ <type name="GEOM/filling_oper_method" kind="int" />
+ <type name="GEOM/curve_type" kind="int" />
+ <type name="GEOM/field_data_type" kind="int" />
+ <struct name="GEOM/Parameter">
+ <member name="name" type="string" />
+ <member name="value" type="string" />
+ </struct>
+ <sequence name="GEOM/Parameters" content="GEOM/Parameter" />
+ <struct name="GEOM/CreationInformation">
+ <member name="operationName" type="string" />
+ <member name="params" type="GEOM/Parameters" />
+ </struct>
+ <sequence name="GEOM/string_array" content="string" />
+ <sequence name="GEOM/short_array" content="short" />
+ <sequence name="GEOM/ListOfBool" content="boolean" />
+ <sequence name="GEOM/ListOfLong" content="long" />
+ <sequence name="GEOM/ListOfDouble" content="double" />
+ <sequence name="GEOM/ListOfGO" content="GEOM/GEOM_Object" />
+ <sequence name="GEOM/ListOfGBO" content="GEOM/GEOM_BaseObject" />
+ <sequence name="GEOM/ListOfFields" content="GEOM/GEOM_Field" />
+ <sequence name="GEOM/object_list" content="SObject" />
+ <type name="GEOM/BCErrorType" kind="int" />
+ <struct name="GEOM/BCError" >
+ <member name="error" type="GEOM/BCErrorType" />
+ <member name="incriminated" type="GEOM/ListOfLong" />
+ </struct>
+ <sequence name="GEOM/BCErrors" content="GEOM/BCError" />
+ <type name="GEOM/shape_kind" kind="int" />
+ <type name="GEOM/ShapeErrorType" kind="int" />
+ <struct name="GEOM/ShapeError">
+ <member name="error" type="GEOM/ShapeErrorType" />
+ <member name="incriminated" type="GEOM/ListOfLong" />
+ </struct>
+ <sequence name="GEOM/ShapeError" content="GEOM/ShapeErrors" />
-<!-- Geom data types -->
-<type-list>
- <type name="BCErrorType" kind="int"/>
- <objref name="GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0" />
- <objref name="GEOM_List" id="IDL:GEOM/GEOM_List:1.0" />
- <objref name="GEOM_Gen" id="IDL:GEOM/GEOM_Gen:1.0" />
- <objref name="GEOM_Shape" id="IDL:GEOM/GEOM_Object:1.0" />
- <objref name="GEOM_Superv" id="IDL:GEOM/GEOM_Superv:1.0" />
- <objref name="GEOM_IBasicOperations" id="IDL:GEOM/GEOM_IBasicOperations:1.0" />
- <objref name="GEOM_ITransformOperations" id="IDL:GEOM/GEOM_ITransformOperations:1.0" />
- <objref name="GEOM_I3DPrimOperations" id="IDL:GEOM/GEOM_I3DPrimOperations:1.0" />
- <objref name="GEOM_IShapesOperations" id="IDL:GEOM/GEOM_IShapesOperations:1.0" />
- <objref name="GEOM_IBooleanOperations" id="IDL:GEOM/GEOM_IBooleanOperations:1.0" />
- <objref name="GEOM_ICurvesOperations" id="IDL:GEOM/GEOM_ICurvesOperations:1.0" />
- <objref name="GEOM_ILocalOperations" id="IDL:GEOM/GEOM_ILocalOperations:1.0" />
- <objref name="GEOM_IHealingOperations" id="IDL:GEOM/GEOM_IHealingOperations:1.0" />
- <objref name="GEOM_IInsertOperations" id="IDL:GEOM/GEOM_IInsertOperations:1.0" />
- <objref name="GEOM_IMeasureOperations" id="IDL:GEOM/GEOM_IMeasureOperations:1.0" />
- <objref name="GEOM_IBlocksOperations" id="IDL:GEOM/GEOM_IBlocksOperations:1.0" />
- <objref name="GEOM_IGroupOperations" id="IDL:GEOM/GEOM_IGroupOperations:1.0" />
- <objref name="GEOM_IAdvancedOperations" id="IDL:GEOM/GEOM_IAdvancedOperations:1.0" />
- <sequence name="ListOfLong" content="int" />
- <sequence name="ListOfGO" content="GEOM_Object" />
- <sequence name="ListOfBool" content="boolean" />
- <sequence name="string_array" content="string" />
- <struct name="BCError" >
- <member name="incriminated" type="ListOfLong"/>
- </struct>
- <sequence name="BCErrors" content="BCError" />
-</type-list>
+ <!-- From GEOM_Superv.idl -->
+ <objref name="GEOM/GEOM_Superv" id="IDL:GEOM/GEOM_Superv:1.0" />
+ <objref name="GEOM/GEOM_List" id="IDL:GEOM/GEOM_List:1.0" />
-<!-- Component list -->
-<component-list>
- <component>
- <!-- Component identification -->
- <component-name>GEOM</component-name>
- <component-username>Geometry</component-username>
- <component-type>Geom</component-type>
- <component-author>NRI</component-author>
- <component-version>@SALOMEGEOM_VERSION@</component-version>
- <component-comment>Geometry component</component-comment>
- <component-multistudy>1</component-multistudy>
- <component-icone>ModuleGeom.png</component-icone>
- <component-impltype>1</component-impltype>
+ <!-- From AdvancedGEOM.idl -->
+ <type name="GEOM/pattern" kind="int" />
+ <objref name="GEOM/IAdvancedOperations" id="IDL:GEOM/IAdvancedOperations:1.0" />
+
+ <!-- From BREPPlugin.idl -->
+ <objref name="GEOM/IBREPOperations" id="IDL:GEOM/IBREPOperations:1.0" />
+
+ <!-- From IGESPlugin.idl -->
+ <objref name="GEOM/IIGESOperations" id="IDL:GEOM/IIGESOperations:1.0" />
+
+ <!-- From STEPPlugin.idl -->
+ <objref name="GEOM/ISTEPOperations" id="IDL:GEOM/ISTEPOperations:1.0" />
- <!-- component interface list -->
- <component-interface-list>
- <!-- component interface identification -->
- <component-interface-name>GEOM</component-interface-name>
- <component-interface-comment>No comment</component-interface-comment>
+ <!-- From STLPlugin.idl -->
+ <objref name="GEOM/ISTLOperations" id="IDL:GEOM/ISTLOperations:1.0" />
- <!-- Component service list-->
- <component-service-list>
- <component-service>
- <!-- service-identification -->
- <service-name>Undo</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list></outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>Redo</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list></outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>AddInStudy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFather</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>SObject</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIBasicOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IBasicOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetITransformOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_ITransformOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetI3DPrimOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_I3DPrimOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIShapesOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IShapesOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIBooleanOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IBooleanOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetICurvesOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_ICurvesOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetILocalOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_ILocalOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIHealingOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IHealingOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIInsertOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IInsertOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIMeasureOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IMeasureOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIBlocksOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IBlocksOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIGroupOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IGroupOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIAdvancedOperations</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_IAdvancedOperations</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>RemoveObject</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list></outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetObject</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyID</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEntry</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>AddSubShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theMainShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theIndices</inParameter-name>
- <inParameter-type>ListOfLong</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetIORFromString</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>ior</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <!-- service-identification -->
- <service-name>GetStringFromIOR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment></service-comment>
- <service-by-default>1</service-by-default>
- <!-- service-connexion -->
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment></inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>string</outParameter-type>
- <outParameter-comment></outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetDumpName</service-name>
- <service-author></service-author>
- <service-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>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>string</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetAllDumpNames</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>string_array</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- </component-service-list>
- </component-interface-list>
- <constraint>hostname = localhost</constraint>
+ <!-- From BTKPlugin.idl -->
+ <objref name="GEOM/IVTKOperations" id="IDL:GEOM/IVTKOperations:1.0" />
+
+ <!-- From XAOPlugin.idl -->
+ <objref name="GEOM/IXAOOperations" id="IDL:GEOM/IXAOOperations:1.0" />
+ </type-list>
+
+ <!-- Component list -->
+ <component-list>
+ <component>
+ <!-- Component: GEOM -->
+ <!-- Component identification -->
+ <component-name>GEOM</component-name>
+ <component-username>Geometry</component-username>
+ <component-type>GEOM</component-type>
+ <component-author>SALOME team</component-author>
+ <component-version>@SALOMEGEOM_VERSION@</component-version>
+ <component-comment>CAD modeler</component-comment>
+ <component-multistudy>1</component-multistudy>
+ <component-icone>ModuleGeom.png</component-icone>
+ <component-impltype>1</component-impltype>
+ <constraint></constraint>
+ <!-- component interface list -->
+ <component-interface-list>
+ <!-- component interface identification -->
+ <component-interface-name>GEOM/GEOM_Gen</component-interface-name>
+ <component-interface-comment>GEOM module engine</component-interface-comment>
+ <!-- interface services list -->
+ <component-service-list>
+ <component-service>
+ <service-name>Undo</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>Redo</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>AddInStudy</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>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>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFather</inParameter-name>
+ <inParameter-type>GEOM/GEOM_BaseObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>SObject</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RestoreSubShapesO</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>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>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theArgs</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFindMethod</inParameter-name>
+ <inParameter-type>GEOM/find_shape_method</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theInheritFirstArg</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAddPrefix</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RestoreGivenSubShapesO</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>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>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theArgs</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFindMethod</inParameter-name>
+ <inParameter-type>GEOM/find_shape_method</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theInheritFirstArg</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAddPrefix</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RestoreSubShapesSO</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>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>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theArgs</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFindMethod</inParameter-name>
+ <inParameter-type>GEOM/find_shape_method</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theInheritFirstArg</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAddPrefix</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIBasicOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IBasicOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetITransformOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_ITransformOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetI3DPrimOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_I3DPrimOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIShapesOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IShapesOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIBooleanOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IBooleanOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetICurvesOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_ICurvesOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetILocalOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_ILocalOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIHealingOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IHealingOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIInsertOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IInsertOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIMeasureOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IMeasureOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIBlocksOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IBlocksOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIGroupOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IGroupOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIFieldOperations</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>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IFieldOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetPluginOperations</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>
+ <inParameter-name>theLibName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_IOperations</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RemoveObject</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_BaseObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetObject</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>
+ <inParameter-name>theEntry</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_BaseObject</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>AddSubShape</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>theMainShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIndices</inParameter-name>
+ <inParameter-type>GEOM/ListOfLong</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetIORFromString</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>theIOR</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetStringFromIOR</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>string</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetDumpName</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>theStudyEntry</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>string</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetAllDumpNames</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-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/string_array</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>PublishNamedShapesInStudy</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>theStudy</inParameter-name>
+ <inParameter-type>Study</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theObject</inParameter-name>
+ <inParameter-type>Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>CreateFolder</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>theName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFather</inParameter-name>
+ <inParameter-type>SObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>SObject</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MoveToFolder</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFolder</inParameter-name>
+ <inParameter-type>SObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MoveListToFolder</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>theListOfGO</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFolder</inParameter-name>
+ <inParameter-type>SObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>Move</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>what</inParameter-name>
+ <inParameter-type>GEOM/object_list</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>where</inParameter-name>
+ <inParameter-type>SObject</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>row</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-list>
+ </component-interface-list>
</component>
-
+
<component>
- <component-name>GEOM_Superv</component-name>
- <component-username>GEOM_Superv</component-username>
- <component-type>OTHER</component-type>
- <component-author></component-author>
- <component-version>@SALOMEGEOM_VERSION@</component-version>
- <component-comment>Supervision wrapper for Geometry component</component-comment>
- <component-multistudy>1</component-multistudy>
- <component-impltype>1</component-impltype>
- <component-icone></component-icone>
- <constraint></constraint>
- <component-interface-list>
- <component-interface-name>GEOM_Superv</component-interface-name>
- <component-interface-comment>unknown</component-interface-comment>
- <component-service-list>
- <component-service>
- <service-name>SetStudyID</service-name>
- <service-author></service-author>
- <service-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></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>AddItemToListOfGO</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theList</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>theList</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>CreateListOfLong</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>AddItemToListOfLong</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theList</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>theList</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>CreateListOfDouble</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>AddItemToListOfDouble</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theList</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>theList</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePointXYZ</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePointWithReference</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theReference</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePointOnCurve</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theRefCurve</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParameter</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeTangentOnCurve</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theRefCurve</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParameter</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeVectorDXDYDZ</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeVectorTwoPnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeLineTwoPnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePlaneThreePnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTrimSize</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePlanePntVec</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTrimSize</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePlaneFace</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFace</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTrimSize</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeMarker</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theOX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theOY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theOZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theXDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theXDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theXDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theYDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theYDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theYDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeTangentPlaneOnFace</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFace</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParameterU</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParameterV</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTrimSize</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeBox</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theX1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theX2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeBoxDXDYDZ</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeBoxTwoPnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCylinderPntVecRH</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRadius</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHeight</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCylinderRH</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theH</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSphere</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRadius</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSphereR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSpherePntR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeTorusPntVecRR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMajor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMinor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeTorusRR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theRMajor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMinor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeConePntVecR1R2H</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHeight</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeConeR1R2H</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHeight</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePrismVecH</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBase</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theH</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePrismTwoPnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBase</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipe</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBase</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePath</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeRevolutionAxisAngle</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBase</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAngle</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFilling</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMinDeg</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMaxDeg</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTol2D</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTol3D</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbIter</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeThruSections</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theSeqSections</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theModeSolid</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePreci</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRuled</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeWithDifferentSections</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theSeqBases</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theLocations</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePath</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWithContact</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWithCorrection</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeWithShellSections</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theSeqBases</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theSeqSubBases</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theLocations</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePath</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWithContact</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWithCorrection</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeBoolean</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShape2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theOperation</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFuse</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShape2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCut</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShape2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCommon</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShape2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSection</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShape2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePartition</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShapes</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTools</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theKeepInside</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRemoveInside</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theLimit</inParameter-name>
- <inParameter-type>short</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRemoveWebs</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMaterials</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theKeepNonlimitShapes</inParameter-name>
- <inParameter-type>short</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeHalfPartition</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePlane</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theOriginal</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>Export</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFileName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFormatName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list></outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>Import</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFileName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFormatName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ImportTranslators</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>theFormats</outParameter-name>
- <outParameter-type>string_array</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- <outParameter>
- <outParameter-name>thePatterns</outParameter-name>
- <outParameter-type>string_array</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ExportTranslators</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list></inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>theFormats</outParameter-name>
- <outParameter-type>string_array</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- <outParameter>
- <outParameter-name>thePatterns</outParameter-name>
- <outParameter-type>string_array</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateTwoPoints</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateTwoPointsCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateDXDYDZ</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateDXDYDZCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateVector</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>TranslateVectorCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MultiTranslate1D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStep</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MultiTranslate2D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStep1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes1</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStep2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes2</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>Rotate</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAngle</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>RotateCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAngle</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>RotateThreePoints</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theCentPoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>RotateThreePointsCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theCentPoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MultiRotate1D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MultiRotate2D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAngle</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes1</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStep</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes2</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorPlane</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePlane</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorPlaneCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePlane</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorAxis</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorAxisCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theAxis</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorPoint</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MirrorPointCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>OffsetShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theOffset</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>OffsetShapeCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theOffset</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ScaleShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFactor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ScaleShapeCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFactor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>PositionShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStartLCS</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEndLCS</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>PositionShapeCopy</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theObject</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theStartLCS</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEndLCS</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeEdge</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeWire</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theEdgesAndWires</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFace</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theWire</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>isPlanarWanted</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFaceWires</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theWires</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>isPlanarWanted</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeShell</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFacesAndShells</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSolidShell</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShell</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSolidShells</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShells</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCompound</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShapes</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeGlueFaces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTolerance</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>doKeepNonSolids</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetGlueFaces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTolerance</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeGlueFacesByList</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theTolerance</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFaces</inParameter-name>
- <inParameter-type>ListOfGO</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>doKeepNonSolids</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeExplode</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShapeType</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>isSorted</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>NumberOfFaces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>NumberOfEdges</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ChangeOrientation</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeQuad4Vertices</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt4</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeQuad</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theEdge1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge4</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeQuad2Edges</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theEdge1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeHexa</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFace1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace4</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace5</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace6</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeHexa2Faces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFace1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetPoint</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theX</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theY</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theZ</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEpsilon</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetEdge</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetEdgeNearPoint</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetFaceByPoints</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint4</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetFaceByEdges</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdge2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetOppositeFace</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBlock</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetFaceNearPoint</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetFaceByNormale</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBlock</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVector</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>IsCompoundOfBlocks</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMinNbFaces</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMaxNbFaces</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>boolean</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- <outParameter>
- <outParameter-name>theNbBlocks</outParameter-name>
- <outParameter-type>long</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>CheckCompoundOfBlocks</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>boolean</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- <outParameter>
- <outParameter-name>theErrors</outParameter-name>
- <outParameter-type>BCErrors</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>PrintBCErrors</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theErrors</inParameter-name>
- <inParameter-type>BCErrors</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>string</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>ExplodeCompoundOfBlocks</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMinNbFaces</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMaxNbFaces</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetBlockNearPoint</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePoint</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetBlockByParts</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParts</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetBlocksByParts</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCompound</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theParts</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeMultiTransformation1D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBlock</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace1</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace2</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimes</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeMultiTransformation2D</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theBlock</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace1U</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace2U</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimesU</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace1V</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theDirFace2V</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theNbTimesV</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCirclePntVecR</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeCircleThreePnt</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeEllipse</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMajor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMinor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeEllipseVec</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVec</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMajor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRMinor</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theVecMaj</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeArc</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeArcCenter</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCenter</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theSense</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeArcOfEllipse</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePnt1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thePnt3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePolyline</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePoints</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSplineBezier</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePoints</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSplineInterpolation</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thePoints</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSketcher</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theCommand</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWorkingPlane</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFilletAll</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFilletEdges</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theEdges</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeFilletFaces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFaces</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeChamferAll</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theD</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeChamferEdge</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theD1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theD2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace1</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFace2</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeChamferFaces</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theD1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theD2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theFaces</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeArchimede</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWeight</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theWaterDensity</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theMeshDeflection</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetSubShapeIndex</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theSubShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>CreateGroup</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theMainShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theShapeType</inParameter-name>
- <inParameter-type>long</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>AddObject</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theGroup</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theSubShapeId</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>RemoveObject</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theGroup</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theSubShapeId</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>GetType</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theGroup</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetMainShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theGroup</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>GetObjects</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theGroup</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
-
- <component-service>
- <service-name>MakePipeTShape</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeTShapeWithPosition</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeTShapeChamfer</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theH</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeTShapeChamferWithPosition</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theH</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
-
-
- <component-service>
- <service-name>MakePipeTShapeFillet</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRF</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakePipeTShapeFilletWithPosition</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL1</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theR2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theW2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theL2</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRF</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theHewMesh</inParameter-name>
- <inParameter-type>boolean</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP1</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP2</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theP3</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_List</outParameter-type>
- <outParameter-comment>unknown</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeDividedDisk</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>Radius of the disk</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theRatio</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>Relative size of the central square diagonal against the disk diameter</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>Result object</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeDividedCylinder</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theR</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>Radius of the cylinder</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theH</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>Height of the cylinder</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>Result object</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeSmoothingSurface</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>thelPoints</inParameter-name>
- <inParameter-type>double</inParameter-type>
- <inParameter-comment>list of points</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>GEOM_Object</outParameter-type>
- <outParameter-comment>Result object</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <component-service>
- <service-name>MakeExportXAO</service-name>
- <service-author></service-author>
- <service-version></service-version>
- <service-comment>unknown</service-comment>
- <service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theFileName</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>The name of the exported file</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>theExportingShape</inParameter-name>
- <inParameter-type>GEOM_Object</inParameter-type>
- <inParameter-comment>Shape to export</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thelGroups</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>List of groups to export</inParameter-comment>
- </inParameter>
- <inParameter>
- <inParameter-name>thelFields</inParameter-name>
- <inParameter-type>GEOM_List</inParameter-type>
- <inParameter-comment>List of fields to export</inParameter-comment>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-name>return</outParameter-name>
- <outParameter-type>bool</outParameter-type>
- <outParameter-comment>Result object</outParameter-comment>
- </outParameter>
- </outParameter-list>
- <DataStream-list></DataStream-list>
- </component-service>
- <!-- @@ insert new functions before this line @@ do not remove this line @@ -->
- </component-service-list>
- </component-interface-list>
+ <!-- Component: GEOM_Superv -->
+ <!-- Component identification -->
+ <component-name>GEOM_Superv</component-name>
+ <component-username>GEOM_Superv</component-username>
+ <component-type>GEOM</component-type>
+ <component-author></component-author>
+ <component-version>@SALOMEGEOM_VERSION@</component-version>
+ <component-comment>Supervision helper for Geometry component</component-comment>
+ <component-multistudy>1</component-multistudy>
+ <component-impltype>1</component-impltype>
+ <component-icone></component-icone>
+ <constraint></constraint>
+ <!-- component interface list -->
+ <component-interface-list>
+ <!-- component interface identification -->
+ <component-interface-name>GEOM/GEOM_Superv</component-interface-name>
+ <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>
+ <service-version>@SALOMEGEOM_VERSION@</service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list></inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>AddItemToListOfGO</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>theList</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>theList</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>CreateListOfLong</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-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>AddItemToListOfLong</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>theList</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theObject</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>theList</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>CreateListOfDouble</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-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>AddItemToListOfDouble</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>theList</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theObject</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>theList</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePointXYZ</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>theX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePointWithReference</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>theReference</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePointOnCurve</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>theRefCurve</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameter</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePointOnCurveByLength</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>theRefCurve</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLength</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStartPoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeTangentOnCurve</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>theRefCurve</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameter</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeVectorDXDYDZ</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>theDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeVectorTwoPnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeLineTwoPnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeLineTwoFaces</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>theFace1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePlaneThreePnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePlanePntVec</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePlaneFace</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>theFace</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePlane2Vec</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>theVec1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePlaneLCS</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>theLCS</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOrientation</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeMarker</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>theOX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theXDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theXDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theXDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theYDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theYDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theYDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeMarkerFromShape</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeMarkerPntTwoVec</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>theOrigin</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theXVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theYVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeTangentPlaneOnFace</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>theFace</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameterU</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameterV</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeBox</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>theX1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theX2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeBoxDXDYDZ</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>theDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeBoxTwoPnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFaceHW</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>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOrientation</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFaceObjHW</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>theObj</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeDiskPntVecR</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeDiskThreePnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeDiskR</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOrientation</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCylinderPntVecRH</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRadius</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHeight</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCylinderRH</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCylinderPntVecRHA</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRadius</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHeight</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCylinderRHA</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theA</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSphere</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>theX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRadius</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSphereR</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSpherePntR</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeTorusPntVecRR</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMajor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMinor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeTorusRR</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>theRMajor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMinor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeConePntVecR1R2H</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHeight</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeConeR1R2H</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHeight</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePrismVecH</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePrismVecH2Ways</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePrismTwoPnt</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePrismTwoPnt2Ways</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipe</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeRevolutionAxisAngle</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeRevolutionAxisAngle2Ways</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilling</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMinDeg</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMaxDeg</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTol2D</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTol3D</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbIter</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMethod</inParameter-name>
+ <inParameter-type>GEOM/filling_oper_method</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theApprox</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeThruSections</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>theSeqSections</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theModeSolid</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePreci</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRuled</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeWithDifferentSections</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>theSeqBases</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLocations</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithContact</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithCorrection</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeWithShellSections</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>theSeqBases</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSeqSubBases</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLocations</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithContact</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithCorrection</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeShellsWithoutPath</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>theSeqBases</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLocations</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeBiNormalAlongVector</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>theBase</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeBoolean</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>theShape1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOperation</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFuse</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>theShape1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCommon</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>theShape1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCut</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>theShape1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSection</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>theShape1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePartition</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>theShapes</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTools</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theKeepInside</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRemoveInside</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLimit</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRemoveWebs</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMaterials</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theKeepNonlimitShapes</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeHalfPartition</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePlane</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCopy</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>theOriginal</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>Export</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFormatName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportFile</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>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFormatName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateTwoPoints</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateTwoPointsCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateDXDYDZ</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateDXDYDZCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateVector</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateVectorCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>TranslateVectorDistance</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDistance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theCopy</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MultiTranslate1D</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStep</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MultiTranslate2D</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStep1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes1</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStep2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes2</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>Rotate</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RotateCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RotateThreePoints</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theCentPoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>RotateThreePointsCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theCentPoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MultiRotate1D</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MultiRotate2D</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes1</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStep</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes2</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorPlane</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePlane</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorPlaneCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePlane</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorAxis</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorAxisCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAxis</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorPoint</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MirrorPointCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>OffsetShape</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOffset</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>OffsetShapeCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOffset</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ScaleShape</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ScaleShapeCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ScaleShapeAlongAxes</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ScaleShapeAlongAxesCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFactorZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>PositionShape</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStartLCS</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEndLCS</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>PositionShapeCopy</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStartLCS</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEndLCS</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>PositionAlongPath</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDistance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theCopy</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theReverse</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeEdge</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeEdgeOnCurveByLength</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>theRefCurve</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLength</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theStartPoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeWire</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>theEdgesAndWires</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFace</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>theWire</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>isPlanarWanted</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFaceWires</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>theWires</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>isPlanarWanted</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeShell</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>theFacesAndShells</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSolidShell</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>theShell</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSolidShells</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>theShells</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCompound</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>theShapes</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeGlueFaces</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>doKeepNonSolids</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetGlueFaces</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeGlueFacesByList</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>doKeepNonSolids</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>doGlueAllEdges</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeExplode</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShapeType</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>isSorted</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>NumberOfFaces</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>long</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>NumberOfEdges</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>long</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ChangeOrientation</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetShapesOnShape</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>theCheckShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShapeType</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theState</inParameter-name>
+ <inParameter-type>GEOM/shape_state</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetShapesOnShapeAsCompound</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>theCheckShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShapeType</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theState</inParameter-name>
+ <inParameter-type>GEOM/shape_state</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeQuad4Vertices</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt4</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeQuad</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>theEdge1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge4</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeQuad2Edges</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>theEdge1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeHexa</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>theFace1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace4</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace5</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace6</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeHexa2Faces</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>theFace1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetPoint</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theX</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theY</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theZ</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEpsilon</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetEdge</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetEdgeNearPoint</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetFaceByPoints</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint4</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetFaceByEdges</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdge2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetOppositeFace</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>theBlock</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetFaceNearPoint</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetFaceByNormale</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>theBlock</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVector</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>IsCompoundOfBlocks</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMinNbFaces</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMaxNbFaces</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>boolean</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>theNbBlocks</outParameter-name>
+ <outParameter-type>long</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>CheckCompoundOfBlocks</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>boolean</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>theErrors</outParameter-name>
+ <outParameter-type>GEOM/BCErrors</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>PrintBCErrors</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theErrors</inParameter-name>
+ <inParameter-type>GEOM/BCErrors</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>string</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExplodeCompoundOfBlocks</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMinNbFaces</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMaxNbFaces</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetBlockNearPoint</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePoint</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetBlockByParts</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParts</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetBlocksByParts</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>theCompound</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParts</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeMultiTransformation1D</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>theBlock</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace1</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace2</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimes</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeMultiTransformation2D</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>theBlock</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace1U</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace2U</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimesU</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace1V</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDirFace2V</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theNbTimesV</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCirclePntVecR</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCircleThreePnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeCircleCenter2Pnt</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeEllipse</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMajor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMinor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeEllipseVec</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>thePnt</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVec</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMajor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRMinor</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVecMaj</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeArc</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>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeArcCenter</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>theCenter</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSense</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeArcOfEllipse</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>theCenter</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePnt2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePolyline</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>thePoints</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsClosed</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSplineBezier</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>thePoints</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsClosed</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSplineInterpolation</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>thePoints</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsClosed</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDoReordering</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSketcher</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>theCommand</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWorkingPlane</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilletAll</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilletEdges</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdges</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilletEdgesR1R2</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdges</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilletFaces</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFilletFacesR1R2</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeFillet2D</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVertexes</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferAll</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferEdge</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace1</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace2</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferEdgeAD</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace1</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFace2</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferFaces</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferFacesAD</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferEdges</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdges</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeChamferEdgesAD</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theD</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theAngle</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theEdges</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeArchimede</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWeight</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWaterDensity</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theMeshDeflection</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetSubShapeIndex</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>theShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSubShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>long</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>CreateGroup</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>theMainShape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theShapeType</inParameter-name>
+ <inParameter-type>long</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>AddObject</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>theGroup</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSubShapeId</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>RemoveObject</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>theGroup</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSubShapeId</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>GetType</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>theGroup</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>long</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetMainShape</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>theGroup</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetObjects</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>theGroup</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShape</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShapeWithPosition</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShapeChamfer</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShapeChamferWithPosition</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShapeFillet</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRF</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeTShapeFilletWithPosition</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>theR1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL1</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theR2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theW2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theL2</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRF</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theHexMesh</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP1</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP2</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theP3</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeDividedDisk</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRatio</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theOrientation</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePattern</inParameter-name>
+ <inParameter-type>GEOM/pattern</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeDividedCylinder</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>theR</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theH</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePattern</inParameter-name>
+ <inParameter-type>GEOM/pattern</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeSmoothingSurface</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>thelPoints</inParameter-name>
+ <inParameter-type>GEOM/GEOM_List</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportSTL</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsASCII</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDeflection</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsRelative</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportSTL</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>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportBREP</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportBREP</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>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportSTEP</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportSTEP</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>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsIgnoreUnits</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportIGES</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theVersion</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportIGES</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>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theIsIgnoreUnits</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportXAO</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>shape</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>groups</inParameter-name>
+ <inParameter-type>GEOM/ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>fields</inParameter-name>
+ <inParameter-type>GEOM/ListOfFields</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>author</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>fileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>boolean</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ImportXAO</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>fileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>boolean</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>shape</outParameter-name>
+ <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>subShapes</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>groups</outParameter-name>
+ <outParameter-type>GEOM/ListOfGO</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ <outParameter>
+ <outParameter-name>fields</outParameter-name>
+ <outParameter-type>GEOM/ListOfFields</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>ExportVTK</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>theObject</inParameter-name>
+ <inParameter-type>GEOM/GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFileName</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theDeflection</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list></outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <!-- @@ insert new functions before this line @@ do not remove this line @@ -->
+ </component-service-list>
+ </component-interface-list>
</component>
-</component-list>
+ </component-list>
+
</begin-catalog>
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="IGESPlugin"
+ server-lib="IGESPluginEngine"
+ gui-lib="IGESPluginGUI">
+ <actions>
+ <action label="Import_IGES"
+ menu="FILE/IMPORT:10/IMPORTIGES"
+ status-bar="IMPORTIGES">
+ </action>
+ <action label="Export_IGES"
+ menu="FILE/EXPORT:10/EXPORTIGES"
+ status-bar="EXPORTIGES">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
+++ /dev/null
-Import: BREP|IGES|STEP|STL
-Export: BREP|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|VTK
-
-BREP.Import: BREPImport
-BREP.Export: BREPExport
-BREP.Pattern: BREP Files ( *.brep )
-
-IGES.Import: IGESImport
-IGES.Export: IGESExport
-IGES.Pattern: IGES Files ( *.iges *.igs )
-IGES.ExportPattern: IGES 5.1 Files ( *.iges *.igs )
-
-IGES_5_3.Export: IGESExport
-IGES_5_3.Pattern: IGES 5.3 Files ( *.iges *.igs )
-
-STEP.Import: STEPImport
-STEP.Export: STEPExport
-STEP.Pattern: STEP Files ( *.step *.stp )
-
-STL.Import: STLImport
-STL.Pattern: STL Files ( *.stl )
-
-STL_Bin.Export: STLExport
-STL_Bin.Pattern: STL Binary Files ( *.stl )
-
-STL_ASCII.Export: STLExport
-STL_ASCII.Pattern: STL ASCII Files ( *.stl )
-
-VTK.Export: VTKExport
-VTK.Pattern: VTK Files ( *.vtk )
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="STEPPlugin"
+ server-lib="STEPPluginEngine"
+ gui-lib="STEPPluginGUI">
+ <actions>
+ <action label="Import_STEP"
+ menu="FILE/IMPORT:10/IMPORTSTEP"
+ status-bar="IMPORTSTEP">
+ </action>
+ <action label="Export_STEP"
+ menu="FILE/EXPORT:10/EXPORTSTEP"
+ status-bar="EXPORTSTEP">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="STLPlugin"
+ server-lib="STLPluginEngine"
+ gui-lib="STLPluginGUI">
+ <actions>
+ <action label="Import_STL"
+ menu="FILE/IMPORT:10/IMPORTSTL"
+ status-bar="IMPORTSTL">
+ </action>
+ <action label="Export_STL"
+ menu="FILE/EXPORT:10/EXPORTSTL"
+ status-bar="EXPORTSTL">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
<section name="resources">
<!-- Module resources -->
<parameter name="GEOM" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
- <parameter name="AdvancedGUI" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="DependencyTree" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="AdvancedGEOM" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="STLPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="BREPPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="STEPPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="IGESPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="XAOPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+ <parameter name="VTKPlugin" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
</section>
<section name="Geometry" >
<!-- Other module preferences -->
<parameter name="SettingsGeomStep" value="10" />
<parameter name="display_mode" value="2" />
+ <parameter name="transparency" value="0" />
<parameter name="shading_color" value="#a7a7a7" />
<parameter name="edges_in_shading_color" value="#000000" />
<parameter name="wireframe_color" value="255, 255, 0" />
<parameter name="measures_line_width" value="1" />
<parameter name="iso_number_u" value="0" />
<parameter name="iso_number_v" value="0" />
+ <parameter name="dependency_tree_hierarchy_type" value="0" />
+ <parameter name="dependency_tree_move_nodes" value="true" />
+ <parameter name="dependency_tree_background_color" value="255, 255, 255" />
+ <parameter name="dependency_tree_node_color" value="62, 180, 238" />
+ <parameter name="dependency_tree_main_node_color" value="238, 90, 125" />
+ <parameter name="dependency_tree_unpublish_node_color" value="255, 255, 255" />
+ <parameter name="dependency_tree_select_node_color" value="237, 243, 58" />
+ <parameter name="dependency_tree_arrow_color" value="0, 0, 130" />
+ <parameter name="dependency_tree_highlight_arrow_color" value="0, 0, 255" />
+ <parameter name="dependency_tree_select_arrow_color" value="255, 0, 0" />
+ <parameter name="auto_bring_to_front" value="false" />
<!-- Dimension presentation properties -->
<parameter name="dimensions_color" value="#ffffff" />
</section>
<section name="windows_geometry">
- <parameter value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #12 #00 #00 #02 #44 #FC #02 #00 #00 #00 #02 #FC #00 #00 #00 #7B #00 #00 #01 #A2 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #00 #00 #01 #12 #00 #00 #00 #C0 #00 #FF #FF #FF #FB #00 #00 #00 #12 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #00 #31 #01 #00 #00 #02 #25 #00 #00 #00 #9A #00 #00 #00 #9A #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #26 #00 #00 #02 #44 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #04 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #08 #00 #00 #00 #0A #00 #42 #00 #61 #00 #73 #00 #69 #00 #63 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #01 #82 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #24 #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #00 #20 #00 #6F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #02 #88 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0C #00 #42 #00 #6C #00 #6F #00 #63 #00 #6B #00 #73 #01 #00 #00 #03 #12 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #10 #00 #50 #00 #69 #00 #63 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #03 #5E #00 #00 #00 #48 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #10 #00 #41 #00 #64 #00 #76 #00 #61 #00 #6E #00 #63 #00 #65 #00 #64 #01 #00 #00 #03 #A6 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1E #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #20 #00 #2F #00 #20 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #01 #00 #00 #03 #D3 #00 #00 #00 #53 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #10 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #73 #00 #00 #00 #04 #B3 #00 #00 #00 #8D #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #1C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #01 #2B #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #14 #00 #47 #00 #65 #00 #6E #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #01 #D4 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0A #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #02 #7D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #03 #45 #00 #00 #01 #FB #00 #00 #00 #00 #00 #00 #00 #00" name="GEOM"/>
+ <parameter name="GEOM" value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #49 #FC #02 #00 #00 #00 #02 #FC #00 #00 #00 #7B #00 #00 #01 #A7 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #18 #00 #6E #00 #6F #00 #74 #00 #65 #00 #42 #00 #6F #00 #6F #00 #6B #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #00 #C0 #00 #FF #FF #FF #FB #00 #00 #00 #36 #00 #67 #00 #65 #00 #6F #00 #6D #00 #43 #00 #72 #00 #65 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #02 #2A #00 #00 #00 #9A #00 #00 #00 #9A #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #49 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #04 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #07 #00 #00 #00 #12 #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #61 #00 #73 #00 #69 #00 #63 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #01 #A1 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #2A #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #02 #A7 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #16 #00 #54 #00 #4F #00 #4F #00 #4C #00 #5F #00 #42 #00 #4C #00 #4F #00 #43 #00 #4B #00 #53 #01 #00 #00 #03 #31 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #18 #00 #47 #00 #45 #00 #4F #00 #4D #00 #50 #00 #69 #00 #63 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #03 #7D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #54 #00 #4F #00 #4F #00 #4C #00 #5F #00 #41 #00 #44 #00 #56 #00 #41 #00 #4E #00 #43 #00 #45 #00 #44 #01 #00 #00 #03 #AA #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #26 #00 #47 #00 #45 #00 #4F #00 #4D #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #00 #58 #00 #41 #00 #4F #01 #00 #00 #03 #D7 #00 #00 #01 #69 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #05 #00 #00 #00 #24 #00 #47 #00 #45 #00 #4F #00 #4D #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #01 #2B #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #47 #00 #65 #00 #6E #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #01 #D4 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #12 #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #02 #7D #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #20 #00 #47 #00 #45 #00 #4F #00 #4D #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #03 #45 #00 #00 #01 #FB #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #02 #00 #00 #00 #01 #00 #00 #00 #18 #00 #47 #00 #45 #00 #4F #00 #4D #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #73 #00 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00"/>
</section>
<section name="windows_visibility">
- <parameter value="#00 #00 #00 #00 #10 #00 #00 #00 #24 #00 #33 #00 #44 #00 #20 #00 #56 #00 #69 #00 #65 #00 #77 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #10 #00 #41 #00 #64 #00 #76 #00 #61 #00 #6E #00 #63 #00 #65 #00 #64 #01 #00 #00 #00 #0A #00 #42 #00 #61 #00 #73 #00 #69 #00 #63 #01 #00 #00 #00 #0C #00 #42 #00 #6C #00 #6F #00 #63 #00 #6B #00 #73 #01 #00 #00 #00 #24 #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #00 #20 #00 #6F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #0A #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #00 #14 #00 #47 #00 #65 #00 #6E #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #1E #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #20 #00 #2F #00 #20 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #01 #00 #00 #00 #10 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #73 #00 #00 #00 #00 #18 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #14 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #10 #00 #50 #00 #69 #00 #63 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #00 #14 #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #1C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #01 #00 #00 #00 #04 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #12 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" name="GEOM"/>
+ <parameter name="GEOM" value="#00 #00 #00 #00 #21 #00 #00 #00 #24 #00 #33 #00 #44 #00 #20 #00 #56 #00 #69 #00 #65 #00 #77 #00 #20 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #10 #00 #41 #00 #64 #00 #76 #00 #61 #00 #6E #00 #63 #00 #65 #00 #64 #01 #00 #00 #00 #0A #00 #42 #00 #61 #00 #73 #00 #69 #00 #63 #01 #00 #00 #00 #0C #00 #42 #00 #6C #00 #6F #00 #63 #00 #6B #00 #73 #01 #00 #00 #00 #24 #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #00 #20 #00 #6F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #0A #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #00 #12 #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #61 #00 #73 #00 #69 #00 #63 #01 #00 #00 #00 #2A #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #6F #00 #6F #00 #6C #00 #65 #00 #61 #00 #6E #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #12 #00 #47 #00 #45 #00 #4F #00 #4D #00 #42 #00 #75 #00 #69 #00 #6C #00 #64 #01 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #47 #00 #65 #00 #6E #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #26 #00 #47 #00 #45 #00 #4F #00 #4D #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #00 #58 #00 #41 #00 #4F #01 #00 #00 #00 #18 #00 #47 #00 #45 #00 #4F #00 #4D #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #73 #00 #00 #00 #00 #20 #00 #47 #00 #45 #00 #4F #00 #4D #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #18 #00 #47 #00 #45 #00 #4F #00 #4D #00 #50 #00 #69 #00 #63 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #47 #00 #45 #00 #4F #00 #4D #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #00 #24 #00 #47 #00 #45 #00 #4F #00 #4D #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #14 #00 #47 #00 #65 #00 #6E #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #1E #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #20 #00 #2F #00 #20 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #01 #00 #00 #00 #26 #00 #49 #00 #6D #00 #70 #00 #6F #00 #72 #00 #74 #00 #20 #00 #2F #00 #20 #00 #45 #00 #78 #00 #70 #00 #6F #00 #72 #00 #74 #00 #20 #00 #58 #00 #41 #00 #4F #01 #00 #00 #00 #10 #00 #4D #00 #65 #00 #61 #00 #73 #00 #75 #00 #72 #00 #65 #00 #73 #00 #00 #00 #00 #18 #00 #4D #00 #6F #00 #64 #00 #69 #00 #66 #00 #69 #00 #63 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #32 #00 #4F #00 #43 #00 #43 #00 #56 #00 #69 #00 #65 #00 #77 #00 #65 #00 #72 #00 #33 #00 #44 #00 #56 #00 #69 #00 #65 #00 #77 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #14 #00 #4F #00 #70 #00 #65 #00 #72 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #73 #01 #00 #00 #00 #10 #00 #50 #00 #69 #00 #63 #00 #74 #00 #75 #00 #72 #00 #65 #00 #73 #01 #00 #00 #00 #14 #00 #50 #00 #72 #00 #69 #00 #6D #00 #69 #00 #74 #00 #69 #00 #76 #00 #65 #00 #73 #01 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #1A #00 #54 #00 #4F #00 #4F #00 #4C #00 #5F #00 #41 #00 #44 #00 #56 #00 #41 #00 #4E #00 #43 #00 #45 #00 #44 #01 #00 #00 #00 #16 #00 #54 #00 #4F #00 #4F #00 #4C #00 #5F #00 #42 #00 #4C #00 #4F #00 #43 #00 #4B #00 #53 #01 #00 #00 #00 #1C #00 #54 #00 #72 #00 #61 #00 #6E #00 #73 #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #01 #01 #00 #00 #00 #08 #00 #00 #00 #36 #00 #67 #00 #65 #00 #6F #00 #6D #00 #43 #00 #72 #00 #65 #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #49 #00 #6E #00 #66 #00 #6F #00 #72 #00 #6D #00 #61 #00 #74 #00 #69 #00 #6F #00 #6E #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #18 #00 #6E #00 #6F #00 #74 #00 #65 #00 #42 #00 #6F #00 #6F #00 #6B #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #12 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01"/>
</section>
</document>
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="VTKPlugin"
+ server-lib="VTKPluginEngine"
+ gui-lib="VTKPluginGUI">
+ <actions>
+ <action label="Export_VTK"
+ menu="FILE/EXPORT:10/EXPORTVTK"
+ status-bar="EXPORTVTK">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
--- /dev/null
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
+<!--
+ Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+
+<!-- GUI customization for GEOM component -->
+
+<geom-plugins>
+
+ <geom-plugin name="XAOPlugin"
+ server-lib="XAOPluginEngine"
+ gui-lib="XAOPluginGUI">
+ <actions>
+ <action label="Import_XAO"
+ menu="FILE/IMPORT:10/IMPORTXAO"
+ status-bar="IMPORTXAO">
+ </action>
+ <action label="Export_XAO"
+ menu="FILE/EXPORT:10/EXPORTXAO"
+ status-bar="EXPORTXAO">
+ </action>
+ </actions>
+ </geom-plugin>
+
+</geom-plugins>
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "GEOM_AdvancedEngine.hxx"
-
-#include "AdvancedEngine_OperationsCreator.hh"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
+#include "AdvancedEngine.hxx"
+#include "AdvancedEngine_OperationsCreator.hxx"
extern "C"
{
-ADVANCEDENGINE_EXPORT
+ ADVANCEDENGINE_EXPORT
GEOM_GenericOperationsCreator* GetOperationsCreator()
{
- //MESSAGE("GetOperationsCreator");
-
- AdvancedEngine_OperationsCreator* aCreator = new AdvancedEngine_OperationsCreator();
-
- return aCreator;
+ return new AdvancedEngine_OperationsCreator();
}
}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_ADVANCEDENGINE_HXX_
+#define _GEOM_ADVANCEDENGINE_HXX_
+
+#ifdef WIN32
+ #if defined ADVANCEDENGINE_EXPORTS || defined AdvancedEngine_EXPORTS
+ #define ADVANCEDENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define ADVANCEDENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define ADVANCEDENGINE_EXPORT
+#endif
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <Standard_Stream.hxx>
+
+#include "AdvancedEngine_DividedDiskDriver.hxx"
+#include "AdvancedEngine_IDividedDisk.hxx"
+#include "AdvancedEngine_Types.hxx"
+
+#include "GEOM_Function.hxx"
+
+// OCCT includes
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Ax2.hxx>
+
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_Transform.hxx>
+
+#include <Geom_Plane.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Edge.hxx>
+
+#include <TFunction_Logbook.hxx>
+#include <StdFail_NotDone.hxx>
+
+#include <TopExp.hxx>
+
+#include <utilities.h>
+
+enum
+{
+ SQUARE,
+ HEXAGON
+};
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& AdvancedEngine_DividedDiskDriver::GetID()
+{
+ static Standard_GUID aGUID("0b01da9a-c5da-11e1-8d80-78e7d1879630");
+ return aGUID;
+}
+
+//=======================================================================
+//function : AdvancedEngine_DividedDiskDriver
+//purpose :
+//=======================================================================
+AdvancedEngine_DividedDiskDriver::AdvancedEngine_DividedDiskDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer AdvancedEngine_DividedDiskDriver::Execute(TFunction_Logbook& log) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+
+ AdvancedEngine_IDividedDisk aData (aFunction);
+ Standard_Integer aType = aFunction->GetType();
+
+ TopoDS_Shape aShape;
+
+ // Getting data
+ double R = aData.GetR();
+ double Ratio = aData.GetRatio();
+ int Pattern = aData.GetType();
+
+ // Build reference disk (in the global coordinate system)
+ TopoDS_Shape aDisk;
+
+ if (Pattern == SQUARE)
+ aDisk = MakeDiskSquare( R, Ratio );
+ else if (Pattern == HEXAGON)
+ aDisk = MakeDiskHexagon( R, Ratio );
+
+ if (aType == DIVIDEDDISK_R_RATIO)
+ {
+ int theOrientation = aData.GetOrientation();
+ aShape = TransformShape(aDisk, theOrientation);
+ }
+ else if (aType == DIVIDEDDISK_R_VECTOR_PNT)
+ {
+ Handle(GEOM_Function) aRefPoint = aData.GetCenter();
+ Handle(GEOM_Function) aRefVector = aData.GetVector();
+ TopoDS_Shape aShapePnt = aRefPoint->GetValue();
+ TopoDS_Shape aShapeVec = aRefVector->GetValue();
+
+ if (aShapePnt.ShapeType() == TopAbs_VERTEX &&
+ aShapeVec.ShapeType() == TopAbs_EDGE)
+ {
+ gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
+ TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(anE, V1, V2, Standard_True);
+ if (!V1.IsNull() && !V2.IsNull())
+ {
+ gp_Vec aVec (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
+ gp_Dir aDir(aVec);
+ aShape = TransformShape(aDisk, aPnt, aDir);
+ }
+ }
+ }
+
+ if (aShape.IsNull()) return 0;
+
+ aFunction->SetValue(aShape);
+
+ log.SetTouched(Label());
+
+ return 1;
+}
+
+
+//=======================================================================
+//function : MakeDiskHexagon
+//purpose :
+//=======================================================================
+TopoDS_Shell AdvancedEngine_DividedDiskDriver::MakeDiskHexagon(double R, double Ratio) const
+{
+ // Geometry
+ gp_Dir ZDir(0,0,1);
+ gp_Dir XDir(1,0,0);
+ gp_Pnt Orig(0,0,0);
+
+ // Circle
+ gp_Ax1 Ax1(Orig,ZDir);
+ gp_Ax2 Ax(Orig,ZDir,XDir);
+ gp_Circ aCircle(Ax, R);
+
+ // Points
+// gp_Pnt P4(0.01*Ratio*R,0,0);
+// gp_Pnt P3(R,0,0);
+// gp_Pnt P2 = P3.Rotated(Ax1,-M_PI/6.0);
+// gp_Pnt P1(P4.X(),
+// P4.X()/sqrt(3.0),0);
+ gp_Pnt P1(0.01*Ratio*R*sqrt(3.0)/2,0,0);
+ gp_Pnt P2(R,0,0);
+ gp_Pnt P3 = P2.Rotated(Ax1,M_PI/6.0);
+ gp_Pnt P4(P1.X(),
+ P1.X()/sqrt(3.0),0);
+
+
+ //surfaces
+ gp_Ax2 anAx (gp::XOY());
+ Handle(Geom_Plane) aPlane = new Geom_Plane (anAx);
+
+ // Topology
+
+ // Vertices
+ TopoDS_Vertex O = BRepBuilderAPI_MakeVertex(Orig);
+ TopoDS_Vertex V1_init = BRepBuilderAPI_MakeVertex(P1);
+ TopoDS_Vertex V2_init = BRepBuilderAPI_MakeVertex(P2);
+ TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(P3);
+ TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(P4);
+
+ TopoDS_Vertex V1 = V1_init;
+ TopoDS_Vertex V2 = V2_init;
+
+ //Rotation
+ gp_Trsf myTrsf;
+ myTrsf.SetRotation(Ax1, M_PI/3.0);
+
+ BRepBuilderAPI_Transform xform(myTrsf);
+ xform.Perform(V1,Standard_True);
+ TopoDS_Vertex V1_60 = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V2,Standard_True);
+ TopoDS_Vertex V2_60 = TopoDS::Vertex(xform.Shape());
+
+ // Declaration of shapes (used in the loop)
+ TopoDS_Edge E1, E2, E3, E4, E5, E6, E7, E8, E9;
+ TopoDS_Wire W1, W2, W3;
+ TopoDS_Face F1, F2, F3;
+ TopoDS_Shell S;
+
+ BRep_Builder aBuilder;
+ aBuilder.MakeShell(S);
+
+ // Initialisation of edges
+ TopoDS_Edge E1_init = BRepBuilderAPI_MakeEdge(V1,TopoDS::Vertex(V2.Reversed()));
+ E1 = E1_init;
+ TopoDS_Edge E8_init = BRepBuilderAPI_MakeEdge(O,TopoDS::Vertex(V1.Reversed()));
+ E8 = E8_init;
+
+ for (int i=1;i<=6;i++)
+ {
+ // Edges
+
+ // for Face1
+ E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V3.Reversed()));
+ E3 = BRepBuilderAPI_MakeEdge(V3,TopoDS::Vertex(V4.Reversed()));
+ E4 = BRepBuilderAPI_MakeEdge(V4,TopoDS::Vertex(V1.Reversed()));
+
+ // for Face2
+ if (i==6)
+ {
+ E5 = BRepBuilderAPI_MakeEdge(aCircle, V3, TopoDS::Vertex(V2_init.Reversed()));
+ E7 = BRepBuilderAPI_MakeEdge(V1_init,TopoDS::Vertex(V4.Reversed()));
+ }
+ else
+ {
+ E5 = BRepBuilderAPI_MakeEdge(aCircle, V3, TopoDS::Vertex(V2_60.Reversed()));
+ E7 = BRepBuilderAPI_MakeEdge(V1_60,TopoDS::Vertex(V4.Reversed()));
+ }
+ E6 = BRepBuilderAPI_MakeEdge(V2_60,TopoDS::Vertex(V1_60.Reversed()));
+
+ // for Face3
+ E9 = BRepBuilderAPI_MakeEdge(V1_60,TopoDS::Vertex(O.Reversed()));
+
+
+ // Wires
+
+ //Wire1
+ aBuilder.MakeWire(W1);
+ if (i==1)
+ aBuilder.Add(W1,E1);
+ else
+ aBuilder.Add(W1,TopoDS::Edge(E1.Reversed()));
+ aBuilder.Add(W1,E2);
+ aBuilder.Add(W1,E3);
+ aBuilder.Add(W1,E4);
+
+ // Wire 2
+ aBuilder.MakeWire(W2);
+ aBuilder.Add(W2,TopoDS::Edge(E3.Reversed()));
+ aBuilder.Add(W2,E5);
+ if (i==6)
+ aBuilder.Add(W2,TopoDS::Edge(E1_init.Reversed()));
+ else
+ aBuilder.Add(W2,E6);
+ aBuilder.Add(W2,E7);
+
+ // Wire3
+ aBuilder.MakeWire(W3);
+ if (i==1)
+ aBuilder.Add(W3,E8);
+ else
+ aBuilder.Add(W3,TopoDS::Edge(E8.Reversed()));
+ aBuilder.Add(W3,TopoDS::Edge(E4.Reversed()));
+ aBuilder.Add(W3,TopoDS::Edge(E7.Reversed()));
+ if (i==6)
+ aBuilder.Add(W3,TopoDS::Edge(E8_init.Reversed()));
+ else
+ aBuilder.Add(W3,E9);
+
+ // Faces creation
+ F1 = BRepBuilderAPI_MakeFace(aPlane,W1);
+ F2 = BRepBuilderAPI_MakeFace(aPlane,W2);
+ F3 = BRepBuilderAPI_MakeFace(aPlane,W3);
+
+ //Shell
+ aBuilder.Add(S, F1);
+ aBuilder.Add(S, F2);
+ aBuilder.Add(S, F3);
+
+ // rotation
+ V1=V1_60;
+ V2=V2_60;
+
+ xform.Perform(V1_60,Standard_True);
+ V1_60 = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V2_60,Standard_True);
+ V2_60 = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V3,Standard_True);
+ V3 = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V4,Standard_True);
+ V4 = TopoDS::Vertex(xform.Shape());
+
+ // "Increment" of edges
+ E1=E6;
+ E8=E9;
+ }
+
+ return S;
+}
+
+//=======================================================================
+//function : MakeDiskSquare
+//purpose :
+//=======================================================================
+TopoDS_Shape AdvancedEngine_DividedDiskDriver::MakeDiskSquare(double R, double Ratio) const
+{
+ // Geometry
+ gp_Dir ZDir(0,0,1);
+ gp_Dir XDir(1,0,0);
+ gp_Pnt Orig(0,0,0);
+
+ // Circle
+ gp_Ax1 Ax1(Orig,ZDir);
+ gp_Ax2 Ax(Orig,ZDir,XDir);
+ gp_Circ aCircle(Ax, R);
+
+ // Points
+ gp_Pnt P1(0.01*Ratio*R,0,0);
+ gp_Pnt P2(R,0,0);
+
+ //surfaces
+ gp_Ax2 anAx (gp::XOY());
+ Handle(Geom_Plane) aPlane = new Geom_Plane (anAx);
+
+ // Topology
+
+ // Vertices
+ TopoDS_Vertex V1_init = BRepBuilderAPI_MakeVertex(P1);
+ TopoDS_Vertex V2_init = BRepBuilderAPI_MakeVertex(P2);
+
+ TopoDS_Vertex V1 = V1_init;
+ TopoDS_Vertex V2 = V2_init;
+
+ //Rotation
+ gp_Trsf myTrsf;
+ myTrsf.SetRotation(Ax1, M_PI/2);
+
+ BRepBuilderAPI_Transform xform(myTrsf);
+ xform.Perform(V1,Standard_True);
+ TopoDS_Vertex V1_rotated = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V2,Standard_True);
+ TopoDS_Vertex V2_rotated = TopoDS::Vertex(xform.Shape());
+
+ // Declaration of shapes (used in the loop)
+ TopoDS_Edge E1, E2, E3, E4;
+ TopoDS_Wire W1, W2;
+ TopoDS_Face F1, F2;
+ TopoDS_Shell S;
+
+ BRep_Builder aBuilder;
+ aBuilder.MakeWire(W2); // Central Wire
+ aBuilder.MakeShell(S); // Shell
+
+ // Initialisation of edges
+ TopoDS_Edge E1_init = BRepBuilderAPI_MakeEdge(V1,TopoDS::Vertex(V2.Reversed()));
+ E1 = E1_init;
+
+ for (int i=1;i<=4;i++)
+ {
+ // Edges
+ // for Face1
+
+ E3 = BRepBuilderAPI_MakeEdge(V2_rotated,TopoDS::Vertex(V1_rotated.Reversed()));
+ if (i == 4)
+ {
+ E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V2_init.Reversed()));
+ E4 = BRepBuilderAPI_MakeEdge(V1_init,TopoDS::Vertex(V1.Reversed()));
+ }
+ else
+ {
+ E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V2_rotated.Reversed()));
+ E4 = BRepBuilderAPI_MakeEdge(V1_rotated,TopoDS::Vertex(V1.Reversed()));
+ }
+
+ // Wires
+ //Wire1
+ aBuilder.MakeWire(W1);
+ if (i==1)
+ aBuilder.Add(W1,E1);
+ else
+ aBuilder.Add(W1,TopoDS::Edge(E1.Reversed()));
+ aBuilder.Add(W1,E2);
+ if (i==4)
+ aBuilder.Add(W1,TopoDS::Edge(E1_init.Reversed()));
+ else
+ aBuilder.Add(W1,E3);
+ aBuilder.Add(W1,E4);
+
+ // Wire central
+ aBuilder.Add(W2,TopoDS::Edge(E4.Reversed()));
+
+ // Faces creation
+ F1 = BRepBuilderAPI_MakeFace(aPlane,W1);
+
+ //Shell
+ aBuilder.Add(S, F1);
+
+ // rotation
+ V1=V1_rotated;
+ V2=V2_rotated;
+
+ xform.Perform(V1_rotated,Standard_True);
+ V1_rotated = TopoDS::Vertex(xform.Shape());
+ xform.Perform(V2_rotated,Standard_True);
+ V2_rotated = TopoDS::Vertex(xform.Shape());
+
+ // "Increment" of edges
+ E1=E3;
+ }
+ // Central square Face
+ F2 = BRepBuilderAPI_MakeFace(aPlane,W2);
+ aBuilder.Add(S, F2);
+
+ return S;
+}
+
+
+//=======================================================================
+//function : TrasformShape(TopoDS_Shape aShape,int theOrientation)
+//purpose : Perform shape transformation accordingly with specified
+// orientation
+//=======================================================================
+TopoDS_Shape AdvancedEngine_DividedDiskDriver::TransformShape(TopoDS_Shape theShape, int theOrientation) const
+{
+ gp_Dir N, Vx;
+ gp_Pnt theOrigin = gp::Origin();
+
+ switch(theOrientation)
+ {
+ case 1:
+ {
+ N = gp::DZ();
+ Vx = gp::DX();
+ break;
+ }
+ case 2:
+ {
+ N = gp::DX();
+ Vx = gp::DY();
+ break;
+ }
+ case 3:
+ {
+ N = gp::DY();
+ Vx = gp::DZ();
+ break;
+ }
+ }
+
+ gp_Ax3 aWPlane = gp_Ax3(theOrigin, N, Vx);
+
+ return WPlaneTransform(theShape, aWPlane);
+}
+
+//=======================================================================
+//function : TrasformShape(TopoDS_Shape aShape, gp_Dir V, gp_Pnt P)
+//purpose : Perform shape transformation accordingly with specified
+// pnt and direction
+//=======================================================================
+TopoDS_Shape AdvancedEngine_DividedDiskDriver::TransformShape(TopoDS_Shape theShape, gp_Pnt P, gp_Dir V) const
+{
+ gp_Ax3 aWPlane( P, V );
+ return WPlaneTransform(theShape, aWPlane);
+}
+
+//=======================================================================
+//function : WPlaneTransform
+//purpose : Perform shape transformation accordingly with the given
+// Working Plane
+//=======================================================================
+TopoDS_Shape AdvancedEngine_DividedDiskDriver::WPlaneTransform(TopoDS_Shape theShape, gp_Ax3 theWPlane) const
+{
+ gp_Trsf aTrans;
+ aTrans.SetTransformation(theWPlane);
+ aTrans.Invert();
+ BRepBuilderAPI_Transform aTransformation (theShape, aTrans, Standard_False);
+ return aTransformation.Shape();
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool AdvancedEngine_DividedDiskDriver::
+GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams)
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+ AdvancedEngine_IDividedDisk aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "DIVIDEDDISK";
+
+ switch ( aType ) {
+ case DIVIDEDDISK_R_RATIO:
+ AddParam( theParams, "Radius", aCI.GetR() );
+ AddParam( theParams, "Ratio", aCI.GetRatio() );
+ AddParam( theParams, "Orientation", aCI.GetOrientation() );
+ AddParam( theParams, "Division pattern", aCI.GetType() );
+ break;
+ case DIVIDEDDISK_R_VECTOR_PNT:
+ AddParam( theParams, "Center Point", aCI.GetCenter() );
+ AddParam( theParams, "Vector", aCI.GetVector() );
+ AddParam( theParams, "Radius", aCI.GetR() );
+ AddParam( theParams, "Division pattern", aCI.GetType() );
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (AdvancedEngine_DividedDiskDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (AdvancedEngine_DividedDiskDriver,GEOM_BaseDriver);
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_DividedDiskDriver_HXX
+#define _AdvancedEngine_DividedDiskDriver_HXX
+
+#include "GEOM_BaseDriver.hxx"
+
+#include <TFunction_Driver.hxx>
+
+class TopoDS_Shape;
+class TopoDS_Shell;
+class gp_Pnt;
+class gp_Dir;
+class gp_Ax3;
+
+DEFINE_STANDARD_HANDLE( AdvancedEngine_DividedDiskDriver, GEOM_BaseDriver );
+
+class AdvancedEngine_DividedDiskDriver : public GEOM_BaseDriver
+{
+public:
+ // Methods PUBLIC
+ //
+ AdvancedEngine_DividedDiskDriver();
+ virtual Standard_Integer Execute(TFunction_Logbook& log) const;
+ virtual void Validate(TFunction_Logbook&) const {}
+ Standard_Boolean MustExecute(const TFunction_Logbook&) const
+ {
+ return Standard_True;
+ }
+ static const Standard_GUID& GetID();
+ ~AdvancedEngine_DividedDiskDriver() {};
+
+ virtual bool GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& params);
+private:
+ TopoDS_Shape TransformShape (TopoDS_Shape aShape, int theOrientation) const;
+ TopoDS_Shape TransformShape (TopoDS_Shape aShape, gp_Pnt P, gp_Dir V) const;
+ TopoDS_Shape WPlaneTransform (TopoDS_Shape aShape, gp_Ax3 theWPlane) const;
+ TopoDS_Shell MakeDiskHexagon (double R, double Ratio) const;
+ TopoDS_Shape MakeDiskSquare (double R, double Ratio) const;
+
+ DEFINE_STANDARD_RTTI( AdvancedEngine_DividedDiskDriver )
+};
+
+#endif // _AdvancedEngine_DividedDiskDriver_HXX
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_IDividedDisk_HXX_
+#define _AdvancedEngine_IDividedDisk_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define DIVIDEDDISK_ARG_R 1
+#define DIVIDEDDISK_ARG_RATIO 2
+#define DIVIDEDDISK_ARG_ORIENT 3
+
+#define DIVIDEDDISK_ARG_CENTER 4
+#define DIVIDEDDISK_ARG_VECTOR 5
+
+#define DIVIDEDDISK_ARG_TYPE 6
+
+class AdvancedEngine_IDividedDisk
+{
+public:
+ AdvancedEngine_IDividedDisk(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+ void SetR(double theR) { _func->SetReal(DIVIDEDDISK_ARG_R, theR); }
+ double GetR() { return _func->GetReal(DIVIDEDDISK_ARG_R); }
+
+ void SetRatio(double theRatio) { _func->SetReal(DIVIDEDDISK_ARG_RATIO, theRatio); }
+ double GetRatio() { return _func->GetReal(DIVIDEDDISK_ARG_RATIO); }
+
+ void SetOrientation(int theOrientation) { _func->SetInteger(DIVIDEDDISK_ARG_ORIENT, theOrientation); }
+ int GetOrientation() { return _func->GetInteger(DIVIDEDDISK_ARG_ORIENT); }
+
+ void SetType(int theType) { _func->SetInteger(DIVIDEDDISK_ARG_TYPE, theType); }
+ int GetType() { return _func->GetInteger(DIVIDEDDISK_ARG_TYPE); }
+
+ void SetCenter(Handle(GEOM_Function) theP) { _func->SetReference(DIVIDEDDISK_ARG_CENTER, theP); }
+ void SetVector(Handle(GEOM_Function) theV) { _func->SetReference(DIVIDEDDISK_ARG_VECTOR, theV); }
+
+ Handle(GEOM_Function) GetCenter() { return _func->GetReference(DIVIDEDDISK_ARG_CENTER); }
+ Handle(GEOM_Function) GetVector() { return _func->GetReference(DIVIDEDDISK_ARG_VECTOR); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _AdvancedEngine_IDividedDisk_HXX_
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : AdvancedEngine_IOperations.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#include "AdvancedEngine_IOperations.hxx"
+#include "AdvancedEngine_PipeTShapeDriver.hxx"
+#include "AdvancedEngine_IPipeTShape.hxx"
+#include "AdvancedEngine_DividedDiskDriver.hxx"
+#include "AdvancedEngine_IDividedDisk.hxx"
+#include "AdvancedEngine_SmoothingSurfaceDriver.hxx"
+#include "AdvancedEngine_ISmoothingSurface.hxx"
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <utilities.h>
+#include <OpUtil.hxx>
+#include <Utils_ExceptHandlers.hxx>
+
+#include "GEOM_Function.hxx"
+#include "GEOM_PythonDump.hxx"
+#include "GEOMUtils.hxx"
+#include "GEOMAlgo_Splitter.hxx"
+#include "GEOMAlgo_FinderShapeOn1.hxx"
+
+#include "GEOMImpl_Gen.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include "GEOMImpl_IBasicOperations.hxx"
+#include "GEOMImpl_IBooleanOperations.hxx"
+#include "GEOMImpl_IShapesOperations.hxx"
+#include "GEOMImpl_ITransformOperations.hxx"
+#include "GEOMImpl_IBlocksOperations.hxx"
+#include "GEOMImpl_I3DPrimOperations.hxx"
+#include "GEOMImpl_ILocalOperations.hxx"
+#include "GEOMImpl_IHealingOperations.hxx"
+#include "GEOMImpl_IGroupOperations.hxx"
+#include "GEOMImpl_GlueDriver.hxx"
+
+#include <TDF_Tool.hxx>
+#include <TFunction_DriverTable.hxx>
+#include <TFunction_Driver.hxx>
+#include <TFunction_Logbook.hxx>
+#include <TNaming_CopyShape.hxx>
+
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
+
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepAlgoAPI_Cut.hxx>
+#include <BRepAlgoAPI_Fuse.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_Transform.hxx>
+#include <BRepPrimAPI_MakeCone.hxx>
+#include <BRepPrimAPI_MakeCylinder.hxx>
+
+#include <gp_Ax3.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <GC_MakeConicalSurface.hxx>
+#include <Geom_CylindricalSurface.hxx>
+
+#include <ShapeAnalysis_Edge.hxx>
+
+#include <cmath>
+
+#include "AdvancedEngine_Types.hxx"
+
+#include <Standard_Stream.hxx>
+#include <Standard_Failure.hxx>
+#include <StdFail_NotDone.hxx>
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+#define HALF_LENGTH_MAIN_PIPE "Main pipe half length" //"Tuyau principal - demi longueur"
+#define HALF_LENGTH_INCIDENT_PIPE "Incident pipe half length" //"Tuyau incident - demi longueur"
+#define CIRCULAR_QUARTER_PIPE "Circular quarter of pipe" //"Circulaire - quart de tuyau"
+#define THICKNESS "Thickness" //"Epaisseur"
+#define FLANGE "Flange" // "Collerette"
+#define CHAMFER_OR_FILLET "Chamfer or fillet" //"Chanfrein ou Raccord"
+#define JUNCTION_FACE_1 "Junction 1" //"Face de jonction 1"
+#define JUNCTION_FACE_2 "Junction 2" //"Face de jonction 2"
+#define JUNCTION_FACE_3 "Junction 3" //"Face de jonction 3"
+
+#define FIND_GROUPS_BY_POINTS 1
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID) :
+ GEOM_IOperations(theEngine, theDocID)
+{
+ 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());
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+AdvancedEngine_IOperations::~AdvancedEngine_IOperations()
+{
+ MESSAGE("AdvancedEngine_IOperations::~AdvancedEngine_IOperations");
+ delete myBasicOperations;
+ delete myBooleanOperations;
+ delete myShapesOperations;
+ delete myTransformOperations;
+ delete myBlocksOperations;
+ delete my3DPrimOperations;
+ delete myLocalOperations;
+ delete myHealingOperations;
+ delete myGroupOperations;
+}
+
+//=============================================================================
+/*!
+ * SetPosition
+ */
+//=============================================================================
+gp_Trsf AdvancedEngine_IOperations::GetPositionTrsf(double theL1, double theL2,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3)
+{
+ // Old Local Coordinates System oldLCS
+ gp_Pnt P0(0, 0, 0);
+ gp_Pnt P1(-theL1, 0, 0);
+ gp_Pnt P2(theL1, 0, 0);
+ gp_Pnt P3(0, 0, theL2);
+
+ gp_Dir oldX(gp_Vec(P1, P2));
+ gp_Dir oldZ(gp_Vec(P0, P3));
+ gp_Ax3 oldLCS(P0, oldZ, oldX);
+
+ // New Local Coordinates System newLCS
+ double LocX, LocY, LocZ;
+ gp_Pnt newP1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
+ gp_Pnt newP2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue()));
+ gp_Pnt newP3 = BRep_Tool::Pnt(TopoDS::Vertex(theP3->GetValue()));
+ LocX = (newP1.X() + newP2.X()) / 2.;
+ LocY = (newP1.Y() + newP2.Y()) / 2.;
+ LocZ = (newP1.Z() + newP2.Z()) / 2.;
+ gp_Pnt newO(LocX, LocY, LocZ);
+
+ gp_Dir newX(gp_Vec(newP1, newP2)); // P1P2 Vector
+ gp_Dir newZ(gp_Vec(newO, newP3)); // OP3 Vector
+ gp_Ax3 newLCS = gp_Ax3(newO, newZ, newX);
+
+ gp_Trsf aTrsf;
+ aTrsf.SetDisplacement(oldLCS, newLCS);
+
+ return aTrsf;
+}
+
+//=============================================================================
+/*!
+ * CheckCompatiblePosition
+ *
+ */
+//=============================================================================
+bool AdvancedEngine_IOperations::CheckCompatiblePosition(double& theL1, double& theL2,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3,
+ double theTolerance)
+{
+ SetErrorCode(KO);
+ gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
+ gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue()));
+ gp_Pnt P3 = BRep_Tool::Pnt(TopoDS::Vertex(theP3->GetValue()));
+
+ double d12 = P1.Distance(P2);
+ double d13 = P1.Distance(P3);
+ double d23 = P2.Distance(P3);
+ // double d2 = newO.Distance(P3);
+
+ if (Abs(d12) <= Precision::Confusion()) {
+ SetErrorCode("Junctions points P1 and P2 are identical");
+ return false;
+ }
+ if (Abs(d13) <= Precision::Confusion()) {
+ SetErrorCode("Junctions points P1 and P3 are identical");
+ return false;
+ }
+ if (Abs(d23) <= Precision::Confusion()) {
+ SetErrorCode("Junctions points P2 and P3 are identical");
+ return false;
+ }
+
+
+ double newL1 = 0.5 * d12;
+ double newL2 = sqrt(pow(d13,2)-pow(newL1,2));
+ //
+ // theL1*(1-theTolerance) <= newL1 <= theL1*(1+theTolerance)
+ //
+ if (fabs(newL1 - theL1) > Precision::Approximation()) {
+ if ( (newL1 * (1 - theTolerance) -theL1 <= Precision::Approximation()) &&
+ (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) {
+ // std::cerr << "theL1 = newL1" << std::endl;
+ theL1 = newL1;
+ } else {
+ theL1 = -1;
+ SetErrorCode("Dimension for main pipe (L1) is incompatible with new position");
+ return false;
+ }
+ }
+
+ //
+ // theL2*(1-theTolerance) <= newL2 <= theL2*(1+theTolerance)
+ //
+ if (fabs(newL2 - theL2) > Precision::Approximation()) {
+ if ( (newL2 * (1 - theTolerance) -theL2 <= Precision::Approximation()) &&
+ (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) {
+ theL2 = newL2;
+ } else {
+ theL2 = -1;
+ SetErrorCode("Dimension for incident pipe (L2) is incompatible with new position");
+ return false;
+ }
+ }
+
+ SetErrorCode(OK);
+ return true;
+
+}
+
+//=============================================================================
+/*!
+ * Generate the propagation groups of a Pipe T-Shape used for hexa mesh
+ */
+//=============================================================================
+bool AdvancedEngine_IOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theH, double theW, double theRF,
+ Handle(TColStd_HSequenceOfTransient) theSeq,
+ gp_Trsf aTrsf)
+{
+ SetErrorCode(KO);
+
+ if (theShape.IsNull()) return false;
+
+ TopoDS_Shape aShape = theShape->GetValue();
+ if (aShape.IsNull()) {
+ SetErrorCode("Shape is not defined");
+ return false;
+ }
+
+ gp_Trsf aTrsfInv = aTrsf.Inverted();
+
+// int expectedGroups = 0;
+// if (shapeType == TSHAPE_BASIC)
+// if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation())
+// expectedGroups = 10;
+// else
+// expectedGroups = 11;
+// else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET)
+// expectedGroups = 12;
+
+ double aR1Ext = theR1 + theW1;
+ double aR2Ext = theR2 + theW2;
+
+ /////////////////////////
+ //// Groups of Faces ////
+ /////////////////////////
+
+ //
+ // Comment the following lines when GetInPlace bug is solved
+ // == BEGIN
+ // Workaround of GetInPlace bug
+ // Create a bounding box that fits the shape
+ Handle(GEOM_Object) aBox = my3DPrimOperations->MakeBoxDXDYDZ(2*theL1, 2*aR1Ext, aR1Ext+theL2);
+ aBox->GetLastFunction()->SetDescription("");
+ myTransformOperations->TranslateDXDYDZ(aBox, -theL1, -aR1Ext, -aR1Ext);
+ aBox->GetLastFunction()->SetDescription("");
+ // Apply transformation to box
+ BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False);
+ TopoDS_Shape aBoxShapeTrsf = aTransformationBox.Shape();
+ aBox->GetLastFunction()->SetValue(aBoxShapeTrsf);
+
+ // Get the shell of the box
+ Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast
+ (myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1));
+ aBox->GetLastFunction()->SetDescription("");
+ aShell->GetLastFunction()->SetDescription("");
+ // Get the common shapes between shell and shape
+ Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean
+ (theShape, aShell, 1, Standard_False); // MakeCommon
+ if (aCommonCompound.IsNull()) {
+ SetErrorCode(myBooleanOperations->GetErrorCode());
+ return false;
+ }
+ aCommonCompound->GetLastFunction()->SetDescription("");
+ // Explode the faces of common shapes => 3 faces
+ Handle(TColStd_HSequenceOfTransient) aCommonFaces =
+ myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true);
+ aCommonCompound->GetLastFunction()->SetDescription("");
+ std::list<Handle(GEOM_Object)> aCompoundOfFacesList;
+
+ for (int i=0 ; i<= aCommonFaces->Length()-4 ; i+=4) {
+ std::list<Handle(GEOM_Object)> aFacesList;
+ for (int j = 1 ; j <= 4 ; j++) {
+ Handle(GEOM_Object) aFace = Handle(GEOM_Object)::DownCast(aCommonFaces->Value(i+j)); // Junction faces
+ if (!aFace.IsNull()) {
+ aFace->GetLastFunction()->SetDescription("");
+ aFacesList.push_back(aFace);
+ }
+ }
+ Handle(GEOM_Object) aCompoundOfFaces = myShapesOperations->MakeCompound(aFacesList);
+ if (!aCompoundOfFaces.IsNull()) {
+ aCompoundOfFaces->GetLastFunction()->SetDescription("");
+ aCompoundOfFacesList.push_back(aCompoundOfFaces);
+ }
+ }
+
+ if (aCompoundOfFacesList.size() == 3) {
+ Handle(GEOM_Object) aPln1 = aCompoundOfFacesList.front();
+ aCompoundOfFacesList.pop_front();
+ Handle(GEOM_Object) aPln2 = aCompoundOfFacesList.front();
+ aCompoundOfFacesList.pop_front();
+ Handle(GEOM_Object) aPln3 = aCompoundOfFacesList.front();
+ aCompoundOfFacesList.pop_front();
+ // == END
+ //
+
+
+ // Uncomment the following lines when GetInPlace bug is solved
+ // == BEGIN
+// Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0);
+// Handle(GEOM_Object) aP2 = myBasicOperations->MakePointXYZ(-0, 0, theL2);
+// Handle(GEOM_Object) aP3 = myBasicOperations->MakePointXYZ(theL1, 0, 0);
+// aP1->GetLastFunction()->SetDescription("");
+// aP2->GetLastFunction()->SetDescription("");
+// aP3->GetLastFunction()->SetDescription("");
+// Handle(GEOM_Object) aV1 = myBasicOperations->MakeVectorDXDYDZ(-1, 0, 0);
+// Handle(GEOM_Object) aV2 = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
+// Handle(GEOM_Object) aV3 = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
+// aV1->GetLastFunction()->SetDescription("");
+// aV2->GetLastFunction()->SetDescription("");
+// aV3->GetLastFunction()->SetDescription("");
+// Handle(GEOM_Object) aPln1 = myBasicOperations->MakePlanePntVec(aP1, aV1, 2*(aR1Ext+theL2));
+// Handle(GEOM_Object) aPln2 = myBasicOperations->MakePlanePntVec(aP2, aV2, 2*(aR2Ext));
+// Handle(GEOM_Object) aPln3 = myBasicOperations->MakePlanePntVec(aP3, aV3, 2*(aR1Ext+theL2));
+// aPln1->GetLastFunction()->SetDescription("");
+// aPln2->GetLastFunction()->SetDescription("");
+// aPln3->GetLastFunction()->SetDescription("");
+//
+// BRepBuilderAPI_Transform aTransformation1(aPln1->GetValue(), aTrsf, Standard_False);
+// TopoDS_Shape aTrsf_Shape1 = aTransformation1.Shape();
+// aPln1->GetLastFunction()->SetValue(aTrsf_Shape1);
+// BRepBuilderAPI_Transform aTransformation2(aPln2->GetValue(), aTrsf, Standard_False);
+// TopoDS_Shape aTrsf_Shape2 = aTransformation2.Shape();
+// aPln2->GetLastFunction()->SetValue(aTrsf_Shape2);
+// BRepBuilderAPI_Transform aTransformation3(aPln3->GetValue(), aTrsf, Standard_False);
+// TopoDS_Shape aTrsf_Shape3 = aTransformation3.Shape();
+// aPln3->GetLastFunction()->SetValue(aTrsf_Shape3);
+ // == END
+ //
+
+ Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1);
+ if (junctionFaces1.IsNull())
+ junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound
+ (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
+ if (!junctionFaces1.IsNull()) {
+ junctionFaces1->GetLastFunction()->SetDescription("");
+ junctionFaces1->SetName("JUNCTION_FACE_1");
+ theSeq->Append(junctionFaces1);
+ }
+ else {
+ SetErrorCode("Junction face 1 not found");
+ // theSeq->Append(aPln1);
+ // return false;
+ }
+ Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2);
+ if (junctionFaces2.IsNull())
+ junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound
+ (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
+ if (!junctionFaces2.IsNull()) {
+ junctionFaces2->GetLastFunction()->SetDescription("");
+ junctionFaces2->SetName("JUNCTION_FACE_2");
+ theSeq->Append(junctionFaces2);
+ }
+ else {
+ SetErrorCode("Junction face 2 not found");
+ // theSeq->Append(aPln2);
+ // return false;
+ }
+ Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3);
+ if (junctionFaces3.IsNull())
+ junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound
+ (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
+ if (!junctionFaces3.IsNull()) {
+ junctionFaces3->GetLastFunction()->SetDescription("");
+ junctionFaces3->SetName("JUNCTION_FACE_3");
+ theSeq->Append(junctionFaces3);
+ }
+ else {
+ SetErrorCode("Junction face 3 not found");
+ // theSeq->Append(aPln3);
+ // return false;
+ }
+ // Comment the following lines when GetInPlace bug is solved
+ // == BEGIN
+ }
+ // == END
+
+ /////////////////////////
+ //// Groups of Edges ////
+ /////////////////////////
+ // Result of propagate
+
+ Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
+
+ TCollection_AsciiString theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) aSeqPropagate = myBlocksOperations->Propagate(theShape);
+ if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) {
+ SetErrorCode("Propagation groups not found");
+ return false;
+ }
+ Standard_Integer aNbGroups = aSeqPropagate->Length();
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+
+#ifdef FIND_GROUPS_BY_POINTS
+ // BEGIN: new groups search
+
+ // W2 R2
+ // .----.-----.----.
+ // e| | | | |
+ // | | | | |
+ // . | | | .
+ // g / ''..| | |..'' \
+ // f / ''''''' \
+ // .---.--'.. | | | ..'--.---.
+ // |a \ '''...........''' / |
+ // |-------\------' | '------/-------.
+ // | \ | / |
+ // c| \ | / |
+ // | R1 \ | / |
+ // | \ | / |
+ // ._________________|_________________.
+ // | L1 | |
+ // | | |
+ // | | |
+ // b| | |
+ // | | |
+ // |-----------------|-----------------|
+ // | W1 | |
+ // '-----------------'-----------------'
+ // d
+
+ // "Thickness" group (a)
+ gp_Pnt aPntA (-theL1, 0, theR1 + theW1/2.);
+ aPntA.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexA (aPntA);
+ TopoDS_Vertex aVertA = TopoDS::Vertex(mkVertexA.Shape());
+ TopoDS_Shape anEdgeA = GEOMUtils::GetEdgeNearPoint(aShape, aVertA);
+
+ // "Circular quarter of pipe" group (b)
+ gp_Pnt aPntB (-theL1, -aR1Ext * sin(M_PI/4.), -aR1Ext * sin(M_PI/4.));
+ aPntB.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexB (aPntB);
+ TopoDS_Vertex aVertB = TopoDS::Vertex(mkVertexB.Shape());
+ TopoDS_Shape anEdgeB = GEOMUtils::GetEdgeNearPoint(aShape, aVertB);
+
+ // "Circular quarter of pipe" group (c)
+ gp_Pnt aPntC (-theL1, -aR1Ext * sin(M_PI/4.), aR1Ext * sin(M_PI/4.));
+ aPntC.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexC (aPntC);
+ TopoDS_Vertex aVertC = TopoDS::Vertex(mkVertexC.Shape());
+ TopoDS_Shape anEdgeC = GEOMUtils::GetEdgeNearPoint(aShape, aVertC);
+
+ // "Main pipe half length" group (d)
+ gp_Pnt aPntD (-theL1/2., 0, -aR1Ext);
+ aPntD.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexD (aPntD);
+ TopoDS_Vertex aVertD = TopoDS::Vertex(mkVertexD.Shape());
+ TopoDS_Shape anEdgeD = GEOMUtils::GetEdgeNearPoint(aShape, aVertD);
+
+ // "Incident pipe half length" group (e)
+ double aTol10 = Precision::Confusion() * 10.;
+ gp_Pnt aPntE (-aR2Ext, 0, theL2 - aTol10);
+ aPntE.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexE (aPntE);
+ TopoDS_Vertex aVertE = TopoDS::Vertex(mkVertexE.Shape());
+ TopoDS_Shape anEdgeE = GEOMUtils::GetEdgeNearPoint(aShape, aVertE);
+
+ // "Flange" group (f)
+ double aFx = - aR2Ext - aTol10;
+ if (shapeType == TSHAPE_CHAMFER)
+ aFx -= theW;
+ else if (shapeType == TSHAPE_FILLET)
+ aFx -= theRF;
+ gp_Pnt aPntF (aFx, 0, aR1Ext);
+ aPntF.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexF (aPntF);
+ TopoDS_Vertex aVertF = TopoDS::Vertex(mkVertexF.Shape());
+ TopoDS_Shape anEdgeF = GEOMUtils::GetEdgeNearPoint(aShape, aVertF);
+
+ // "Chamfer or Fillet" group (g)
+ TopoDS_Shape anEdgeG;
+ if (shapeType == TSHAPE_CHAMFER) {
+ gp_Pnt aPntG (-aR2Ext - theW/2., 0, aR1Ext + theH/2.);
+ aPntG.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexG (aPntG);
+ TopoDS_Vertex aVertG = TopoDS::Vertex(mkVertexG.Shape());
+ anEdgeG = GEOMUtils::GetEdgeNearPoint(aShape, aVertG);
+ }
+ else if (shapeType == TSHAPE_FILLET) {
+ gp_Pnt aPntG (-aR2Ext - theRF/2., 0, aR1Ext + theRF/2.);
+ aPntG.Transform(aTrsf);
+ BRepBuilderAPI_MakeVertex mkVertexG (aPntG);
+ TopoDS_Vertex aVertG = TopoDS::Vertex(mkVertexG.Shape());
+ anEdgeG = GEOMUtils::GetEdgeNearPoint(aShape, aVertG);
+ }
+
+ for (int i = 1 ; i <= aNbGroups; i++) {
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i));
+ if (aGroup.IsNull())
+ continue;
+
+ TopoDS_Shape aGroupShape = aGroup->GetValue();
+ TopTools_IndexedMapOfShape anEdgesMap;
+ TopExp::MapShapes(aGroupShape, TopAbs_EDGE, anEdgesMap);
+
+ if (anEdgesMap.Contains(anEdgeA)) { // a
+ aGroup->SetName("THICKNESS");
+ theSeq->Append(aGroup);
+ }
+ else if (anEdgesMap.Contains(anEdgeB)) { // b
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ theSeq->Append(aGroup);
+ }
+ else if (anEdgesMap.Contains(anEdgeC)) { // c
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ theSeq->Append(aGroup);
+ }
+ else if (anEdgesMap.Contains(anEdgeD)) { // d
+ aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
+ theSeq->Append(aGroup);
+ }
+ else if (anEdgesMap.Contains(anEdgeE)) { // e
+ aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
+ theSeq->Append(aGroup);
+ }
+ else if (anEdgesMap.Contains(anEdgeF)) { // f
+ aGroup->SetName("FLANGE");
+ theSeq->Append(aGroup);
+ }
+ else if (shapeType == TSHAPE_CHAMFER) { // g
+ if (anEdgesMap.Contains(anEdgeG)) {
+ aGroup->SetName("CHAMFER");
+ theSeq->Append(aGroup);
+ }
+ }
+ else if (shapeType == TSHAPE_FILLET) { // g
+ if (anEdgesMap.Contains(anEdgeG)) {
+ aGroup->SetName("FILLET");
+ theSeq->Append(aGroup);
+ }
+ }
+ else {
+ }
+ }
+ // END: new groups search
+#else
+ bool addGroup;
+ bool circularFoundAndAdded = false;
+ bool circularFound10 = false;
+ bool incidentPipeFound = false;
+ bool mainPipeFound = false;
+ bool mainPipeFoundAndAdded = false;
+ bool radialFound =false;
+ bool flangeFound = false;
+ bool flangeFoundAndAdded = false;
+ bool chamferOrFilletFound = false;
+
+ for (int i = 1 ; i <= aNbGroups; i++) {
+ addGroup = false;
+
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i));
+ if (aGroup.IsNull())
+ continue;
+
+ TopoDS_Shape aGroupShape = aGroup->GetValue();
+ BRepBuilderAPI_Transform aTransformationShapeInv (aGroupShape, aTrsfInv, Standard_False);
+ TopoDS_Shape aGroupShapeTrsfInv = aTransformationShapeInv.Shape();
+
+ TopTools_IndexedMapOfShape anEdgesMap;
+ TopExp::MapShapes(aGroupShapeTrsfInv,TopAbs_EDGE, anEdgesMap);
+ Standard_Integer nbEdges = anEdgesMap.Extent();
+
+ if (shapeType == TSHAPE_BASIC) {
+ if ((nbEdges >= 21) || /*R1Ext = R2Ext*/(nbEdges == 17)) { // 17, 17+8*{1,2,3}, 21, 21+8*{1,2,3}
+ addGroup = true;
+ aGroup->SetName("THICKNESS");
+ }
+ else if (nbEdges == 6) {
+ if (!circularFoundAndAdded) {
+ circularFoundAndAdded = true;
+ addGroup = true;
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ }
+ }
+ else if (nbEdges == 8) {
+ incidentPipeFound = true;
+ mainPipeFound = false;
+ radialFound = false;
+ flangeFound = false;
+
+ TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX);
+ while (Ex.More()) {
+ gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ double x=aP.X(), y=aP.Y(), z=aP.Z();
+
+
+ if ((Abs(x) > aR2Ext + Precision::Confusion()) ||
+ (Abs(y) > aR2Ext + Precision::Confusion())) {
+ incidentPipeFound = false;
+ }
+
+ if ( z < -Precision::Confusion()) {
+ // length of main pipe
+ mainPipeFound = true;
+ if (!mainPipeFoundAndAdded) {
+ mainPipeFoundAndAdded = true;
+ addGroup = true;
+ aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
+ }
+ }
+
+ else if (Abs(x) > (theL1-Precision::Confusion())) {
+ // discretisation circulaire
+ radialFound = true;
+ if (!circularFoundAndAdded) {
+ circularFoundAndAdded = true;
+ addGroup = true;
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ }
+ }
+ Ex.Next();
+ }
+ if (incidentPipeFound) {
+ addGroup = true;
+ aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
+ }
+ if (!addGroup && (!incidentPipeFound &&
+ !radialFound &&
+ !mainPipeFound &&
+ !flangeFound)) {
+ // Flange (collerette)
+ flangeFound = true;
+ addGroup = true;
+ aGroup->SetName("FLANGE");
+ }
+ }
+ else
+ continue;
+ }
+ else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) {
+ if (nbEdges >= 25) { // 25, 25+8, 25+16, 25+24
+ addGroup = true;
+ aGroup->SetName("THICKNESS");
+ }
+ else if ((nbEdges == 10) || (nbEdges == 6)) {
+ if (!circularFoundAndAdded) {
+ addGroup = true;
+ circularFoundAndAdded = true;
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ if (nbEdges == 10) {
+ circularFound10 = true;
+ }
+ }
+ else if (!circularFound10 && nbEdges == 10) {
+ circularFound10 = true;
+ addGroup = true;
+ aGroup->SetName("CIRCULAR_QUARTER_PIPE");
+ }
+ }
+ else if (nbEdges == 8) {
+ incidentPipeFound = true;
+ mainPipeFound = true;
+ flangeFound = false;
+
+ bool isNearZ0 = false;
+ bool isBelowZ0 = false;
+
+ TopExp_Explorer Ex (aGroupShapeTrsfInv,TopAbs_VERTEX);
+ while (Ex.More()) {
+ gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ double x=aP.X(), y=aP.Y(), z=aP.Z();
+
+ // tuy_princ_long_avant & tuy_princ_long_apres
+ //bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) &&
+ // ((y <= aR1Ext + Precision::Confusion()) ||
+ // (y <= -(aR1Ext + Precision::Confusion())) ||
+ // (y <= theR1 + Precision::Confusion()) ||
+ // (y == -(theR1 + Precision::Confusion()))));
+ bool isMain = ((z < Precision::Confusion() || x < Precision::Confusion()) &&
+ (fabs(y) > theR1 - Precision::Confusion() ||
+ fabs(y) < Precision::Confusion()));
+
+ if (!isMain) {
+ mainPipeFound = false;
+ }
+
+ // collerette
+ //if (z < Precision::Confusion() && !isMain) {
+ // flangeFound = true;
+ // if (!flangeFoundAndAdded) {
+ // flangeFoundAndAdded = true;
+ // addGroup = true;
+ // aGroup->SetName("FLANGE");
+ // }
+ //}
+ if (fabs(z) < Precision::Confusion()) isNearZ0 = true;
+ if (z < - Precision::Confusion()) isBelowZ0 = true;
+
+ // tuyau incident
+ if ((Abs(x) > aR2Ext + Precision::Confusion()) ||
+ (Abs(y) > aR2Ext + Precision::Confusion())) {
+ incidentPipeFound = false;
+ }
+ Ex.Next();
+ }
+ if (mainPipeFound) {
+ addGroup = true;
+ aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
+ }
+ if (incidentPipeFound) {
+ addGroup = true;
+ aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
+ }
+ if (isNearZ0 && !isBelowZ0) {
+ flangeFound = true;
+ if (!flangeFoundAndAdded) {
+ flangeFoundAndAdded = true;
+ addGroup = true;
+ aGroup->SetName("FLANGE");
+ }
+ }
+ if (!addGroup && (!incidentPipeFound &&
+ !mainPipeFound &&
+ !flangeFound &&
+ !chamferOrFilletFound)) {
+ addGroup = true;
+ chamferOrFilletFound = true;
+ if (shapeType == TSHAPE_CHAMFER)
+ aGroup->SetName("CHAMFER");
+ else
+ aGroup->SetName("FILLET");
+ }
+ }
+ else
+ continue;
+ }
+ // Add group to the list
+ if (addGroup)
+ theSeq->Append(aGroup);
+ }
+#endif
+
+ SetErrorCode(OK);
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Return faces that are laying on surface.
+ */
+//=============================================================================
+bool AdvancedEngine_IOperations::GetFacesOnSurf
+ (const TopoDS_Shape &theShape,
+ const Handle_Geom_Surface& theSurface,
+ const Standard_Real theTolerance,
+ TopTools_ListOfShape &theFaces)
+{
+ GEOMAlgo_FinderShapeOn1 aFinder;
+
+ aFinder.SetShape(theShape);
+ aFinder.SetTolerance(theTolerance);
+ aFinder.SetSurface(theSurface);
+ aFinder.SetShapeType(TopAbs_FACE);
+ aFinder.SetState(GEOMAlgo_ST_ON);
+
+ // Sets the minimal number of inner points for the faces that do not have own
+ // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
+ // Default value=3
+ aFinder.SetNbPntsMin(3);
+ // Sets the maximal number of inner points for edges or faces.
+ // It is usefull for the cases when this number is very big (e.g =2000) to improve
+ // the performance. If this value =0, all inner points will be taken into account.
+ // Default value=0
+ aFinder.SetNbPntsMax(100);
+ aFinder.Perform();
+
+ // Interprete results
+ Standard_Integer iErr = aFinder.ErrorStatus();
+ // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+ if (iErr) {
+ MESSAGE(" iErr : " << iErr);
+ TCollection_AsciiString aMsg (" iErr : ");
+ aMsg += TCollection_AsciiString(iErr);
+ SetErrorCode(aMsg);
+ return false;
+ }
+ Standard_Integer iWrn = aFinder.WarningStatus();
+ // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+ if (iWrn) {
+ MESSAGE(" *** iWrn : " << iWrn);
+ }
+
+ const TopTools_ListOfShape &aListRes = aFinder.Shapes(); // the result
+ TopTools_ListIteratorOfListOfShape anIter (aListRes);
+
+ for (; anIter.More(); anIter.Next()) {
+ theFaces.Append(anIter.Value());
+ }
+
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Creates and returns conical face.
+ */
+//=============================================================================
+TopoDS_Shape AdvancedEngine_IOperations::MakeConicalFace
+ (const gp_Ax2 &theAxis,
+ const double theRadius,
+ const double theRadiusThin,
+ const double theHeight,
+ const gp_Trsf &theTrsf)
+{
+ BRepPrimAPI_MakeCone aMkCone (theAxis, theRadius, theRadiusThin, theHeight);
+ TopoDS_Shape aResult;
+
+ aMkCone.Build();
+ if (aMkCone.IsDone()) {
+ TopExp_Explorer anExp(aMkCone.Shape(), TopAbs_FACE);
+
+ for (; anExp.More(); anExp.Next()) {
+ TopoDS_Face aFace = TopoDS::Face(anExp.Current());
+
+ if (aFace.IsNull() == Standard_False) {
+ BRepAdaptor_Surface anAdaptor(aFace, Standard_False);
+
+ if (anAdaptor.GetType() == GeomAbs_Cone) {
+ // This is a conical face. Transform and return it.
+ BRepBuilderAPI_Transform aTransf(aFace, theTrsf, Standard_False);
+
+ aResult = aTransf.Shape();
+ break;
+ }
+ }
+ }
+ }
+
+ return aResult;
+}
+
+//=============================================================================
+/*!
+ * Generate the internal group of a Pipe T-Shape
+ */
+//=============================================================================
+bool AdvancedEngine_IOperations::MakeInternalGroup
+ (const Handle(GEOM_Object) &theShape,
+ const double theR1, const double theLen1,
+ const double theR2, const double theLen2,
+ const double theRL, double theTransLenL,
+ const double theRR, double theTransLenR,
+ const double theRI, double theTransLenI,
+ const Handle(TColStd_HSequenceOfTransient) &theSeq,
+ const gp_Trsf &theTrsf)
+{
+ SetErrorCode(KO);
+
+ if (theShape.IsNull()) {
+ return false;
+ }
+
+ TopoDS_Shape aShape = theShape->GetValue();
+
+ if (aShape.IsNull()) {
+ SetErrorCode("Shape is not defined");
+ return false;
+ }
+
+ // Compute tolerance
+ Standard_Real aMaxTol = -RealLast();
+ TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
+
+ for (; anExp.More(); anExp.Next()) {
+ TopoDS_Vertex aVertex = TopoDS::Vertex(anExp.Current());
+
+ if (aVertex.IsNull() == Standard_False) {
+ const Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
+
+ if (aTol > aMaxTol) {
+ aMaxTol = aTol;
+ }
+ }
+ }
+
+ // Construct internal surfaces.
+ Standard_Integer i = 0;
+ const Standard_Integer aMaxNbSurf = 5;
+ Handle(Geom_Surface) aSurface[aMaxNbSurf];
+ TopTools_ListOfShape aConicalFaces;
+ Standard_Real aTolConf = Precision::Confusion();
+
+ // 1. Construct the internal surface of main pipe.
+ gp_Ax2 anAxis1 (gp::Origin(), gp::DX(), gp::DZ());
+ gp_Ax2 anAxis2 (gp::Origin(), gp::DZ(), gp::DX());
+
+ aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theR1);
+
+ // 2. Construct the internal surface of incident pipe.
+ aSurface[i++] = new Geom_CylindricalSurface(anAxis2, theR2);
+
+ // 3. Construct the internal surface of left reduction pipe.
+ if (theRL > aTolConf) {
+ aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theRL);
+
+ if (theTransLenL > aTolConf) {
+ // 3.1. Construct the internal surface of left transition pipe.
+ gp_Pnt aPLeft (-theLen1, 0., 0.);
+ gp_Ax2 anAxisLeft (aPLeft, -gp::DX(), gp::DZ());
+ TopoDS_Shape aConeLeft =
+ MakeConicalFace(anAxisLeft, theR1, theRL, theTransLenL, theTrsf);
+
+ if (aConeLeft.IsNull() == Standard_False) {
+ aConicalFaces.Append(aConeLeft);
+ }
+ }
+ }
+
+ // 4. Construct the internal surface of right reduction pipe.
+ if (theRR > aTolConf) {
+ // There is no need to construct another cylinder of the same radius. Skip it.
+ if (Abs(theRR - theRL) > aTolConf) {
+ aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theRR);
+ }
+
+ if (theTransLenL > aTolConf) {
+ // 4.1. Construct the internal surface of right transition pipe.
+ gp_Pnt aPRight (theLen1, 0., 0.);
+ gp_Ax2 anAxisRight (aPRight, gp::DX(), gp::DZ());
+ TopoDS_Shape aConeRight =
+ MakeConicalFace(anAxisRight, theR1, theRR, theTransLenR, theTrsf);
+
+ if (aConeRight.IsNull() == Standard_False) {
+ aConicalFaces.Append(aConeRight);
+ }
+ }
+ }
+
+ // 5. Construct the internal surface of incident reduction pipe.
+ if (theRI > aTolConf) {
+ aSurface[i++] = new Geom_CylindricalSurface(anAxis2, theRI);
+
+ if (theTransLenI > aTolConf) {
+ // 5.1. Construct the internal surface of incident transition pipe.
+ gp_Pnt aPInci (0., 0., theLen2);
+ gp_Ax2 anAxisInci (aPInci, gp::DZ(), gp::DX());
+ TopoDS_Shape aConeInci =
+ MakeConicalFace(anAxisInci, theR2, theRI, theTransLenI, theTrsf);
+
+ if (aConeInci.IsNull() == Standard_False) {
+ aConicalFaces.Append(aConeInci);
+ }
+ }
+ }
+
+ // Get faces that are laying on cylindrical surfaces.
+ TopTools_ListOfShape aFaces;
+ gp_Trsf anInvTrsf = theTrsf.Inverted();
+
+ for (i = 0; i < aMaxNbSurf; i++) {
+ if (aSurface[i].IsNull()) {
+ break;
+ }
+
+ aSurface[i]->Transform(theTrsf);
+
+ TopTools_ListOfShape aLocalFaces;
+
+ if (!GetFacesOnSurf(aShape, aSurface[i], aMaxTol, aLocalFaces)) {
+ return false;
+ }
+
+ if (i < 2) {
+ // Check if the result contains outer cylinders.
+ // It is required for main and incident pipes.
+ TopTools_ListIteratorOfListOfShape anIter(aLocalFaces);
+
+ while (anIter.More()) {
+ TopExp_Explorer anExp(anIter.Value(), TopAbs_VERTEX);
+ Standard_Boolean isInside = Standard_False;
+
+ // Get a vertex from this shape
+ if (anExp.More()) {
+ TopoDS_Vertex aVtx = TopoDS::Vertex(anExp.Current());
+
+ if (aVtx.IsNull() == Standard_False) {
+ gp_Pnt aPnt = BRep_Tool::Pnt(aVtx);
+
+ aPnt.Transform(anInvTrsf);
+
+ if (i == 0) {
+ // Check if the point is inside the main pipe.
+ isInside = (Abs(aPnt.X()) <= theLen1);
+ } else { // i == 1
+ // Check if the point is inside the incident pipe.
+ isInside = (aPnt.Z() <= theLen2);
+ }
+ }
+ }
+
+ if (isInside) {
+ // Keep this face.
+ anIter.Next();
+ } else {
+ // Remove this face.
+ aLocalFaces.Remove(anIter);
+ }
+ }
+ }
+
+ aFaces.Append(aLocalFaces);
+ }
+
+ // Get faces that are laying on conical faces.
+ if (aConicalFaces.IsEmpty() == Standard_False) {
+ Handle(GEOM_Object) aCone =
+ GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Function) aFunction =
+ aCone->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
+ TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces);
+ Handle(GEOM_Object) aConeFromShape;
+
+ for (; aFIter.More(); aFIter.Next()) {
+ aFunction->SetValue(aFIter.Value());
+ aConeFromShape = myShapesOperations->GetInPlace(theShape, aCone);
+
+ if (aConeFromShape.IsNull() == Standard_False) {
+ aConeFromShape->GetLastFunction()->SetDescription("");
+ TopoDS_Shape aConeFaces = aConeFromShape->GetValue();
+ TopExp_Explorer anExp(aConeFaces, TopAbs_FACE);
+
+ for (; anExp.More(); anExp.Next()) {
+ TopoDS_Face aConeFace = TopoDS::Face(anExp.Current());
+
+ if (aConeFace.IsNull() == Standard_False) {
+ aFaces.Append(aConeFace);
+ }
+ }
+ }
+ }
+ }
+
+ // Create a group of internal faces.
+ if (aFaces.IsEmpty() == Standard_False) {
+ Handle(GEOM_Object) aGroup = myGroupOperations->CreateGroup(theShape, TopAbs_FACE);
+
+ if (aGroup.IsNull() == Standard_False) {
+ aGroup->GetLastFunction()->SetDescription("");
+ aGroup->SetName("INTERNAL_FACES");
+
+ TopTools_IndexedMapOfShape anIndices;
+ Handle(TColStd_HSequenceOfInteger) aSeqIDs = new TColStd_HSequenceOfInteger;
+
+ TopExp::MapShapes(aShape, anIndices);
+
+ TopTools_ListIteratorOfListOfShape anIter(aFaces);
+
+ for (; anIter.More(); anIter.Next()) {
+ const TopoDS_Shape &aFace = anIter.Value();
+ const Standard_Integer anIndex = anIndices.FindIndex(aFace);
+
+ if (anIndex > 0) {
+ aSeqIDs->Append(anIndex);
+ }
+ }
+
+ myGroupOperations->UnionIDs(aGroup, aSeqIDs);
+ aGroup->GetLastFunction()->SetDescription("");
+ theSeq->Append(aGroup);
+ }
+ }
+
+ SetErrorCode(OK);
+
+ return true;
+}
+
+bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theH, double theW,
+ double theRF, bool isNormal)
+{
+ SetErrorCode(KO);
+
+ // Build tools for partition operation:
+ // 1 face and 2 planes
+ // Face
+ Handle(GEOM_Object) arete_intersect_int, arete_intersect_ext;
+ Handle(GEOM_Object) wire_t, wire_t2, face_t, face_t2;
+ Handle(GEOM_Object) chan_racc;
+ Handle(GEOM_Object) vi1, vi2;
+ Handle(GEOM_Object) Te3;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
+ Vector_Z->GetLastFunction()->SetDescription("");
+
+ // Useful values
+ double aSize = 2*(theL1 + theL2);
+ double aR1Ext = theR1 + theW1;
+ double aR2Ext = theR2 + theW2;
+ double theVertCylinderRadius = aR2Ext + theW + theRF;
+ double theHoriCylinderRadius = aR1Ext + theH + theRF;
+
+ // Common edges on internal cylinder
+ Handle(GEOM_Object) box_i = my3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1);
+ box_i->GetLastFunction()->SetDescription("");
+ box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0);
+ box_i->GetLastFunction()->SetDescription("");
+
+ Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
+ TCollection_AsciiString theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) edges_i =
+ myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+ if (edges_i.IsNull() || edges_i->Length() == 0) {
+ SetErrorCode("Internal edges not found");
+ return false;
+ }
+ for (int i=1; i<=edges_i->Length();i++) {
+ Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_i->Value(i));
+ anObj->GetLastFunction()->SetDescription("");
+ }
+ arete_intersect_int = Handle(GEOM_Object)::DownCast(edges_i->Value(1));
+
+ // search for vertices located on both internal pipes
+ aFunction = theShape->GetLastFunction();
+ theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) vertices_i =
+ myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+ if (vertices_i.IsNull() || vertices_i->Length() == 0) {
+ SetErrorCode("Internal vertices not found");
+ return false;
+ }
+
+ double d1min = theR2+theW2, d2min=theR2+theW2;
+ for (int i = 1; i <= vertices_i->Length(); i++) {
+ Handle(GEOM_Object) v = Handle(GEOM_Object)::DownCast(vertices_i->Value(i));
+ v->GetLastFunction()->SetDescription("");
+ TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue());
+ gp_Pnt aP = BRep_Tool::Pnt(aVertex);
+ if (Abs(aP.X()) <= Precision::Confusion()) {
+ if (Abs(aP.Y()) < d1min) {
+ vi1 = v;
+ d1min = Abs(aP.Y());
+ }
+ } else if (Abs(aP.Y()) <= Precision::Confusion()) {
+ if (Abs(aP.X()) < d2min) {
+ vi2 = v;
+ d2min = Abs(aP.X());
+ }
+ }
+ }
+ if (vi1.IsNull() || vi2.IsNull()) {
+ SetErrorCode("Cannot find internal intersection vertices");
+ return false;
+ }
+
+ std::list<Handle(GEOM_Object)> theShapes;
+
+ if (isNormal) {
+ Handle(GEOM_Object) ve1, ve2;
+ TopoDS_Vertex vertex1, vertex2;
+
+ Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(aR2Ext, aR2Ext, aR1Ext);
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ(box_e, -aR2Ext, -aR2Ext, 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ // search for vertices located on both external pipes
+ aFunction = theShape->GetLastFunction();
+ theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) vertices_e =
+ myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+ if (vertices_e.IsNull() || vertices_e->Length() == 0) {
+ SetErrorCode("External vertices not found");
+ return false;
+ }
+
+ double d1max = 0, d2max = 0;
+ for (int i = 1; i <= vertices_e->Length(); i++) {
+ Handle(GEOM_Object) v = Handle(GEOM_Object)::DownCast(vertices_e->Value(i));
+ v->GetLastFunction()->SetDescription("");
+ TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue());
+ gp_Pnt aP = BRep_Tool::Pnt(aVertex);
+ if (Abs(aP.X()) <= Precision::Confusion()) {
+ if (Abs(aP.Y()) > d1max) {
+ ve1 = v;
+ vertex1 = aVertex;
+ d1max = Abs(aP.Y());
+ }
+ } else if (Abs(aP.Y()) <= Precision::Confusion()) {
+ if (Abs(aP.X()) > d2max) {
+ ve2 = v;
+ vertex2 = aVertex;
+ d2max = Abs(aP.X());
+ }
+ }
+ }
+ if (ve1.IsNull() || ve2.IsNull()) {
+ SetErrorCode("Cannot find external intersection vertices");
+ return false;
+ }
+ Handle(GEOM_Object) edge_e1, edge_e2;
+
+ // Common edges on external cylinder
+ aFunction = theShape->GetLastFunction();
+ theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) edges_e =
+ myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ SetErrorCode("External edges not found");
+ return false;
+ }
+ ShapeAnalysis_Edge sae;
+ for (int i=1; i<=edges_e->Length();i++) {
+ Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
+ anObj->GetLastFunction()->SetDescription("");
+ TopoDS_Edge anEdge = TopoDS::Edge(anObj->GetValue());
+ if ( !anEdge.IsNull() &&
+ (sae.FirstVertex(anEdge).IsSame(vertex1) || sae.LastVertex(anEdge).IsSame(vertex1)) &&
+ (sae.FirstVertex(anEdge).IsSame(vertex2) || sae.LastVertex(anEdge).IsSame(vertex2))) {
+ arete_intersect_ext = anObj;
+ }
+ }
+
+ edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1);
+ if (edge_e1.IsNull()) {
+ SetErrorCode("Edge 1 could not be built");
+ return false;
+ }
+
+ edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2);
+ if (edge_e2.IsNull()) {
+ SetErrorCode("Edge 2 could not be built");
+ return false;
+ }
+
+ edge_e1->GetLastFunction()->SetDescription("");
+ edge_e2->GetLastFunction()->SetDescription("");
+
+ std::list<Handle(GEOM_Object)> edge_e_elist;
+ edge_e_elist.push_back(arete_intersect_int);
+ edge_e_elist.push_back(edge_e1);
+ edge_e_elist.push_back(arete_intersect_ext);
+ edge_e_elist.push_back(edge_e2);
+ wire_t = myShapesOperations->MakeWire(edge_e_elist, 1e-7);
+ if (wire_t.IsNull()) {
+ SetErrorCode("Impossible to build wire");
+ return false;
+ }
+ wire_t->GetLastFunction()->SetDescription("");
+ face_t = myShapesOperations->MakeFace(wire_t, false);
+ if (face_t.IsNull()) {
+ SetErrorCode("Impossible to build face");
+ return false;
+ }
+ face_t->GetLastFunction()->SetDescription("");
+
+ theShapes.push_back(theShape);
+ theShapes.push_back(vi1);
+ theShapes.push_back(vi2);
+ theShapes.push_back(ve1);
+ theShapes.push_back(ve2);
+ theShapes.push_back(edge_e1);
+ theShapes.push_back(edge_e2);
+ theShapes.push_back(wire_t);
+ theShapes.push_back(face_t);
+ }
+ else {
+ Handle(GEOM_Object) P1, P2, P3, P4, P5, P6;
+ int idP1, idP2, idP3, idP4;
+ int PZX, PZY;
+ double ZX=0, ZY=0;
+ std::vector<int> LX;
+ std::vector<int> LY;
+ Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ
+ (theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius);
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ
+ (box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ aFunction = theShape->GetLastFunction();
+ theDesc = aFunction->GetDescription();
+ Handle(TColStd_HSequenceOfTransient) extremVertices =
+ myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
+ // Recover previous description to get rid of Propagate dump
+ aFunction->SetDescription(theDesc);
+
+ if (extremVertices.IsNull() || extremVertices->Length() == 0) {
+ if (theRF == 0)
+ SetErrorCode("Vertices on chamfer not found");
+ else
+ SetErrorCode("Vertices on fillet not found");
+ return false;
+ }
+
+ theShapes.push_back(theShape);
+ theShapes.push_back(box_e);
+ if (extremVertices->Length() != 6) {
+ // for (int i=1; i<=extremVertices->Length(); i++){
+ // theShapes.push_back(Handle(GEOM_Object)::DownCast(extremVertices->Value(i)));
+ // }
+ // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
+ // TopoDS_Shape aCompoundShape = aCompound->GetValue();
+ // theShape->GetLastFunction()->SetValue(aCompoundShape);
+ SetErrorCode("Bad number of vertices on chamfer found");
+ return false;
+ }
+
+ for (int i=1; i<=extremVertices->Length(); i++){
+ Handle(GEOM_Object) aV = Handle(GEOM_Object)::DownCast(extremVertices->Value(i));
+ aV->GetLastFunction()->SetDescription("");
+ gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aV->GetValue()));
+
+ if (Abs(aP.X()) <= Precision::Confusion()) {
+ if (Abs(aP.Y()) - theR2 > Precision::Confusion()) {
+ LX.push_back(i);
+ if (aP.Z()-ZX > Precision::Confusion()) {
+ ZX = aP.Z();
+ PZX = i;
+ }
+ }
+ }
+ else {
+ if (Abs(aP.X()) - theR2 > Precision::Confusion()) {
+ LY.push_back(i);
+ if (aP.Z() - ZY > Precision::Confusion()) {
+ ZY = aP.Z();
+ PZY = i;
+ }
+ }
+ }
+ }
+
+ idP2 = PZX;
+ idP4 = PZY;
+ idP1 = LX.at(0);
+ if (LX.at(0) == PZX)
+ idP1 = LX.at(1);
+ idP3 = LY.at(0);
+ if (LY.at(0) == PZY)
+ idP3 = LY.at(1);
+
+ P1 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP1));
+ P2 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP2));
+ P3 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP3));
+ P4 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP4));
+
+ Handle(GEOM_Object) Cote_1 = myBasicOperations->MakeLineTwoPnt(P1, vi1);
+ if (Cote_1.IsNull()) {
+ SetErrorCode("Impossible to build edge in thickness");
+ return false;
+ }
+ Cote_1->GetLastFunction()->SetDescription("");
+
+ Handle(GEOM_Object) Cote_2 = myBasicOperations->MakeLineTwoPnt(vi2, P3);
+ if (Cote_2.IsNull()) {
+ SetErrorCode("Impossible to build edge in thickness");
+ return false;
+ }
+ Cote_2->GetLastFunction()->SetDescription("");
+
+ // edge_chan_princ = arete du chanfrein (ou raccord) sur le tuyau principal
+ // edge_chan_inc = arete du chanfrein (ou raccord) sur le tuyau incident
+ // std::cerr << "Getting chamfer edge on main pipe" << std::endl;
+ Handle(GEOM_Object) edge_chan_princ = myBlocksOperations->GetEdge(theShape, P1, P3);
+ if (edge_chan_princ.IsNull()) {
+ SetErrorCode("Impossible to find edge on main pipe");
+ return false;
+ }
+ edge_chan_princ->GetLastFunction()->SetDescription("");
+
+ Handle(GEOM_Object) edge_chan_inc = myBlocksOperations->GetEdge(theShape, P2, P4);
+ if (edge_chan_inc.IsNull()) {
+ SetErrorCode("Impossible to find edge on incident pipe");
+ return false;
+ }
+ edge_chan_inc->GetLastFunction()->SetDescription("");
+
+ std::list<Handle(GEOM_Object)> edgeList1;
+ edgeList1.push_back(edge_chan_princ);
+ edgeList1.push_back(Cote_1);
+ edgeList1.push_back(arete_intersect_int);
+ edgeList1.push_back(Cote_2);
+
+ // std::cerr << "Creating wire 1" << std::endl;
+ wire_t = myShapesOperations->MakeWire(edgeList1, 1e-7);
+ if (wire_t.IsNull()) {
+ SetErrorCode("Impossible to build wire");
+ return false;
+ }
+ wire_t->GetLastFunction()->SetDescription("");
+
+ // std::cerr << "Creating face 1" << std::endl;
+ face_t = myShapesOperations->MakeFace(wire_t, false);
+ if (face_t.IsNull()) {
+ SetErrorCode("Impossible to build face");
+ return false;
+ }
+ face_t->GetLastFunction()->SetDescription("");
+ theShapes.push_back(face_t);
+
+ gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(P2->GetValue()));
+ gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue()));
+ double deltaZ = aP2.Z() - aP5.Z();
+ // std::cerr << "Creating new point from vi1 with deltaZ = " << deltaZ << std::endl;
+ Handle(GEOM_Object) P5bis = myTransformOperations->TranslateDXDYDZCopy(vi1, 0, 0, deltaZ);
+ if (P5bis.IsNull()) {
+ SetErrorCode("Impossible to translate vertex");
+ return false;
+ }
+ P5bis->GetLastFunction()->SetDescription("");
+
+ gp_Pnt aP4 = BRep_Tool::Pnt(TopoDS::Vertex(P4->GetValue()));
+ gp_Pnt aP6 = BRep_Tool::Pnt(TopoDS::Vertex(vi2->GetValue()));
+ deltaZ = aP4.Z() - aP6.Z();
+ // std::cerr << "Creating new point from vi2 with deltaZ = " << deltaZ << std::endl;
+ Handle(GEOM_Object) P6bis = myTransformOperations->TranslateDXDYDZCopy(vi2, 0, 0, deltaZ);
+ if (P6bis.IsNull()) {
+ SetErrorCode("Impossible to translate vertex");
+ return false;
+ }
+ P6bis->GetLastFunction()->SetDescription("");
+
+ // std::cerr << "Creating new line 1 from 2 previous points" << std::endl;
+ Handle(GEOM_Object) Cote_3 = myBasicOperations->MakeLineTwoPnt(P5bis, P2);
+ if (Cote_3.IsNull()) {
+ SetErrorCode("Impossible to build edge in thickness");
+ return false;
+ }
+ Cote_3->GetLastFunction()->SetDescription("");
+
+ // std::cerr << "Creating new line 2 from 2 previous points" << std::endl;
+ Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4);
+ if (Cote_4.IsNull()) {
+ SetErrorCode("Impossible to build edge in thickness");
+ return false;
+ }
+ Cote_4->GetLastFunction()->SetDescription("");
+
+ // std::cerr << "Creating new line 3 from 2 previous points" << std::endl;
+ Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis);
+ if (Cote_4.IsNull()) {
+ SetErrorCode("Impossible to build edge in thickness");
+ return false;
+ }
+ Cote_5->GetLastFunction()->SetDescription("");
+
+ //std::list<Handle(GEOM_Object)> edgeList2;
+ //edgeList2.push_back(edge_chan_inc);
+ //edgeList2.push_back(Cote_3);
+ //edgeList2.push_back(Cote_5);
+ //edgeList2.push_back(Cote_4);
+ // std::cerr << "Creating wire 2" << std::endl;
+ //wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7);
+ //if (wire_t2.IsNull()) {
+ // SetErrorCode("Impossible to build wire");
+ // return false;
+ //}
+ //wire_t2->GetLastFunction()->SetDescription("");
+ // std::cerr << "Creating face 2" << std::endl;
+ //face_t2 = myShapesOperations->MakeFace(wire_t2, false);
+
+ // Mantis issue 0021682
+ face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - (theR2 + theW2));
+ //face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - 2.0*theR2);
+ if (face_t2.IsNull()) {
+ SetErrorCode("Impossible to build face");
+ return false;
+ }
+ face_t2->GetLastFunction()->SetDescription("");
+ theShapes.push_back(face_t2);
+ }
+
+ // Planes
+ Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
+ Handle(GEOM_Object) aVZ = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
+ Handle(GEOM_Object) aVXZ = myBasicOperations->MakeVectorDXDYDZ(aR1Ext, 0, 0.5*(theL1+theVertCylinderRadius));
+ Handle(GEOM_Object) aPlnOZ = myBasicOperations->MakePlanePntVec(aP0, aVZ, aSize);
+ Handle(GEOM_Object) aPlnOXZ = myBasicOperations->MakePlanePntVec(aP0, aVXZ, aSize);
+ aP0->GetLastFunction()->SetDescription("");
+ aVZ->GetLastFunction()->SetDescription("");
+ aVXZ->GetLastFunction()->SetDescription("");
+ aPlnOZ->GetLastFunction()->SetDescription("");
+ aPlnOXZ->GetLastFunction()->SetDescription("");
+ theShapes.push_back(aPlnOZ);
+ theShapes.push_back(aPlnOXZ);
+
+ // Partition
+ Handle(TColStd_HSequenceOfTransient) partitionShapes = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) theTools = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) theKeepInside = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) theRemoveInside = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HArray1OfInteger) theMaterials;
+
+ partitionShapes->Append(theShape);
+ theTools->Append(aPlnOZ);
+ if (Abs(aR1Ext - aR2Ext) > Precision::Confusion())
+ theTools->Append(aPlnOXZ);
+ theTools->Append(face_t);
+ if (!isNormal)
+ theTools->Append(face_t2);
+
+ Te3 = myBooleanOperations->MakePartition
+ (partitionShapes, theTools, theKeepInside, theRemoveInside,
+ TopAbs_SOLID, false, theMaterials, 0, false, Standard_False);
+ if (Te3.IsNull()) {
+ SetErrorCode("Impossible to build partition of TShape");
+ return false;
+ }
+ Te3->GetLastFunction()->SetDescription("");
+
+ // Last verification: result should be a block
+ std::list<GEOMImpl_IBlocksOperations::BCError> errList;
+ if (!myBlocksOperations->CheckCompoundOfBlocks(Te3,errList)) {
+ SetErrorCode("TShape is not a compound of block");
+ return false;
+ }
+
+// // BEGIN Compound of created shapes - Only for debug purpose
+// theShapes.clear();
+// theShapes.push_back(theShape);
+// theShapes.push_back(aPlnOZ);
+// if (Abs(aR1Ext - aR2Ext) > Precision::Confusion() )
+// theShapes.push_back(aPlnOXZ);
+// theShapes.push_back(face_t);
+// if (!isNormal)
+// theShapes.push_back(face_t2);
+//
+// Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
+// TopoDS_Shape aCompoundShape = aCompound->GetValue();
+// theShape->GetLastFunction()->SetValue(aCompoundShape);
+// // END Compound of created shapes - Only for debug purpose
+
+ TopoDS_Shape aShape = Te3->GetValue();
+ theShape->GetLastFunction()->SetValue(aShape);
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return false;
+ }
+
+ SetErrorCode(OK);
+ return true;
+}
+
+// Mirror and glue faces
+bool AdvancedEngine_IOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2)
+{
+ SetErrorCode(KO);
+
+ // Useful values
+ double aSize = 2*(theL1 + theL2);
+ double aR1Ext = theR1 + theW1;
+
+ // Planes
+ Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
+ aP0->GetLastFunction()->SetDescription("");
+ Handle(GEOM_Object) aVX = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
+ Handle(GEOM_Object) aVY = myBasicOperations->MakeVectorDXDYDZ(0, 1, 0);
+ aVX->GetLastFunction()->SetDescription("");
+ aVY->GetLastFunction()->SetDescription("");
+ Handle(GEOM_Object) aPlane_OX = myBasicOperations->MakePlanePntVec(aP0, aVX, 2*(aR1Ext + theL2));
+ Handle(GEOM_Object) aPlane_OY = myBasicOperations->MakePlanePntVec(aP0, aVY, aSize);
+ aPlane_OX->GetLastFunction()->SetDescription("");
+ aPlane_OY->GetLastFunction()->SetDescription("");
+
+ Handle(GEOM_Object) Te4 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OX);
+ if (Te4.IsNull()) {
+ SetErrorCode("Impossible to build mirror of quarter TShape");
+ return false;
+ }
+
+ Handle(GEOM_Object) Te5 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OY);
+ if (Te5.IsNull()) {
+ SetErrorCode("Impossible to build mirror of half TShape");
+ return false;
+ }
+
+ Handle(GEOM_Object) Te6 = myTransformOperations->MirrorPlaneCopy(Te4, aPlane_OY);
+ if (Te6.IsNull()) {
+ SetErrorCode("Impossible to build mirror of half TShape");
+ return false;
+ }
+
+ std::list<Handle(GEOM_Object)> aShapesList;
+ aShapesList.push_back(theShape);
+ aShapesList.push_back(Te4);
+ aShapesList.push_back(Te5);
+ aShapesList.push_back(Te6);
+ Handle(GEOM_Object) Te7 = myShapesOperations->MakeCompound(aShapesList);
+ if (Te7.IsNull()) {
+ SetErrorCode("Impossible to build compound");
+ return false;
+ }
+
+ // Copy source shape
+ TopoDS_Shape aShapeCopy;
+ TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
+ TNaming_CopyShape::CopyTool(Te7->GetValue(), aMapTShapes, aShapeCopy);
+
+ Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
+ if (Te8.IsNull()) {
+ SetErrorCode("Impossible to glue faces of TShape");
+ return false;
+ }
+
+ TopoDS_Shape aShape = Te8->GetValue();
+ BRepCheck_Analyzer anAna (aShape, Standard_True);
+
+ if (!anAna.IsValid()) {
+ // Try to do gluing with the tolerance equal to maximal
+ // tolerance of vertices of the source shape.
+ Standard_Real aTolMax = -RealLast();
+
+ for (TopExp_Explorer ExV (aShapeCopy, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
+ TopoDS_Vertex aVertex = TopoDS::Vertex(ExV.Current());
+ Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
+
+ if (aTol > aTolMax) {
+ aTolMax = aTol;
+ }
+ }
+
+ // Perform gluing
+ Te7->GetLastFunction()->SetValue(aShapeCopy);
+ Te8 = myShapesOperations->MakeGlueFaces(Te7, aTolMax, true);
+
+ if (Te8.IsNull()) {
+ SetErrorCode("Impossible to glue faces of TShape");
+ return false;
+ }
+
+ aShape = Te8->GetValue();
+ }
+
+
+ theShape->GetLastFunction()->SetValue(aShape);
+
+ Te4->GetLastFunction()->SetDescription("");
+ Te5->GetLastFunction()->SetDescription("");
+ Te6->GetLastFunction()->SetDescription("");
+ Te7->GetLastFunction()->SetDescription("");
+ Te8->GetLastFunction()->SetDescription("");
+
+ SetErrorCode(OK);
+ return true;
+}
+
+//=======================================================================
+//function : MakePipeTShapeThicknessReduction
+//purpose : Static method. Add thiskness reduction elements at the three
+// open ends of the T-Shape.
+//=======================================================================
+TopoDS_Shape AdvancedEngine_IOperations::MakePipeTShapeThicknessReduction
+ (TopoDS_Shape theShape,
+ double r1, double w1, double l1,
+ double r2, double w2, double l2,
+ double rL, double wL, double ltransL, double lthinL,
+ double rR, double wR, double ltransR, double lthinR,
+ double rI, double wI, double ltransI, double lthinI,
+ bool fuseReductions)
+{
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ //
+ // ---------------------.
+ // W \
+ // ---------------------. \
+ // ^ \ '-----------------.
+ // |R \ Wthin |
+ // | '-----------------'
+ // v Rthin
+ // --.--.--.--.--.--.--.--.--.--.--.--.--.--.--
+ // Ltrans Lthin
+
+ TopoDS_Shape aResult = theShape;
+ double aTol = Precision::Confusion();
+
+ gp_Vec aVX = gp::DX(), aVZ = gp::DZ();
+
+ // Left reduction (rL, wL, ltransL, lthinL)
+ if (rL > aTol && wL > aTol && ltransL > aTol) {
+ gp_Pnt aPLeft (-l1, 0, 0);
+ gp_Ax2 anAxesLeft (aPLeft, -aVX, aVZ);
+ TopoDS_Shape aReductionLeft = AdvancedEngine_IOperations::MakeThicknessReduction
+ (anAxesLeft, r1, w1, rL, wL, ltransL, lthinL, fuseReductions);
+
+ if (fuseReductions) {
+ BRepAlgoAPI_Fuse fuseL (aResult, aReductionLeft);
+ if (!fuseL.IsDone())
+ StdFail_NotDone::Raise("Cannot fuse Te with left reduction");
+ aResult = fuseL.Shape();
+ }
+ else {
+ BRep_Builder B;
+ TopoDS_Compound C;
+ B.MakeCompound(C);
+ B.Add(C, aResult);
+ B.Add(C, aReductionLeft);
+ aResult = C;
+ }
+ }
+
+ // Right reduction
+ if (rR > aTol && wR > aTol && ltransR > aTol) {
+ gp_Pnt aPRight (l1, 0, 0);
+ gp_Ax2 anAxesRight (aPRight, aVX, aVZ);
+ TopoDS_Shape aReductionRight = AdvancedEngine_IOperations::MakeThicknessReduction
+ (anAxesRight, r1, w1, rR, wR, ltransR, lthinR, fuseReductions);
+
+ if (fuseReductions) {
+ BRepAlgoAPI_Fuse fuseR (aResult, aReductionRight);
+ if (!fuseR.IsDone())
+ StdFail_NotDone::Raise("Cannot fuse Te with right reduction");
+ aResult = fuseR.Shape();
+ }
+ else {
+ BRep_Builder B;
+ TopoDS_Compound C;
+ B.MakeCompound(C);
+ B.Add(C, aResult);
+ B.Add(C, aReductionRight);
+ aResult = C;
+ }
+ }
+
+ // Incident reduction
+ if (rI > aTol && wI > aTol && ltransI > aTol) {
+ gp_Pnt aPInci (0, 0, l2);
+ gp_Ax2 anAxesInci (aPInci, aVZ, aVX);
+ TopoDS_Shape aReductionInci = AdvancedEngine_IOperations::MakeThicknessReduction
+ (anAxesInci, r2, w2, rI, wI, ltransI, lthinI, fuseReductions);
+
+ if (fuseReductions) {
+ BRepAlgoAPI_Fuse fuseInci (aResult, aReductionInci);
+ if (!fuseInci.IsDone())
+ StdFail_NotDone::Raise("Cannot fuse Te with incident reduction");
+ aResult = fuseInci.Shape();
+ }
+ else {
+ BRep_Builder B;
+ TopoDS_Compound C;
+ B.MakeCompound(C);
+ B.Add(C, aResult);
+ B.Add(C, aReductionInci);
+ aResult = C;
+ }
+ }
+
+ // Get rid of extra compounds
+ TopTools_ListOfShape listShapeRes;
+ GEOMUtils::AddSimpleShapes(aResult, listShapeRes);
+ aResult = listShapeRes.First(); // useful for the case "fuseReductions == true"
+
+ if (!fuseReductions && listShapeRes.Extent() > 1) {
+ // Simplify T-Shape compound (get rid of sub-compounds) and glue duplicated faces
+ BRep_Builder B;
+ TopoDS_Compound C;
+ B.MakeCompound(C);
+
+ TopTools_ListIteratorOfListOfShape itSub (listShapeRes);
+ for (; itSub.More(); itSub.Next())
+ B.Add(C, itSub.Value());
+
+ // GlueFaces
+ aResult = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+ }
+
+ return aResult;
+}
+
+//=======================================================================
+//function : MakeThicknessReduction
+//purpose : Static method. Create one thickness reduction element.
+//=======================================================================
+TopoDS_Shape AdvancedEngine_IOperations::MakeThicknessReduction (gp_Ax2 theAxes,
+ const double R, const double W,
+ const double Rthin, const double Wthin,
+ const double Ltrans, const double Lthin,
+ bool fuse)
+{
+ double aTol = Precision::Confusion();
+ if (Rthin < aTol || Wthin < aTol || Ltrans < aTol) {
+ StdFail_NotDone::Raise("Cannot build thickness reduction: too small values");
+ }
+ bool isThinPart = (Lthin > aTol);
+
+ // .
+ // W |\
+ // . \
+ // ^ \ '-----------------.
+ // |R \| | Wthin
+ // | '-----------------'
+ // v Rthin
+ // --.--.--.--.--.--.--.--.--.--.--.--.--> theAxes.Direction()
+ // Ltrans Lthin
+
+ double RExt = R + W;
+ double RthinExt = Rthin + Wthin;
+
+ gp_Dir aNormal = theAxes.Direction();
+ gp_Dir anXDir = theAxes.XDirection();
+ gp_Pnt aPntCyl (theAxes.Location().XYZ() + aNormal.XYZ()*Ltrans);
+ gp_Ax2 anAxesCyl (aPntCyl, aNormal, anXDir);
+
+ // Build the transition part
+ BRepPrimAPI_MakeCone ConeExt (theAxes, RExt, RthinExt, Ltrans);
+ BRepPrimAPI_MakeCone ConeInt (theAxes, R, Rthin, Ltrans);
+ ConeExt.Build();
+ ConeInt.Build();
+ if (!ConeExt.IsDone() || !ConeInt.IsDone())
+ StdFail_NotDone::Raise("Cannot build cones of thickness reduction");
+ BRepAlgoAPI_Cut cut1 (ConeExt.Shape(), ConeInt.Shape());
+ if (!cut1.IsDone())
+ StdFail_NotDone::Raise("Coudn't build transition part of thickness reduction");
+ TopoDS_Shape aReduction = cut1.Shape();
+
+ // Build the thin part, if required
+ TopoDS_Shape aThinPart;
+ if (isThinPart) {
+ BRepPrimAPI_MakeCylinder CExt (anAxesCyl, RthinExt, Lthin);
+ BRepPrimAPI_MakeCylinder CInt (anAxesCyl, Rthin, Lthin);
+ CExt.Build();
+ CInt.Build();
+ if (!CExt.IsDone() || !CInt.IsDone())
+ StdFail_NotDone::Raise("Cannot build cylinders of thickness reduction");
+ BRepAlgoAPI_Cut cut2 (CExt.Shape(), CInt.Shape());
+ if (!cut2.IsDone())
+ StdFail_NotDone::Raise("Coudn't build thin part of thickness reduction");
+ aThinPart = cut2.Shape();
+ }
+
+ // Join parts
+ if (fuse) {
+ if (isThinPart) {
+ BRepAlgoAPI_Fuse fuse1 (aReduction, aThinPart);
+ if (!fuse1.IsDone())
+ StdFail_NotDone::Raise("Cannot fuse parts of thickness reduction");
+ aReduction = fuse1.Shape();
+ }
+ }
+ else {
+ // Partition the reduction on blocks
+ gp_Ax3 anAxesPln1 (aPntCyl, theAxes.XDirection(), aNormal);
+ gp_Ax3 anAxesPln2 (aPntCyl, theAxes.YDirection(), aNormal);
+ gp_Pln aPln1 (anAxesPln1);
+ gp_Pln aPln2 (anAxesPln2);
+ double aSize = Ltrans + Lthin + R + Rthin + Wthin; // to guarantee enough size in all directions
+ TopoDS_Shape aTool1 = BRepBuilderAPI_MakeFace(aPln1, -aSize, +aSize, -aSize, +aSize).Shape();
+ TopoDS_Shape aTool2 = BRepBuilderAPI_MakeFace(aPln2, -aSize, +aSize, -aSize, +aSize).Shape();
+
+ GEOMAlgo_Splitter PS;
+ PS.AddArgument(aReduction);
+ if (isThinPart)
+ PS.AddArgument(aThinPart);
+ PS.AddTool(aTool1);
+ PS.AddTool(aTool2);
+ PS.SetLimit(TopAbs_SOLID);
+ PS.Perform();
+
+ aReduction = PS.Shape();
+ }
+
+ return aReduction;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShape
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+ AdvancedEngine_IOperations::MakePipeTShape(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ bool theHexMesh)
+{
+ MESSAGE("AdvancedEngine_IOperations::MakePipeTShape");
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ AdvancedEngine_IPipeTShape aData (aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ if (isTRL || isTRR || isTRI) {
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape, TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., aSeq, gp_Trsf()))
+ return NULL;
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, gp_Trsf())) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShape("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theHexMesh;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups..
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+AdvancedEngine_IOperations::MakePipeTShapeWithPosition
+ (double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ bool theHexMesh,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3)
+{
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ /////////////////
+ // TSHAPE CODE
+ /////////////////
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ // Check new position
+ if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
+ return NULL;
+ }
+
+ AdvancedEngine_IPipeTShape aData(aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ if (isTRL || isTRR || isTRI) {
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ TopoDS_Shape Te = aShape->GetValue();
+
+ // Set Position
+ gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
+ BRepBuilderAPI_Transform aTransformation(Te, aTrsf, Standard_False);
+ TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
+ aFunction->SetValue(aTrsf_Shape);
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape,TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., aSeq, aTrsf)) {
+ return NULL;
+ }
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, aTrsf)) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShape("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeChamfer
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of chamfer.
+ * \param theW Width of chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+AdvancedEngine_IOperations::MakePipeTShapeChamfer
+ (double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theH, double theW,
+ bool theHexMesh)
+{
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), 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;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ AdvancedEngine_IPipeTShape aData(aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetH(theH);
+ aData.SetW(theW);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // BEGIN of chamfer
+ TopoDS_Shape aShapeShape = aShape->GetValue();
+ TopTools_IndexedMapOfShape anEdgesIndices;
+ TopExp::MapShapes(aShapeShape, anEdgesIndices);
+ // Common edges on external cylinders
+ Handle(GEOM_Object) box_e;
+ if (theHexMesh) {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
+ }
+ else {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
+ }
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ Handle(TColStd_HSequenceOfInteger) edges_e =
+ myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ box_e->GetLastFunction()->SetDescription("");
+
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ SetErrorCode("External edges not found");
+ return NULL;
+ }
+ int nbEdgesInChamfer = 0;
+ std::list<int> theEdges;
+ for (int i=1; i<=edges_e->Length();i++) {
+ int edgeID = edges_e->Value(i);
+ TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
+ TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
+ int iv=0;
+ while (Ex.More()) {
+ iv ++;
+ gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
+ nbEdgesInChamfer ++;
+ theEdges.push_back(edgeID);
+ }
+ Ex.Next();
+ }
+ if (theHexMesh && nbEdgesInChamfer == 1)
+ break;
+ }
+ Handle(GEOM_Object) aChamfer;
+ try {
+ aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+ if (aChamfer.IsNull()) {
+ SetErrorCode("Chamfer can not be computed on the given shape with the given parameters");
+ return NULL;
+ }
+ aChamfer->GetLastFunction()->SetDescription("");
+
+ TopoDS_Shape aChamferShape = aChamfer->GetValue();
+ aFunction->SetValue(aChamferShape);
+ // END of chamfer
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ try {
+ OCC_CATCH_SIGNALS;
+ if (isTRL || isTRR || isTRI) {
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2,
+ theH, theW, 0., aSeq, gp_Trsf()))
+ return NULL;
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, gp_Trsf())) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeChamfer("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theH << ", " << theW << ", " << theHexMesh;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeChamferWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of chamfer.
+ * \param theW Width of chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+AdvancedEngine_IOperations::MakePipeTShapeChamferWithPosition
+ (double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theH, double theW,
+ bool theHexMesh,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3)
+{
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), 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;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ // Check new position
+ if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
+ return NULL;
+ }
+
+ AdvancedEngine_IPipeTShape aData(aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetH(theH);
+ aData.SetW(theW);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // BEGIN of chamfer
+ TopoDS_Shape aShapeShape = aShape->GetValue();
+ TopTools_IndexedMapOfShape anEdgesIndices;
+ TopExp::MapShapes(aShapeShape, anEdgesIndices);
+ // Common edges on external cylinders
+ Handle(GEOM_Object) box_e;
+ if (theHexMesh) {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
+ }
+ else {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
+ }
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ Handle(TColStd_HSequenceOfInteger) edges_e =
+ myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ box_e->GetLastFunction()->SetDescription("");
+
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ SetErrorCode("External edges not found");
+ return NULL;
+ }
+ int nbEdgesInChamfer = 0;
+ std::list<int> theEdges;
+ for (int i=1; i<=edges_e->Length();i++) {
+ int edgeID = edges_e->Value(i);
+ TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
+ TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
+ while (Ex.More()) {
+ gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
+ nbEdgesInChamfer ++;
+ theEdges.push_back(edgeID);
+ }
+ Ex.Next();
+ }
+ if (theHexMesh && nbEdgesInChamfer == 1)
+ break;
+ }
+ Handle(GEOM_Object) aChamfer;
+ try {
+ aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+ if (aChamfer.IsNull()) {
+ SetErrorCode("Chamfer can not be computed on the given shape with the given parameters");
+ return NULL;
+ }
+ aChamfer->GetLastFunction()->SetDescription("");
+
+ TopoDS_Shape aChamferShape = aChamfer->GetValue();
+ aFunction->SetValue(aChamferShape);
+ // END of chamfer
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ try {
+ OCC_CATCH_SIGNALS;
+ if (isTRL || isTRR || isTRI) {
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // Set Position
+ gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
+ BRepBuilderAPI_Transform aTransformation (aShape->GetValue(), aTrsf, Standard_False);
+ TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
+ aFunction->SetValue(aTrsf_Shape);
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2,
+ theH, theW, 0., aSeq, aTrsf))
+ return NULL;
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, aTrsf)) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeChamfer("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theH << ", " << theW << ", " << theHexMesh << ", "
+ << theP1 << ", " << theP2 << ", " << theP3;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeFillet
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+AdvancedEngine_IOperations::MakePipeTShapeFillet
+ (double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theRF, bool theHexMesh)
+{
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), 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;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ AdvancedEngine_IPipeTShape aData(aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetRF(theRF);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // BEGIN of fillet
+ TopoDS_Shape aShapeShape = aShape->GetValue();
+ TopTools_IndexedMapOfShape anEdgesIndices;
+ TopExp::MapShapes(aShapeShape, anEdgesIndices);
+ // Common edges on external cylinders
+ Handle(GEOM_Object) box_e;
+ if (theHexMesh) {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
+ }
+ else {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
+ }
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ Handle(TColStd_HSequenceOfInteger) edges_e =
+ myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ box_e->GetLastFunction()->SetDescription("");
+
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ SetErrorCode("External edges not found");
+ return NULL;
+ }
+ int nbEdgesInFillet = 0;
+ std::list<int> theEdges;
+ for (int i=1; i<=edges_e->Length();i++) {
+ int edgeID = edges_e->Value(i);
+ TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
+ TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
+ while (Ex.More()) {
+ gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
+ nbEdgesInFillet ++;
+ theEdges.push_back(edgeID);
+ }
+ Ex.Next();
+ }
+ if (theHexMesh && nbEdgesInFillet == 1)
+ break;
+ }
+
+ Handle(GEOM_Object) aFillet;
+ try {
+ aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+ if (aFillet.IsNull()) {
+ //SetErrorCode("Fillet can not be computed on the given shape with the given parameters");
+ SetErrorCode(myLocalOperations->GetErrorCode());
+ return NULL;
+ }
+ aFillet->GetLastFunction()->SetDescription("");
+
+ TopoDS_Shape aFilletShape = aFillet->GetValue();
+ aFunction->SetValue(aFilletShape);
+ // END of fillet
+
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (1)
+// the following block, when enabled, leads to partitioning problems
+#if 0
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (1)
+ // BEGIN: Limit tolerances (debug)
+ Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07);
+ TopoDS_Shape aCorr1Shape = aCorr1->GetValue();
+ aShape->GetLastFunction()->SetValue(aCorr1Shape);
+ aCorr1->GetLastFunction()->SetDescription("");
+ // END: Limit tolerances (debug)
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (2)
+#endif
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (2)
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ try {
+ OCC_CATCH_SIGNALS;
+ if (isTRL || isTRR || isTRI) {
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., theRF, aSeq, gp_Trsf()))
+ return NULL;
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, gp_Trsf())) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeFillet("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theRF << ", " << theHexMesh;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeFilletWithPosition
+ * \brief Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition
+ (double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theRF, bool theHexMesh,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3)
+{
+ SetErrorCode(KO);
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), 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;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_PipeTShapeDriver::GetID()) return NULL;
+
+ // Check new position
+ if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
+ return NULL;
+ }
+
+ AdvancedEngine_IPipeTShape aData(aFunction);
+
+ aData.SetR1(theR1);
+ aData.SetW1(theW1);
+ aData.SetL1(theL1);
+ aData.SetR2(theR2);
+ aData.SetW2(theW2);
+ aData.SetL2(theL2);
+ aData.SetRF(theRF);
+ aData.SetHexMesh(theHexMesh);
+
+ bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
+ bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
+ bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("TShape driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // BEGIN of fillet
+ TopoDS_Shape aShapeShape = aShape->GetValue();
+ TopTools_IndexedMapOfShape anEdgesIndices;
+ TopExp::MapShapes(aShapeShape, anEdgesIndices);
+ // Common edges on external cylinders
+ Handle(GEOM_Object) box_e;
+ if (theHexMesh) {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
+ }
+ else {
+ box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
+ }
+ box_e->GetLastFunction()->SetDescription("");
+ box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
+ box_e->GetLastFunction()->SetDescription("");
+
+ Handle(TColStd_HSequenceOfInteger) edges_e =
+ myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ box_e->GetLastFunction()->SetDescription("");
+
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ SetErrorCode("External edges not found");
+ return NULL;
+ }
+ int nbEdgesInFillet = 0;
+ std::list<int> theEdges;
+ for (int i=1; i<=edges_e->Length();i++) {
+ int edgeID = edges_e->Value(i);
+ TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
+ TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
+ while (Ex.More()) {
+ gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
+ if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
+ nbEdgesInFillet ++;
+ theEdges.push_back(edgeID);
+ }
+ Ex.Next();
+ }
+ if (theHexMesh && nbEdgesInFillet == 1)
+ break;
+ }
+
+ Handle(GEOM_Object) aFillet;
+ try {
+ aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+ if (aFillet.IsNull()) {
+ SetErrorCode("Fillet can not be computed on the given shape with the given parameters");
+ return NULL;
+ }
+ aFillet->GetLastFunction()->SetDescription("");
+
+ TopoDS_Shape aFilletShape = aFillet->GetValue();
+ aFunction->SetValue(aFilletShape);
+ // END of fillet
+
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (3)
+// the following block, when enabled, leads to partitioning problems
+#if 0
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (3)
+ // BEGIN: Limit tolerances (debug)
+ Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07);
+ TopoDS_Shape aCorr1Shape = aCorr1->GetValue();
+ aShape->GetLastFunction()->SetValue(aCorr1Shape);
+ aCorr1->GetLastFunction()->SetDescription("");
+ // END: Limit tolerances (debug)
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (4)
+#endif
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (4)
+
+ if (theHexMesh) {
+ if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
+ return NULL;
+ if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
+ return NULL;
+ }
+
+ // Add thickness reduction elements
+ // at the three extremities: Left, Right and Incident
+ try {
+ OCC_CATCH_SIGNALS;
+ if (isTRL || isTRR || isTRI) {
+ TopoDS_Shape aResShape =
+ MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ !theHexMesh);
+ aFunction->SetValue(aResShape);
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ // Set Position
+ gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
+ BRepBuilderAPI_Transform aTransformation (aShape->GetValue(), aTrsf, Standard_False);
+ TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
+ aFunction->SetValue(aTrsf_Shape);
+
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+ aSeq->Append(aShape);
+
+ try {
+ if (theHexMesh) {
+ // Get the groups
+ if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., theRF, aSeq, aTrsf))
+ return NULL;
+ }
+
+ // Get internal group.
+ if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
+ theRR, theLtransR, theRI, theLtransI,
+ aSeq, aTrsf)) {
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ TCollection_AsciiString anEntry, aListRes("[");
+ // Iterate over the sequence aSeq
+ Standard_Integer aNbGroups = aSeq->Length();
+ Standard_Integer i = 1;
+ for (; i <= aNbGroups; i++) {
+ Handle(Standard_Transient) anItem = aSeq->Value(i);
+ if (anItem.IsNull()) continue;
+ Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
+ if (aGroup.IsNull()) continue;
+ //Make a Python command
+ TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
+ aListRes += anEntry + ", ";
+ }
+ aListRes.Trunc(aListRes.Length() - 2);
+
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeFillet("
+ << theR1 << ", " << theW1 << ", " << theL1 << ", "
+ << theR2 << ", " << theW2 << ", " << theL2 << ", "
+ << theRF << ", " << theHexMesh << ", "
+ << theP1 << ", " << theP2 << ", " << theP3;
+
+ // thickness reduction
+ if (isTRL)
+ pd << ", theRL=" << theRL << ", theWL=" << theWL
+ << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
+ if (isTRR)
+ pd << ", theRR=" << theRR << ", theWR=" << theWR
+ << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
+ if (isTRI)
+ pd << ", theRI=" << theRI << ", theWI=" << theWI
+ << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
+
+ pd << ")";
+
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * This function allows to create a disk already divided into blocks. It can be
+ * used to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \param theOrientation Plane on which the disk will be built
+ * \param thePattern The division pattern of the disk (hexagon or square in the center)
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDisk (double theR, double theRatio,
+ int theOrientation, int thePattern)
+{
+ SetErrorCode(KO);
+
+ if (theOrientation != 1 &&
+ theOrientation != 2 &&
+ theOrientation != 3)
+ {
+ SetErrorCode("theOrientation must be 1(=OXY), 2(=OYZ) or 3(=OZX)");
+ return NULL;
+ }
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_DividedDiskDriver::GetID()) return NULL;
+
+ AdvancedEngine_IDividedDisk aData (aFunction);
+
+ aData.SetR(theR);
+ aData.SetRatio(theRatio);
+ aData.SetOrientation(theOrientation);
+ aData.SetType(thePattern);
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("DividedDisk driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ std::string aPatternStr;
+
+ switch(thePattern)
+ {
+ case 0:
+ aPatternStr = "GEOM.SQUARE";
+ break;
+ case 1:
+ aPatternStr = "GEOM.HEXAGON";
+ break;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDisk(" << theR << ", " << theOrientation << ", " << aPatternStr.c_str() << ")";
+
+ SetErrorCode(OK);
+
+ return aShape;
+}
+
+//=============================================================================
+/*!
+ * This function allows to create a disk already divided into blocks. It can be
+ * used to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt,
+ Handle(GEOM_Object) theVec,
+ double theR,
+ double theRatio,
+ int thePattern)
+{
+ SetErrorCode(KO);
+
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_DividedDiskDriver::GetID()) return NULL;
+
+ AdvancedEngine_IDividedDisk aData (aFunction);
+
+ Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
+ Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+ if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
+
+ aData.SetCenter(aRefPnt);
+ aData.SetVector(aRefVec);
+
+ aData.SetR(theR);
+ aData.SetRatio(theRatio);
+ aData.SetType(thePattern);
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("DividedDisk driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ std::string aPatternStr;
+
+ switch(thePattern)
+ {
+ case 0:
+ aPatternStr = "GEOM.SQUARE";
+ break;
+ case 1:
+ aPatternStr = "GEOM.HEXAGON";
+ break;
+ }
+
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDiskPntVecR(" << thePnt << ", " << theVec << ", " << theR << ", " << aPatternStr.c_str() << ")";
+
+ SetErrorCode(OK);
+
+ return aShape;
+}
+
+//=============================================================================
+/*!
+ * Builds a cylinder prepared for hexa meshes
+ * \param theR Radius of the cylinder
+ * \param theH Height of the cylinder
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedCylinder (double theR,
+ double theH,
+ int thePattern)
+{
+ SetErrorCode(KO);
+
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
+
+ Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
+ aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk
+
+ aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0);
+
+ Handle(GEOM_Function) aFunction = aShape->GetLastFunction();
+ aFunction->SetDescription(""); // Erase dump of MakePrismDXDYDZ
+ aShape->SetType(GEOM_DIVIDEDCYLINDER);
+
+ std::string aPatternStr;
+
+ switch(thePattern)
+ {
+ case 0:
+ aPatternStr = "GEOM.SQUARE";
+ break;
+ case 1:
+ aPatternStr = "GEOM.HEXAGON";
+ break;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedCylinder(" << theR << ", " << theH << ", " << aPatternStr.c_str() << ")";
+
+ SetErrorCode(OK);
+
+ return aShape;
+}
+//=============================================================================
+/*!
+ * Create a smoothing surface from a set of points
+ * \param thelPoints list of points or compounds of points
+ * \param theNbMax maximum number of Bezier pieces in the resulting surface.
+ * \param theDegMax maximum degree of the resulting BSpline surface
+ * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+Handle(GEOM_Object) AdvancedEngine_IOperations::MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints,
+ int theNbMax,
+ int theDegMax,
+ double theDMax)
+{
+ SetErrorCode(KO);
+
+ //Add a new object
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE);
+
+ //Add a new shape function with parameters
+ Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != AdvancedEngine_SmoothingSurfaceDriver::GetID()) return NULL;
+
+ AdvancedEngine_ISmoothingSurface aData (aFunction);
+
+ int aLen = thelPoints.size();
+ aData.SetLength(aLen);
+ int ind = 1;
+ std::list<Handle(GEOM_Object)>::iterator it = thelPoints.begin();
+ for (; it != thelPoints.end(); it++, ind++) {
+ Handle(GEOM_Function) aRefObj = (*it)->GetLastFunction();
+ if (aRefObj.IsNull()) {
+ SetErrorCode("NULL point or compound for bSplineFaceShape");
+ return NULL;
+ }
+ aData.SetPntOrComp(ind, aRefObj);
+ }
+
+ aData.SetNbMax(theNbMax);
+ aData.SetDegMax(theDegMax);
+ aData.SetDMax(theDMax);
+
+ //Compute the resulting value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("SmoothingSurface driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ pd << aShape << " = geompy.MakeSmoothingSurface([";
+ it = thelPoints.begin();
+ pd << (*it++);
+ while (it != thelPoints.end()) {
+ pd << ", " << (*it++);
+ }
+ pd << "], "
+ << theNbMax << ", "
+ << theDegMax << ", "
+ << theDMax <<")";
+
+ SetErrorCode(OK);
+
+ return aShape;
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : AdvancedEngine_IOperations.hxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#ifndef _AdvancedEngine_IOperations_HXX_
+#define _AdvancedEngine_IOperations_HXX_
+
+#include "AdvancedEngine.hxx"
+
+#include "GEOM_IOperations.hxx"
+#include "GEOM_Engine.hxx"
+#include "GEOM_Object.hxx"
+
+#include <list>
+#include <gp_Ax2.hxx>
+
+class GEOMImpl_IBasicOperations;
+class GEOMImpl_IBooleanOperations;
+class GEOMImpl_IShapesOperations;
+class GEOMImpl_ITransformOperations;
+class GEOMImpl_IBlocksOperations;
+class GEOMImpl_I3DPrimOperations;
+class GEOMImpl_ILocalOperations;
+class GEOMImpl_IHealingOperations;
+class GEOMImpl_IGroupOperations;
+class Handle_Geom_Surface;
+class TopTools_ListOfShape;
+
+class ADVANCEDENGINE_EXPORT AdvancedEngine_IOperations: public GEOM_IOperations
+{
+private:
+ bool MakePipeTShapePartition(Handle(GEOM_Object) theShape,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theH = 0, double theW = 0,
+ double theRF = 0, bool isNormal = true);
+
+ bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2);
+
+ bool MakePipeTShapeThicknessReduction (Handle(GEOM_Object) theShape,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI);
+
+ bool MakeGroups(Handle(GEOM_Object) theShape, int shapType,
+ double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theH, double theW, double theRF,
+ Handle(TColStd_HSequenceOfTransient) theSeq,
+ gp_Trsf aTrsf);
+
+ bool GetFacesOnSurf(const TopoDS_Shape &theShape,
+ const Handle_Geom_Surface& theSurface,
+ const Standard_Real theTolerance,
+ TopTools_ListOfShape &theFaces);
+
+ TopoDS_Shape MakeConicalFace(const gp_Ax2 &theAxis,
+ const double theRadius,
+ const double theRadiusThin,
+ const double theHeight,
+ const gp_Trsf &theTrsf);
+
+ bool MakeInternalGroup(const Handle(GEOM_Object) &theShape,
+ const double theR1, const double theLen1,
+ const double theR2, const double theLen2,
+ const double theRL, const double theTransLenL,
+ const double theRR, const double theTransLenR,
+ const double theRI, const double theTransLenI,
+ const Handle(TColStd_HSequenceOfTransient) &theSeq,
+ const gp_Trsf &theTrsf);
+
+ gp_Trsf GetPositionTrsf(double theL1, double theL2,
+ Handle(GEOM_Object) P1 = 0,
+ Handle(GEOM_Object) P2 = 0,
+ Handle(GEOM_Object) P3 = 0);
+
+ bool CheckCompatiblePosition(double& theL1, double& theL2,
+ Handle(GEOM_Object) theP1,
+ Handle(GEOM_Object) theP2,
+ Handle(GEOM_Object) theP3,
+ double theTolerance);
+
+private:
+ GEOMImpl_IBasicOperations* myBasicOperations;
+ GEOMImpl_IBooleanOperations* myBooleanOperations;
+ GEOMImpl_IShapesOperations* myShapesOperations;
+ GEOMImpl_ITransformOperations* myTransformOperations;
+ GEOMImpl_IBlocksOperations* myBlocksOperations;
+ GEOMImpl_I3DPrimOperations* my3DPrimOperations;
+ GEOMImpl_ILocalOperations* myLocalOperations;
+ GEOMImpl_IHealingOperations* myHealingOperations;
+ GEOMImpl_IGroupOperations* myGroupOperations;
+
+public:
+
+ /*!
+ * \brief Add three thickness reductions at the open ends of the pipe T-Shape
+ *
+ * \param theShape - the pipe T-Shape
+ * \param r1 - the internal radius of main pipe
+ * \param w1 - the thickness of main pipe
+ * \param l1 - the half-length of main pipe
+ * \param r2 - the internal radius of incident pipe
+ * \param w2 - the thickness of incident pipe
+ * \param l2 - the half-length of main pipe
+ * \param r*, w*, ltrans* and lthin* - internal radius, thickness, length of transition part
+ * and length of thin part of left(L), right(R) and
+ * incident(I) thickness reduction correspondingly
+ * \param fuseReductions - boolean flag (use true to generate single solid,
+ * false to obtain parts, useful for hexameshing)
+ * \retval TopoDS_Shape - Resulting shape
+ */
+ static TopoDS_Shape MakePipeTShapeThicknessReduction
+ (TopoDS_Shape theShape,
+ double r1, double w1, double l1,
+ double r2, double w2, double l2,
+ double rL, double wL, double ltransL, double lthinL,
+ double rR, double wR, double ltransR, double lthinR,
+ double rI, double wI, double ltransI, double lthinI,
+ bool fuseReductions);
+
+ /*!
+ * \brief Create one thickness reduction element
+ *
+ * This method is called three times from MakePipeTShapeThicknessReduction
+ * to create three thickness reductions (one per each open end of a pipe T-Shape)
+ *
+ * \param theAxes - the position
+ * \param R - the internal radius of main pipe
+ * \param W - the thickness of main pipe
+ * \param Rthin - the internal radius of thin part
+ * \param Wthin - the thickness of thin part
+ * \param Ltrans - the length of transition part
+ * \param Lthin - the length of thin part
+ * \param fuse - boolean flag (use true to generate single solid,
+ * false to obtain parts, useful for hexameshing)
+ * \retval TopoDS_Shape - Resulting shape
+ */
+ static TopoDS_Shape MakeThicknessReduction (gp_Ax2 theAxes,
+ const double R, const double W,
+ const double Rthin, const double Wthin,
+ const double Ltrans, const double Lthin,
+ bool fuse);
+
+public:
+ AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID);
+ ~AdvancedEngine_IOperations();
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShape(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ bool theHexMesh = true);
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShapeWithPosition(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ bool theHexMesh = true,
+ Handle(GEOM_Object) P1 = 0,
+ Handle(GEOM_Object) P2 = 0,
+ Handle(GEOM_Object) P3 = 0);
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShapeChamfer(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theH, double theW,
+ bool theHexMesh = true);
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theH, double theW,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ bool theHexMesh = true,
+ Handle(GEOM_Object) P1 = 0,
+ Handle(GEOM_Object) P2 = 0,
+ Handle(GEOM_Object) P3 = 0);
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShapeFillet(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theRF, bool theHexMesh = true);
+
+ Handle(TColStd_HSequenceOfTransient)
+ MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1,
+ double theR2, double theW2, double theL2,
+ double theRL, double theWL, double theLtransL, double theLthinL,
+ double theRR, double theWR, double theLtransR, double theLthinR,
+ double theRI, double theWI, double theLtransI, double theLthinI,
+ double theRF, bool theHexMesh = true,
+ Handle(GEOM_Object) P1 = 0,
+ Handle(GEOM_Object) P2 = 0,
+ Handle(GEOM_Object) P3 = 0);
+
+ Handle(GEOM_Object) MakeDividedDisk (double theR, double theRatio,
+ int theOrientation, int thePattern);
+ Handle(GEOM_Object) MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt,
+ Handle(GEOM_Object) theVec,
+ double theR,
+ double theRatio,
+ int thePattern);
+
+ Handle(GEOM_Object) MakeDividedCylinder (double theR,
+ double theH,
+ int thePattern);
+
+ Handle(GEOM_Object) MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints,
+ int theNbMax,
+ int theDegMax,
+ double theDMax);
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : GEOM_IAdvancedOperations.cc
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#include <Standard_Stream.hxx>
+
+#include "AdvancedEngine_IOperations_i.hh"
+#include "AdvancedEngine_IOperations.hxx"
+
+#include <utilities.h>
+#include <OpUtil.hxx>
+#include <Utils_ExceptHandlers.hxx>
+
+#include "GEOM_Engine.hxx"
+#include "GEOM_Object.hxx"
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+AdvancedEngine_IOperations_i::AdvancedEngine_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, AdvancedEngine_IOperations* theImpl)
+:GEOM_IOperations_i(thePOA, theEngine, theImpl)
+{
+ MESSAGE("AdvancedEngine_IOperations_i::AdvancedEngine_IOperations_i");
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+AdvancedEngine_IOperations_i::~AdvancedEngine_IOperations_i()
+{
+ MESSAGE("AdvancedEngine_IOperations_i::~AdvancedEngine_IOperations_i");
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShape
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShape
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+ if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull())return aSeq._retn();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeChamfer
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of chamfer.
+ * \param theW Width of chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeChamfer
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theH, theW, theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeChamferWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeChamferWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theH, theW, theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeFillet
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeFillet
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theRF, theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeFilletWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeFilletWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+ theRF, theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTR
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTR
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTRWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length).
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+ if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull()) return aSeq._retn();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTRChamfer
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of chamfer.
+ * \param theW Width of chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRChamfer
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theH, theW, theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTRChamferWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A chamfer is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theH Height of the chamfer.
+ * \param theW Width of the chamfer.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRChamferWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theH, theW, theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTRFillet
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet.
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRFillet
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theRF, theHexMesh);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * MakePipeTShapeTRFilletWithPosition
+ * Create a T-shape object with specified caracteristics for the main and
+ * the incident pipes (radius, width, half-length). A fillet is created
+ * on the junction of the pipes.
+ * The extremities of the main pipe are located on junctions points P1 and P2.
+ * The extremity of the incident pipe is located on junction point P3.
+ * \param theR1 Internal radius of main pipe
+ * \param theW1 Width of main pipe
+ * \param theL1 Half-length of main pipe
+ * \param theR2 Internal radius of incident pipe (R2 < R1)
+ * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ * \param theL2 Half-length of incident pipe
+ * \param theRF Radius of curvature of fillet
+ * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
+ * \param theP1 1st junction point of main pipe
+ * \param theP2 2nd junction point of main pipe
+ * \param theP3 Junction point of incident pipe
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* AdvancedEngine_IOperations_i::MakePipeTShapeTRFilletWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference vertices
+ Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
+ Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
+ Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
+
+ //Create the TShape
+ Handle(TColStd_HSequenceOfTransient) aHSeq =
+ GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theRF, theHexMesh, aP1, aP2, aP3);
+ if (!GetOperations()->IsDone() || aHSeq.IsNull())
+ return aSeq._retn();
+
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length(aLength);
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * This function allows to create a disk already divided into blocks. It can be
+ * use to create divided pipes for later meshing in hexaedra.
+ * \param theR Radius of the disk
+ * \param theRatio Relative size of the central square diagonal against the disk diameter
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedDisk (CORBA::Double theR,
+ CORBA::Double theRatio,
+ CORBA::Short theOrientation,
+ GEOM::pattern thePattern)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the DividedDisk
+ Handle(GEOM_Object) anObject = GetOperations()->MakeDividedDisk(theR, theRatio, theOrientation, thePattern);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * MakeDividedDiskPntVecR
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr thePnt,
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theR,
+ CORBA::Double theRatio,
+ GEOM::pattern thePattern)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference points
+ Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
+ Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
+
+ if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
+
+ // Make DividedDisk
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeDividedDiskPntVecR(aPnt, aVec, theR, theRatio, thePattern);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * Builds a cylinder prepared for hexa meshes
+ * \param theR Radius of the cylinder
+ * \param theH Height of the cylinder
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeDividedCylinder (CORBA::Double theR,
+ CORBA::Double theH,
+ GEOM::pattern thePattern)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the DividedCylinder
+ Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *
+ * \param thelPoints list of points
+ * \param theNbMax maximum number of Bezier pieces in the resulting surface.
+ * \param theDegMax maximum degree of the resulting BSpline surface
+ * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
+ * \return New GEOM_Object, containing the created shape.
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr AdvancedEngine_IOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints,
+ CORBA::Long theNbMax,
+ CORBA::Long theDegMax,
+ CORBA::Double theDMax)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference point
+ int ind = 0;
+ int aLen = thelPoints.length();
+ std::list<Handle(GEOM_Object)> aPoints;
+ for (; ind < aLen; ind++) {
+ Handle(GEOM_Object) aPnt = GetObjectImpl(thelPoints[ind]);
+ if (aPnt.IsNull()) return aGEOMObject._retn();
+ aPoints.push_back(aPnt);
+ }
+ //Create the SmoothingSurface
+ Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface
+ (aPoints, theNbMax, theDegMax, theDMax);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+AdvancedEngine_IOperations* AdvancedEngine_IOperations_i::GetOperations()
+{
+ return (AdvancedEngine_IOperations*)GetImpl();
+}
+
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : AdvancedEngine_IOperations_i.hh
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#ifndef _AdvancedEngine_IOperations_i_HeaderFile
+#define _AdvancedEngine_IOperations_i_HeaderFile
+
+#include "AdvancedEngine.hxx"
+
+#include "GEOM_IOperations_i.hh"
+#include "GEOM_Object_i.hh"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
+class AdvancedEngine_IOperations;
+
+class ADVANCEDENGINE_EXPORT AdvancedEngine_IOperations_i :
+ public virtual POA_GEOM::IAdvancedOperations,
+ public virtual GEOM_IOperations_i
+{
+ public:
+ AdvancedEngine_IOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
+ AdvancedEngine_IOperations* theImpl);
+ ~AdvancedEngine_IOperations_i();
+
+ // PipeTShape without thickness reduction
+ GEOM::ListOfGO* MakePipeTShape (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::ListOfGO* MakePipeTShapeChamfer (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeChamferWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::ListOfGO* MakePipeTShapeFillet (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeFilletWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+
+ // PipeTShape with thickness reduction
+ GEOM::ListOfGO* MakePipeTShapeTR
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeTRWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::ListOfGO* MakePipeTShapeTRChamfer
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeTRChamferWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+ GEOM::ListOfGO* MakePipeTShapeTRFillet
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh);
+ GEOM::ListOfGO* MakePipeTShapeTRFilletWithPosition
+ (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
+ CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
+ CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
+ CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
+ CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
+ CORBA::Double theRF, CORBA::Boolean theHexMesh,
+ GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
+
+ GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR,
+ CORBA::Double theRatio,
+ CORBA::Short theOrientation,
+ GEOM::pattern thePattern);
+
+ GEOM::GEOM_Object_ptr MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theR,
+ CORBA::Double theRatio,
+ GEOM::pattern thePattern);
+
+ GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR,
+ CORBA::Double theH,
+ GEOM::pattern thePattern);
+ GEOM::GEOM_Object_ptr MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints,
+ CORBA::Long theNbMax,
+ CORBA::Long theDegMax,
+ CORBA::Double theDMax);
+
+ AdvancedEngine_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_IPipeTShape_HXX_
+#define _AdvancedEngine_IPipeTShape_HXX_
+
+#include "GEOM_Function.hxx"
+
+#include <TColStd_HArray1OfReal.hxx>
+
+class AdvancedEngine_IPipeTShape
+{
+public:
+ AdvancedEngine_IPipeTShape(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+ void SetR1(double theR1) { _func->SetReal(TSHAPE_ARG_R1, theR1); }
+ double GetR1() { return _func->GetReal(TSHAPE_ARG_R1); }
+
+ void SetW1(double theW1) { _func->SetReal(TSHAPE_ARG_W1, theW1); }
+ double GetW1() { return _func->GetReal(TSHAPE_ARG_W1); }
+
+ void SetL1(double theL1) { _func->SetReal(TSHAPE_ARG_L1, theL1); }
+ double GetL1() { return _func->GetReal(TSHAPE_ARG_L1); }
+
+ void SetR2(double theR2) { _func->SetReal(TSHAPE_ARG_R2, theR2); }
+ double GetR2() { return _func->GetReal(TSHAPE_ARG_R2); }
+
+ void SetW2(double theW2) { _func->SetReal(TSHAPE_ARG_W2, theW2); }
+ double GetW2() { return _func->GetReal(TSHAPE_ARG_W2); }
+
+ void SetL2(double theL2) { _func->SetReal(TSHAPE_ARG_L2, theL2); }
+ double GetL2() { return _func->GetReal(TSHAPE_ARG_L2); }
+
+ void SetH(double theH) { _func->SetReal(TSHAPE_ARG_H, theH); }
+ double GetH() { return _func->GetReal(TSHAPE_ARG_H); }
+
+ void SetW(double theW) { _func->SetReal(TSHAPE_ARG_W, theW); }
+ double GetW() { return _func->GetReal(TSHAPE_ARG_W); }
+
+ void SetRF(double theRF) { _func->SetReal(TSHAPE_ARG_RF, theRF); }
+ double GetRF() { return _func->GetReal(TSHAPE_ARG_RF); }
+
+ void SetHexMesh(int theHexMesh) { _func->SetInteger(TSHAPE_ARG_HEXMESH, theHexMesh); }
+ int GetHexMesh() { return _func->GetInteger(TSHAPE_ARG_HEXMESH); }
+
+ void SetP1(const Handle(GEOM_Function)& theP1){_func->SetReference(TSHAPE_ARG_P1, theP1); }
+ Handle(GEOM_Function) GetP1() { return _func->GetReference(TSHAPE_ARG_P1); }
+
+ void SetP2(const Handle(GEOM_Function)& theP2){_func->SetReference(TSHAPE_ARG_P2, theP2); }
+ Handle(GEOM_Function) GetP2() { return _func->GetReference(TSHAPE_ARG_P2); }
+
+ void SetP3(const Handle(GEOM_Function)& theP3){_func->SetReference(TSHAPE_ARG_P3, theP3); }
+ Handle(GEOM_Function) GetP3() { return _func->GetReference(TSHAPE_ARG_P3); }
+
+private:
+ enum {
+ // main pipe
+ TSHAPE_ARG_R1 = 1,
+ TSHAPE_ARG_W1 = 2,
+ TSHAPE_ARG_L1 = 3,
+
+ // incident pipe
+ TSHAPE_ARG_R2 = 4,
+ TSHAPE_ARG_W2 = 5,
+ TSHAPE_ARG_L2 = 6,
+
+ // chamfer
+ TSHAPE_ARG_H = 7,
+ TSHAPE_ARG_W = 8,
+
+ // fillet
+ TSHAPE_ARG_RF = 9,
+
+ // partition
+ TSHAPE_ARG_HEXMESH = 10,
+
+ // junction points
+ TSHAPE_ARG_P1 = 11,
+ TSHAPE_ARG_P2 = 12,
+ TSHAPE_ARG_P3 = 13
+ };
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _AdvancedEngine_IPipeTShape_HXX_
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_ISmoothingSurface_HXX_
+#define _AdvancedEngine_ISmoothingSurface_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define SMOOTHINGSURFACE_ARG_LENG 1
+#define SMOOTHINGSURFACE_ARG_LAST 2
+#define SMOOTHINGSURFACE_ARG_NB_MAX 3
+#define SMOOTHINGSURFACE_ARG_DEG_MAX 4
+#define SMOOTHINGSURFACE_ARG_D_MAX 5
+
+class AdvancedEngine_ISmoothingSurface
+{
+public:
+ AdvancedEngine_ISmoothingSurface(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+ void SetLength(int theLen) { _func->SetInteger(SMOOTHINGSURFACE_ARG_LENG, theLen); }
+ int GetLength() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_LENG); }
+
+ void SetPntOrComp(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SMOOTHINGSURFACE_ARG_LAST + theId, theP); }
+ Handle(GEOM_Function) GetPntOrComp(int theId) { return _func->GetReference(SMOOTHINGSURFACE_ARG_LAST + theId); }
+
+ void SetNbMax(int theNbMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_NB_MAX, theNbMax); }
+ int GetNbMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_NB_MAX); }
+
+ void SetDegMax(int theDegMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX, theDegMax); }
+ int GetDegMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX); }
+
+ void SetDMax(double theDMax) { _func->SetReal(SMOOTHINGSURFACE_ARG_D_MAX, theDMax); }
+ double GetDMax() { return _func->GetReal(SMOOTHINGSURFACE_ARG_D_MAX); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _AdvancedEngine_ISmoothingSurface_HXX_
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "GEOM_AdvancedEngine.hxx"
-
-#include "AdvancedEngine_OperationsCreator.hh"
-
-#include "GEOM_IAdvancedOperations_i.hh"
-
-// Operations
-#include <GEOMImpl_PipeTShapeDriver.hxx>
-#include <GEOMImpl_DividedDiskDriver.hxx>
-// #include <GEOMImpl_DividedCylinderDriver.hxx>
-#include <GEOMImpl_SmoothingSurfaceDriver.hxx>
-/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
-
-#include <TFunction_Driver.hxx>
-#include <TFunction_DriverTable.hxx>
-
-#include "Utils_ExceptHandlers.hxx"
-#include "utilities.h"
-
-//============================================================================
-// function : Create
-// purpose :
-//============================================================================
-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" );
-
- if (_mapOfOperations.find(theStudyId) == _mapOfOperations.end()) {
- _mapOfOperations[theStudyId] = new GEOMImpl_IAdvancedOperations (theGenImpl, theStudyId);
-
- // Advanced operations
- TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PipeTShapeDriver::GetID(),
- new GEOMImpl_PipeTShapeDriver());
- TFunction_DriverTable::Get()->AddDriver(GEOMImpl_DividedDiskDriver::GetID(),
- new GEOMImpl_DividedDiskDriver());
- //TFunction_DriverTable::Get()->AddDriver(GEOMImpl_DividedCylinderDriver::GetID(),
- // new GEOMImpl_DividedCylinderDriver());
- TFunction_DriverTable::Get()->AddDriver(GEOMImpl_SmoothingSurfaceDriver::GetID(),
- new GEOMImpl_SmoothingSurfaceDriver());
- /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
- }
-
- GEOM_IAdvancedOperations_i* aServant =
- new GEOM_IAdvancedOperations_i (thePOA, theEngine, _mapOfOperations[theStudyId]);
-
- return aServant;
-}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "AdvancedEngine_OperationsCreator.hxx"
+#include "AdvancedEngine_IOperations_i.hh"
+#include "AdvancedEngine_IOperations.hxx"
+#include <AdvancedEngine_PipeTShapeDriver.hxx>
+#include <AdvancedEngine_DividedDiskDriver.hxx>
+#include <AdvancedEngine_SmoothingSurfaceDriver.hxx>
+
+#include <TFunction_Driver.hxx>
+#include <TFunction_DriverTable.hxx>
+
+#include "Utils_ExceptHandlers.hxx"
+#include "utilities.h"
+
+std::map <int, AdvancedEngine_IOperations*> AdvancedEngine_OperationsCreator::_mapOfOperations;
+
+AdvancedEngine_OperationsCreator::AdvancedEngine_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_PipeTShapeDriver::GetID(),
+ new AdvancedEngine_PipeTShapeDriver());
+ TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_DividedDiskDriver::GetID(),
+ new AdvancedEngine_DividedDiskDriver());
+ TFunction_DriverTable::Get()->AddDriver(AdvancedEngine_SmoothingSurfaceDriver::GetID(),
+ new AdvancedEngine_SmoothingSurfaceDriver());
+}
+
+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 ) );
+}
+
+AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new AdvancedEngine_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOM_ADVANCEDENGINE_OPERATIONSCREATOR_HXX_
-#define _GEOM_ADVANCEDENGINE_OPERATIONSCREATOR_HXX_
-
-#include "GEOM_AdvancedEngine.hxx"
-
-#include "GEOM_Gen_i.hh"
-
-#include "GEOMImpl_IAdvancedOperations.hxx"
-
-#include <map>
-
-//=====================================================================
-// Operations creator
-//=====================================================================
-class ADVANCEDENGINE_EXPORT AdvancedEngine_OperationsCreator : public GEOM_GenericOperationsCreator
-{
- public:
- // Create operations
- virtual GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl);
- // return the name of IDL module
- //virtual std::string GetModuleName();
-
- private:
- std::map <int, GEOMImpl_IAdvancedOperations*> _mapOfOperations;
-};
-
-#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_ADVANCEDENGINE_OPERATIONSCREATOR_HXX_
+#define _GEOM_ADVANCEDENGINE_OPERATIONSCREATOR_HXX_
+
+#include "AdvancedEngine.hxx"
+
+#include "GEOM_Gen_i.hh"
+
+#include <map>
+
+class AdvancedEngine_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class ADVANCEDENGINE_EXPORT AdvancedEngine_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ AdvancedEngine_OperationsCreator();
+ ~AdvancedEngine_OperationsCreator();
+
+ GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl);
+
+private:
+ static AdvancedEngine_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+private:
+ static std::map <int, AdvancedEngine_IOperations*> _mapOfOperations;
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "AdvancedEngine_PipeTShapeDriver.hxx"
+#include "AdvancedEngine_IPipeTShape.hxx"
+#include "AdvancedEngine_Types.hxx"
+#include "AdvancedEngine_IOperations.hxx"
+
+#include "GEOMImpl_Block6Explorer.hxx"
+#include "GEOM_Function.hxx"
+#include "GEOM_IOperations.hxx"
+#include "GEOMUtils.hxx"
+#include "GEOMAlgo_FinderShapeOn1.hxx"
+#include "GEOMAlgo_FinderShapeOn2.hxx"
+#include "GEOMAlgo_ClsfBox.hxx"
+#include "GEOMAlgo_Splitter.hxx"
+
+#include "Geom_CylindricalSurface.hxx"
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Trsf.hxx>
+#include <TFunction_Logbook.hxx>
+#include <StdFail_NotDone.hxx>
+#include <BRepPrimAPI_MakeCone.hxx>
+#include <BRepPrimAPI_MakeCylinder.hxx>
+#include <BRepAlgoAPI_Fuse.hxx>
+#include <BRepAlgoAPI_Cut.hxx>
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_Transform.hxx>
+#include <BRepFilletAPI_MakeFillet.hxx>
+#include <BRepFilletAPI_MakeChamfer.hxx>
+#include <BRep_Builder.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepTools.hxx>
+#include <TopoDS.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+
+#include <vector>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& AdvancedEngine_PipeTShapeDriver::GetID()
+{
+ static Standard_GUID aGUID("1C3A0F3F-729D-4E83-8232-78E74FC5637C");
+ return aGUID;
+}
+
+//=======================================================================
+//function : AdvancedEngine_PipeTShapeDriver
+//purpose :
+//=======================================================================
+AdvancedEngine_PipeTShapeDriver::AdvancedEngine_PipeTShapeDriver()
+{
+}
+
+//=======================================================================
+//function : getShapesOnBoxIDs
+ /*!
+ * \brief Find IDs of sub-shapes complying with given status about surface
+ * \param theBox - the box to check state of sub-shapes against
+ * \param theShape - the shape to explore
+ * \param theShapeType - type of sub-shape of theShape
+ * \param theState - required state
+ * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
+ */
+//=======================================================================
+Handle(TColStd_HSequenceOfInteger)
+AdvancedEngine_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
+ const TopoDS_Shape& aShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState) const
+{
+ Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
+
+ // Check presence of triangulation, build if need
+ if (!GEOMUtils::CheckTriangulation(aShape)) {
+ StdFail_NotDone::Raise("Cannot build triangulation on the shape");
+ return aSeqOfIDs;
+ }
+
+ // Call algo
+ GEOMAlgo_FinderShapeOn2 aFinder;
+ Standard_Real aTol = 0.0001; // default value
+
+ Handle(GEOMAlgo_ClsfBox) aClsfBox = new GEOMAlgo_ClsfBox;
+ aClsfBox->SetBox(aBox);
+
+ aFinder.SetShape(aShape);
+ aFinder.SetTolerance(aTol);
+ aFinder.SetClsf(aClsfBox);
+ aFinder.SetShapeType( (TopAbs_ShapeEnum)theShapeType );
+ aFinder.SetState(theState);
+ aFinder.Perform();
+
+ // Interprete results
+ Standard_Integer iErr = aFinder.ErrorStatus();
+ // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+ if (iErr) {
+ TCollection_AsciiString aMsg (" iErr : ");
+ aMsg += TCollection_AsciiString(iErr);
+ StdFail_NotDone::Raise(aMsg.ToCString());
+ return aSeqOfIDs;
+ }
+
+
+ const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
+
+ if (listSS.Extent() < 1) {
+ StdFail_NotDone::Raise(NOT_FOUND_ANY); // NPAL18017
+ return aSeqOfIDs;
+ }
+
+ // Fill sequence of object IDs
+ aSeqOfIDs = new TColStd_HSequenceOfInteger;
+
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aShape, anIndices);
+
+ TopTools_ListIteratorOfListOfShape itSub (listSS);
+ for (int index = 1; itSub.More(); itSub.Next(), ++index) {
+ int id = anIndices.FindIndex(itSub.Value());
+// std::cerr << "Shape with ID " << id << " found" << std::endl;
+ aSeqOfIDs->Append(id);
+ }
+
+ return aSeqOfIDs;
+}
+
+//=======================================================================
+//function : GetShapesOnSurfaceIDs
+ /*!
+ * \brief Find IDs of sub-shapes complying with given status about surface
+ * \param theSurface - the surface to check state of sub-shapes against
+ * \param theShape - the shape to explore
+ * \param theShapeType - type of sub-shape of theShape
+ * \param theState - required state
+ * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
+ */
+//=======================================================================
+Handle(TColStd_HSequenceOfInteger)
+ AdvancedEngine_PipeTShapeDriver::GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
+ const TopoDS_Shape& theShape,
+ TopAbs_ShapeEnum theShapeType,
+ GEOMAlgo_State theState) const
+{
+ Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
+
+ // Check presence of triangulation, build if need
+ if (!GEOMUtils::CheckTriangulation(theShape)) {
+ StdFail_NotDone::Raise("Cannot build triangulation on the shape");
+ return aSeqOfIDs;
+ }
+
+ // Call algo
+ GEOMAlgo_FinderShapeOn1 aFinder;
+ Standard_Real aTol = 1e-6;
+
+ aFinder.SetShape(theShape);
+ aFinder.SetTolerance(aTol);
+ aFinder.SetSurface(theSurface);
+ aFinder.SetShapeType(theShapeType);
+ aFinder.SetState(theState);
+
+ // Sets the minimal number of inner points for the faces that do not have own
+ // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
+ // Default value=3
+ aFinder.SetNbPntsMin(3);
+ // Sets the maximal number of inner points for edges or faces.
+ // It is usefull for the cases when this number is very big (e.g =2000) to improve
+ // the performance. If this value =0, all inner points will be taken into account.
+ // Default value=0
+ aFinder.SetNbPntsMax(0);
+
+ aFinder.Perform();
+
+ // Interprete results
+ Standard_Integer iErr = aFinder.ErrorStatus();
+ // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+ if (iErr) {
+// MESSAGE(" iErr : " << iErr);
+ TCollection_AsciiString aMsg (" iErr : ");
+ aMsg += TCollection_AsciiString(iErr);
+ StdFail_NotDone::Raise(aMsg.ToCString());
+ return aSeqOfIDs;
+ }
+// Standard_Integer iWrn = aFinder.WarningStatus();
+ // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+// if (iWrn) {
+// MESSAGE(" *** iWrn : " << iWrn);
+// }
+
+ const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
+
+ if (listSS.Extent() < 1) {
+ //StdFail_NotDone::Raise("Not a single sub-shape of the requested type found on the given surface");
+ StdFail_NotDone::Raise(NOT_FOUND_ANY); // NPAL18017
+ return aSeqOfIDs;
+ }
+
+ // Fill sequence of object IDs
+ aSeqOfIDs = new TColStd_HSequenceOfInteger;
+
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(theShape, anIndices);
+
+ TopTools_ListIteratorOfListOfShape itSub (listSS);
+ for (int index = 1; itSub.More(); itSub.Next(), ++index) {
+ int id = anIndices.FindIndex(itSub.Value());
+ aSeqOfIDs->Append(id);
+ }
+
+ return aSeqOfIDs;
+}
+
+//=======================================================================
+//function : GetCommonShapesOnCylinders
+//purpose : return the common shapes between 2 cylindrical surfaces
+// along OX and OZ
+//=======================================================================
+void AdvancedEngine_PipeTShapeDriver::GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
+ TopAbs_ShapeEnum theShapeType,
+ double r1,
+ double r2,
+ Handle(TopTools_HSequenceOfShape)& commonShapes) const
+{
+ gp_Pnt aP0 (0, 0, 0);
+ gp_Vec aVX = gp::DX(), aVZ = gp::DZ();
+ gp_Ax3 anAxis1 (aP0, aVX, aVZ), anAxis2 (aP0, aVZ, aVX);
+
+ TopTools_IndexedMapOfShape aMapOfShapes;
+ aMapOfShapes.Clear();
+ TopExp::MapShapes(theShape, aMapOfShapes);
+
+ commonShapes->Clear();
+
+ int myID;
+ bool found = false;
+
+ // Create a cylinder surface
+ Handle(Geom_Surface) aC1Ext = new Geom_CylindricalSurface(anAxis1, r1);
+ if ( aC1Ext.IsNull() )
+ StdFail_NotDone::Raise("Couldn't build main cylindrical surface");
+ // Find object IDs
+ Handle(TColStd_HSequenceOfInteger) aSeqExt1 = GetShapesOnSurfaceIDs( aC1Ext, theShape, theShapeType, GEOMAlgo_ST_ON );
+ // Create a cylinder surface
+ Handle(Geom_Surface) aC2Ext = new Geom_CylindricalSurface(anAxis2, r2);
+ if ( aC2Ext.IsNull() )
+ StdFail_NotDone::Raise("Couldn't build incident cylindrical surface");
+ // Find object IDs
+ Handle(TColStd_HSequenceOfInteger) aSeqExt2 = GetShapesOnSurfaceIDs( aC2Ext, theShape, theShapeType, GEOMAlgo_ST_ON );
+ // # Recherche (dans le quart de Te) de l'arete d'intersection des 2 cylindres
+ // # Search in theShape for common shape of type theShapeType on the intersection of 2 pipes
+ found = false;
+ for (int i=1; i<=aSeqExt2->Length();i++) {
+// std::cerr << "aSeqExt2->Value(i): " << aSeqExt2->Value(i) << std::endl;
+ for (int j=1; j<=aSeqExt1->Length();j++) {
+// std::cerr << "aSeqExt1->Value(j): " << aSeqExt1->Value(j) << std::endl;
+ if (aSeqExt1->Value(j) == aSeqExt2->Value(i)) {
+ myID = aSeqExt1->Value(j);
+ commonShapes->Append(aMapOfShapes.FindKey(myID));
+ found = true;
+ }
+ }
+ }
+ if (!found)
+ StdFail_NotDone::Raise("Common shapes couldn't be found");
+}
+
+//=======================================================================
+//function : MakePipeTShape
+//purpose :
+//=======================================================================
+TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, const double w1, const double l1,
+ const double r2, const double w2, const double l2) const
+{
+ double r1Ext = r1 + w1;
+ double r2Ext = r2 + w2;
+
+ gp_Pnt aP0 (0, 0, 0);
+ gp_Pnt aP1 (-l1, 0, 0);
+ gp_Vec aVX = gp::DX(), aVY = gp::DY(), aVZ = gp::DZ();
+ gp_Ax2 anAxes1 (aP1, aVX, aVZ);
+ gp_Ax2 anAxes2 (aP0, aVZ, aVX);
+
+ // Build the initial pipes
+ BRepPrimAPI_MakeCylinder C1Int (anAxes1, r1, Abs(2 * l1));
+ BRepPrimAPI_MakeCylinder C1Ext (anAxes1, r1Ext, Abs(2 * l1));
+ BRepPrimAPI_MakeCylinder C2Int (anAxes2, r2, Abs(l2));
+ BRepPrimAPI_MakeCylinder C2Ext (anAxes2, r2Ext, Abs(l2));
+ C1Int.Build();
+ C1Ext.Build();
+ C2Int.Build();
+ C2Ext.Build();
+ if (!C1Int.IsDone() || !C1Ext.IsDone() || !C2Int.IsDone() || !C2Ext.IsDone()) {
+ StdFail_NotDone::Raise("Cannot build cylinders");
+ }
+
+ // Fuse the 2 pipes
+ BRepAlgoAPI_Fuse fuse1 (C1Ext.Shape(), C2Ext.Shape());
+ if (!fuse1.IsDone()) {
+ StdFail_NotDone::Raise("Cannot fuse cylinders");
+ }
+
+ // Remove small radius main pipe
+ BRepAlgoAPI_Cut cut1 (fuse1.Shape(), C1Int.Shape());
+ if (!cut1.IsDone()) {
+ StdFail_NotDone::Raise("Coudn't cut cylinders");
+ }
+
+ // Remove small radius incident pipe => Te
+ BRepAlgoAPI_Cut Te (cut1.Shape(), C2Int.Shape());
+ if (!Te.IsDone()) {
+ StdFail_NotDone::Raise("Coudn't cut cylinders");
+ }
+
+ return Te.Shape();
+}
+
+//=======================================================================
+//function : MakeQuarterPipeTShape
+//purpose :
+//=======================================================================
+TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const double r1, const double w1, const double l1,
+ const double r2, const double w2, const double l2) const
+{
+ TopoDS_Shape Te = MakePipeTShape(r1, w1, l1, r2, w2, l2);
+ if (Te.IsNull())
+ StdFail_NotDone::Raise("Couldn't build Pipe TShape");
+
+ // Get a quarter of shape => Te2
+ double r1Ext = r1 + w1;
+ BRepPrimAPI_MakeBox box1 (gp_Pnt(0, -2*r1Ext, -2*r1Ext), gp_Pnt( Abs(2 * l1), 2*r1Ext, Abs(2*l2)));
+ BRepPrimAPI_MakeBox box2 (gp_Pnt(0, 2*r1Ext, -2*r1Ext), gp_Pnt(-Abs(2 * l1), 0, Abs(2*l2)));
+ box1.Build();
+ box2.Build();
+ if (!box1.IsDone() || !box2.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't build boxes");
+ }
+ BRepAlgoAPI_Cut cut3 (Te, box1.Shape());
+ if (!cut3.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
+ }
+ BRepAlgoAPI_Cut Te4 (cut3.Shape(), box2.Shape());
+ if (!Te4.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
+ }
+
+ return Te4.Shape();
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer AdvancedEngine_PipeTShapeDriver::Execute (TFunction_Logbook& log) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+
+ AdvancedEngine_IPipeTShape aData (aFunction);
+ Standard_Integer aType = aFunction->GetType();
+
+ TopoDS_Shape aShape, Te4, Te4Part;
+ //TopoDS_Edge arete_intersect_int;
+ //Handle(TopTools_HSequenceOfShape) edges_e = new TopTools_HSequenceOfShape;
+ Handle(TColStd_HSequenceOfInteger) edges_e;
+ //Handle(TopTools_HSequenceOfShape) edges_i = new TopTools_HSequenceOfShape;
+ //gp_Pnt aP0 (0, 0, 0);
+ //gp_Vec aVX = gp::DX(), aVY = gp::DY(), aVZ = gp::DZ();
+ bool hexMesh = (bool) aData.GetHexMesh();
+
+ // Useful values
+ //double aSize = 2*(aData.GetL1() + aData.GetL2());
+ double epsilon = Precision::Approximation();
+ double aR1Ext = aData.GetR1() + aData.GetW1();
+ double aR2Ext = aData.GetR2() + aData.GetW2();
+
+ if (aData.GetR2() > aData.GetR1() + epsilon) {
+ StdFail_NotDone::Raise("TShape cannot be computed if R2 > R1");
+ }
+
+ if (aR2Ext > aR1Ext + epsilon) {
+ StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 > R1+W1");
+ }
+
+ // external radius are equal
+ if (fabs(aR2Ext - aR1Ext) < epsilon) {
+ if (aType == TSHAPE_CHAMFER)
+ StdFail_NotDone::Raise("TShape with chamfer cannot be computed if R2+W2 = R1+W1");
+ if (aType == TSHAPE_FILLET)
+ StdFail_NotDone::Raise("TShape with fillet cannot be computed if R2+W2 = R1+W1");
+ // internal radius are different => not possible
+ if (fabs(aData.GetR2() - aData.GetR1()) > epsilon) {
+ StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 = R1+W1 and R2 != R1");
+ }
+ }
+
+ if (aR1Ext >= aData.GetL2() + epsilon) {
+ StdFail_NotDone::Raise("TShape cannot be computed if R1+W1 >= L2");
+ }
+ if (aR2Ext >= aData.GetL1() + epsilon) {
+ StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 >= L1");
+ }
+
+ if (aType == TSHAPE_CHAMFER) {
+ if (aData.GetH() >= (aData.GetL2() - aR1Ext + epsilon)) {
+ StdFail_NotDone::Raise("TShape cannot be computed: height of chamfer is too high");
+ }
+
+ if (aData.GetW() >= (aData.GetL1() - aR2Ext + epsilon))
+ StdFail_NotDone::Raise("TShape cannot be computed: width of chamfer is too high");
+ }
+
+ if (aType == TSHAPE_FILLET) {
+ if (aData.GetRF() >= (aData.GetL2() - aR1Ext + epsilon) ||
+ aData.GetRF() >= (aData.GetL1() - aR2Ext + epsilon))
+ StdFail_NotDone::Raise("TShape cannot be computed: radius of fillet is too high");
+ }
+
+ if (hexMesh) {
+ // Create a quarter of a basic T-Shape pipe
+ //std::cerr << "Create a quarter of a basic T-Shape pipe" << std::endl;
+ Te4 = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
+ aData.GetR2(), aData.GetW2(), aData.GetL2());
+ }
+ else {
+ // No need to cut pipe t-shape
+ //std::cerr << "Create a basic T-Shape pipe" << std::endl;
+ Te4 = MakePipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
+ aData.GetR2(), aData.GetW2(), aData.GetL2());
+ }
+ aShape = Te4;
+/*
+ if (aType == TSHAPE_BASIC) {
+ aShape = Te4;
+// aShape = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
+// aData.GetR2(), aData.GetW2(), aData.GetL2());
+ }
+ else if (aType == TSHAPE_CHAMFER) {
+ // TShape with chamfer
+// BRep_Builder BB;
+// TopoDS_Compound CC;
+// BB.MakeCompound(CC);
+ // Create chamfer on the edges edges_e
+ BRepFilletAPI_MakeChamfer chamfer (Te4);
+ TopTools_IndexedMapOfShape anEdgesIndices;
+ TopExp::MapShapes(Te4, anEdgesIndices);
+
+ TopoDS_Shape theBox;
+ if (hexMesh) {
+ BRepPrimAPI_MakeBox aBox (gp_Pnt(0,0,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
+ aBox.Build();
+ if (!aBox.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't build box");
+ }
+ theBox = aBox.Shape();
+ }
+ else {
+ BRepPrimAPI_MakeBox aBox (gp_Pnt(aR2Ext,aR2Ext,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
+ aBox.Build();
+ if (!aBox.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't build box");
+ }
+ theBox = aBox.Shape();
+ }
+ Handle(TColStd_HSequenceOfInteger) edges_e = new TColStd_HSequenceOfInteger;
+ edges_e = GetShapesOnBoxIDs(theBox, Te4, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ StdFail_NotDone::Raise("Common edges not found");
+ }
+
+ TopTools_IndexedDataMapOfShapeListOfShape M;
+ GEOMImpl_Block6Explorer::MapShapesAndAncestors(Te4, TopAbs_EDGE, TopAbs_FACE, M);
+// std::cerr << "Number of IDs: " << edges_e->Length() << std::endl;
+ int nbEdgesInChamfer = 0;
+ for (int i=1;i<=edges_e->Length();i++) {
+// std::cerr << "Get Edge with ID #" << i << std::endl;
+ int theId = edges_e->Value(i);
+// std::cerr << "ID #" << i << "= " << theId << std::endl;
+// std::cerr << "Search for edge in shape" << std::endl;
+ TopoDS_Edge theEdge = TopoDS::Edge(anEdgesIndices.FindKey(theId));
+// std::cerr << "Found" << std::endl;
+// std::cerr << "Keep only edges with a vertex on (x, x, re1)" << std::endl;
+ TopExp_Explorer ExVertices;
+ for (ExVertices.Init(theEdge,TopAbs_VERTEX); ExVertices.More(); ExVertices.Next()) {
+ gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(ExVertices.Current()));
+ if (aPt.Z() - aR1Ext <= epsilon) {
+// std::cerr << "aPt.Z() = aR1Ext => keep this edge" << std::endl;
+ nbEdgesInChamfer ++;
+ const TopTools_ListOfShape& aFL = M.FindFromKey(theEdge);
+ TopoDS_Face F = TopoDS::Face( aFL.First() );
+ if (hexMesh)
+ chamfer.Add(aData.GetH(), aData.GetW(), theEdge, F);
+ else
+ chamfer.Add(aData.GetW(), aData.GetH(), theEdge, F);
+ break;
+ }
+ }
+// std::cerr << "Test if hexMesh: ";
+ if (hexMesh && nbEdgesInChamfer == 1) {
+// std::cerr << "Yes => stop after 1 edge" << std::endl;
+ break;
+ }
+// std::cerr << "No => continue for other edges" << std::endl;
+ // BB.Add(CC, edges_e->Value(i));
+ // const TopTools_ListOfShape& aFL = M.FindFromKey(TopoDS::Edge(edges_e->Value(i)));
+ // chamfer.Add(aData.GetW(), aData.GetH(), TopoDS::Edge(edges_e->Value(i)), F);
+ }
+// std::cerr << "Build chamfer with " << nbEdgesInChamfer << " edges" << std::endl;
+// }
+ chamfer.Build();
+ if (!chamfer.IsDone()) {
+ StdFail_NotDone::Raise("Chamfer can not be computed on the given shape with the given parameters");
+ }
+
+// BB.Add(CC, chamfer.Shape());
+
+// aShape = CC;
+ aShape = chamfer.Shape();
+ }
+ else if (aType == TSHAPE_FILLET) {
+ // TShape with fillet
+ // Create fillet on the edge arete_intersect_ext
+ BRepFilletAPI_MakeFillet fill (Te4);
+
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(Te4, anIndices);
+
+ TopoDS_Shape theBox;
+ if (hexMesh) {
+ BRepPrimAPI_MakeBox aBox (gp_Pnt(0,0,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
+ aBox.Build();
+ if (!aBox.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't build box");
+ }
+ theBox = aBox.Shape();
+ }
+ else {
+ BRepPrimAPI_MakeBox aBox (gp_Pnt(aR2Ext,aR2Ext,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
+ aBox.Build();
+ if (!aBox.IsDone()) {
+ StdFail_NotDone::Raise("Couldn't build box");
+ }
+ theBox = aBox.Shape();
+ }
+ Handle(TColStd_HSequenceOfInteger) edges_e = new TColStd_HSequenceOfInteger;
+ edges_e = GetShapesOnBoxIDs(theBox, Te4, TopAbs_EDGE, GEOMAlgo_ST_IN);
+ if (edges_e.IsNull() || edges_e->Length() == 0) {
+ StdFail_NotDone::Raise("Common edges not found");
+ }
+
+// fill.Add(TopoDS::Edge(edges_e->Value(1)));
+// if (!hexMesh) {
+ for (int i=1;i<=edges_e->Length();i++) {
+ if (hexMesh && (i > 1))
+ break;
+ TopoDS_Edge theEdge = TopoDS::Edge(anIndices.FindKey(edges_e->Value(i)));
+ fill.Add(theEdge);
+// fill.Add(TopoDS::Edge(edges_e->Value(i)));
+ }
+// }
+ fill.SetRadius(aData.GetRF(), 1, 1);
+ fill.Build();
+ if (!fill.IsDone()) {
+ StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius");
+ }
+
+ aShape = fill.Shape();
+ }
+ else {
+ // other construction modes here
+ }
+*/
+ if (aShape.IsNull()) return 0;
+
+ aFunction->SetValue(aShape);
+
+ log.SetTouched(Label());
+
+ return 1;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool AdvancedEngine_PipeTShapeDriver::
+GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams)
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+ AdvancedEngine_IPipeTShape aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "PIPETSHAPE";
+
+ switch ( aType ) {
+ case TSHAPE_BASIC:
+ AddParam( theParams, "Main radius", aCI.GetR1() );
+ AddParam( theParams, "Main width", aCI.GetW1() );
+ AddParam( theParams, "Main half-length", aCI.GetL1() );
+ AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
+ AddParam( theParams, "Incident pipe width", aCI.GetW2() );
+ AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
+ AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
+ break;
+ case TSHAPE_CHAMFER:
+ AddParam( theParams, "Main radius", aCI.GetR1() );
+ AddParam( theParams, "Main width", aCI.GetW1() );
+ AddParam( theParams, "Main half-length", aCI.GetL1() );
+ AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
+ AddParam( theParams, "Incident pipe width", aCI.GetW2() );
+ AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
+ AddParam( theParams, "Chamfer height", aCI.GetH() );
+ AddParam( theParams, "Chamfer width", aCI.GetW() );
+ AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
+ break;
+ case TSHAPE_FILLET:
+ AddParam( theParams, "Main radius", aCI.GetR1() );
+ AddParam( theParams, "Main width", aCI.GetW1() );
+ AddParam( theParams, "Main half-length", aCI.GetL1() );
+ AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
+ AddParam( theParams, "Incident pipe width", aCI.GetW2() );
+ AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
+ AddParam( theParams, "Fillet radius", aCI.GetRF() );
+ AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (AdvancedEngine_PipeTShapeDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (AdvancedEngine_PipeTShapeDriver,GEOM_BaseDriver);
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_PipeTShapeDriver_HXX
+#define _AdvancedEngine_PipeTShapeDriver_HXX
+
+#include "GEOM_BaseDriver.hxx"
+#include "GEOMAlgo_State.hxx"
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopTools_HSequenceOfShape.hxx>
+#include <TColStd_HSequenceOfInteger.hxx>
+#include <Geom_Surface.hxx>
+
+DEFINE_STANDARD_HANDLE( AdvancedEngine_PipeTShapeDriver, GEOM_BaseDriver );
+
+class AdvancedEngine_PipeTShapeDriver : public GEOM_BaseDriver
+{
+public:
+ // Methods PUBLIC
+ //
+ AdvancedEngine_PipeTShapeDriver();
+ virtual Standard_Integer Execute(TFunction_Logbook& log) const;
+ virtual void Validate(TFunction_Logbook&) const {}
+ Standard_Boolean MustExecute(const TFunction_Logbook&) const
+ {
+ return Standard_True;
+ }
+ static const Standard_GUID& GetID();
+ ~AdvancedEngine_PipeTShapeDriver() {};
+
+ virtual bool GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& params);
+ // Type management
+ //
+DEFINE_STANDARD_RTTI( AdvancedEngine_PipeTShapeDriver )
+
+private:
+
+ /*!
+ * \brief Create a T-Shape based on pipes
+ * \param r1 - the internal radius of main pipe
+ * \param w1 - the thickness of main pipe
+ * \param l1 - the half-length of main pipe
+ * \param r2 - the internal radius of incident pipe
+ * \param w2 - the thickness of incident pipe
+ * \param l2 - the half-length of main pipe
+ * \retval TopoDS_Shape - Resulting shape
+ */
+ TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
+ double r2, double w2, double l2) const;
+
+ /*!
+ * \brief Create a quarter of a T-Shape based on pipes
+ * \param r1 - the internal radius of main pipe
+ * \param w1 - the thickness of main pipe
+ * \param l1 - the half-length of main pipe
+ * \param r2 - the internal radius of incident pipe
+ * \param w2 - the thickness of incident pipe
+ * \param l2 - the half-length of main pipe
+ * \retval TopoDS_Shape - Resulting shape
+ */
+ TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
+ double r2, double w2, double l2) const;
+
+ /*!
+ * \brief Find IDs of sub-shapes complying with given status about surface
+ * \param theSurface - the surface to check state of sub-shapes against
+ * \param theShape - the shape to explore
+ * \param theShapeType - type of sub-shape of theShape
+ * \param theState - required state
+ * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
+ */
+ Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
+ const TopoDS_Shape& theShape,
+ TopAbs_ShapeEnum theShapeType,
+ GEOMAlgo_State theState) const;
+
+ /*!
+ * \brief Find IDs of sub-shapes complying with given status about surface
+ * \param theBox - the box to check state of sub-shapes against
+ * \param theShape - the shape to explore
+ * \param theShapeType - type of sub-shape of theShape
+ * \param theState - required state
+ * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
+ */
+ Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
+ const TopoDS_Shape& aShape,
+ const Standard_Integer theShapeType,
+ GEOMAlgo_State theState) const;
+
+ //=======================================================================
+ //function : getCommonShapesOnCylinders
+ //purpose : return the common edge between 2 cylindrical surfaces
+ // along OX and OZ
+ //=======================================================================
+ void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
+ TopAbs_ShapeEnum theShapeType,
+ double r, double r2,
+ Handle(TopTools_HSequenceOfShape)& commonShapes) const;
+
+};
+
+#endif // _AdvancedEngine_PipeTShapeDriver_HXX
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <Standard_Stream.hxx>
+
+#include "AdvancedEngine_SmoothingSurfaceDriver.hxx"
+#include "AdvancedEngine_ISmoothingSurface.hxx"
+#include "AdvancedEngine_Types.hxx"
+
+#include "GEOM_Function.hxx"
+
+#include <TFunction_Logbook.hxx>
+#include <StdFail_NotDone.hxx>
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TColgp_Array2OfPnt.hxx>
+#include <TColgp_SequenceOfXY.hxx>
+#include <TColgp_SequenceOfXYZ.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+
+#include <BRepAdaptor_HSurface.hxx>
+
+#include <BRep_Builder.hxx>
+#include <BRepGProp.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepPrimAPI_MakeSphere.hxx>
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepAlgoAPI_Cut.hxx>
+
+#include <GeomPlate_Surface.hxx>
+#include <GeomPlate_BuildPlateSurface.hxx>
+#include <GeomPlate_PointConstraint.hxx>
+#include <GeomPlate_MakeApprox.hxx>
+#include <GeomPlate_PlateG0Criterion.hxx>
+#include <GeomPlate_BuildAveragePlane.hxx>
+
+#include <Geom_BSplineSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_Plane.hxx>
+
+#include <GProp_GProps.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
+#include <gp_Pnt.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Ax3.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Vec.hxx>
+
+#include <GC_MakePlane.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& AdvancedEngine_SmoothingSurfaceDriver::GetID()
+{
+ static Standard_GUID aGUID("1C3A0F30-729D-4E83-8232-78E74FC5637C");
+ return aGUID;
+}
+
+//=======================================================================
+//function : AdvancedEngine_SmoothingSurfaceDriver
+//purpose :
+//=======================================================================
+AdvancedEngine_SmoothingSurfaceDriver::AdvancedEngine_SmoothingSurfaceDriver()
+{
+}
+
+//=======================================================================
+//function : MakeSmoothingSurfaceUnClosed
+//purpose :
+//=======================================================================
+TopoDS_Shape AdvancedEngine_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed
+ (const Handle_TColgp_HArray1OfPnt &theListOfPoints,
+ const Standard_Integer theNbMax,
+ const Standard_Integer theDegMax,
+ const Standard_Real theDMax) const
+{
+ TopoDS_Face aInitShape;
+
+ // Create an average Plane
+ //Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,theListOfPoints.Length())
+ GeomPlate_BuildAveragePlane gpbap(theListOfPoints,theListOfPoints->Length(),Precision::Confusion(),1,1);
+ Handle(Geom_Plane) plane(gpbap.Plane());
+ Standard_Real Umin, Umax, Vmin, Vmax;
+ gpbap.MinMaxBox(Umin,Umax,Vmin,Vmax);
+ // cout << "Vals : " << Umin << ", " << Umax << ", " << Vmin << ", " << Vmax << endl;
+ BRepBuilderAPI_MakeFace mf(plane,Umin,Umax,Vmin,Vmax,Precision::Confusion());
+ aInitShape = mf.Face();
+ //return aInitShape;
+
+ GeomPlate_BuildPlateSurface aBuilder(3,10);
+ // ** Initialization of surface
+ Handle(BRepAdaptor_HSurface) HSI = new BRepAdaptor_HSurface();
+ HSI->ChangeSurface().Initialize(aInitShape);
+ aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->ChangeSurface().Face()));
+
+ Standard_Integer j, j1, j2;
+ // cout << "Init surface" << endl;
+ j1 = theListOfPoints->Lower();
+ j2 = theListOfPoints->Upper();
+ for (j=j1; j<=j2 ; j++)
+ {
+ gp_Pnt aPnt = theListOfPoints->Value(j);
+ Handle(GeomPlate_PointConstraint) PCont = new GeomPlate_PointConstraint(aPnt,0);
+ aBuilder.Add(PCont);
+ }
+ // cout << "avant Perform surface" << endl;
+ aBuilder.Perform();
+ // cout << "Perform surface" << endl;
+
+ // A ce niveau : surface algo
+ Handle(GeomPlate_Surface) gpPlate = aBuilder.Surface();
+
+ Standard_Integer nbcarreau = (theNbMax > 0 ? theNbMax : 2);
+ Standard_Integer degmax = (theDegMax > 0 ? theDegMax : 8);
+ Standard_Real seuil = theDMax;
+
+ if (seuil <= 0.) {
+ seuil = Max(0.0001,10*aBuilder.G0Error());
+ }
+
+ GeomPlate_MakeApprox Mapp(gpPlate,0.0001,nbcarreau,degmax,seuil);
+ // cout << "Approx surface" << endl;
+
+ Handle (Geom_Surface) Surf (Mapp.Surface());
+
+ aBuilder.Surface()->Bounds( Umin, Umax, Vmin, Vmax);
+
+ BRepBuilderAPI_MakeFace MF(Surf,Umin, Umax, Vmin, Vmax, Precision::Confusion());
+ TopoDS_Shape aShape = MF.Shape();
+
+ return aShape;
+}
+
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer AdvancedEngine_SmoothingSurfaceDriver::Execute(TFunction_Logbook& log) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+ if (aFunction.IsNull()) return 0;
+
+ Standard_Integer aType = aFunction->GetType();
+
+ if (aType != SMOOTHINGSURFACE_LPOINTS) return 0;
+ // cout << "Youhou : " << aType << endl;
+
+ AdvancedEngine_ISmoothingSurface aData (aFunction);
+
+ // Fill the map of vertices.
+ Standard_Integer aNbShapes = aData.GetLength();
+ TopTools_MapOfShape aMapPoints;
+ Standard_Integer i;
+
+ for (i = 1; i <= aNbShapes; i++) {
+ Handle(GEOM_Function) aFShape = aData.GetPntOrComp(i);
+ TopoDS_Shape aShape = aFShape->GetValue();
+
+ if (aShape.ShapeType() == TopAbs_VERTEX) {
+ aMapPoints.Add(aShape);
+ } else {
+ TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
+
+ for (; anExp.More(); anExp.Next()) {
+ aMapPoints.Add(anExp.Current());
+ }
+ }
+ }
+
+ // Add points to the array of points.
+ const Standard_Integer aNbPoints = aMapPoints.Extent();
+ Handle(TColgp_HArray1OfPnt) anArrayofPnt =
+ new TColgp_HArray1OfPnt(1, aNbPoints);
+ TopTools_MapIteratorOfMapOfShape anIter(aMapPoints);
+
+ for (i = 1; anIter.More(); anIter.Next(), i++) {
+ TopoDS_Vertex aPoint = TopoDS::Vertex(anIter.Key());
+ gp_Pnt aPnt = BRep_Tool::Pnt(aPoint);
+
+ anArrayofPnt->SetValue(i, aPnt);
+ }
+
+ const Standard_Integer aNbMax = aData.GetNbMax();
+ const Standard_Integer aDegMax = aData.GetDegMax();
+ const Standard_Real aDMax = aData.GetDMax();
+
+ // Make smoothing surface.
+ TopoDS_Shape aShape = AdvancedEngine_SmoothingSurfaceDriver::
+ MakeSmoothingSurfaceUnClosed(anArrayofPnt, aNbMax, aDegMax, aDMax);
+
+ if (aShape.IsNull()) return 0;
+
+ aFunction->SetValue(aShape);
+
+ log.SetTouched(Label());
+
+ return 1;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool AdvancedEngine_SmoothingSurfaceDriver::
+GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams)
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+ AdvancedEngine_ISmoothingSurface aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "SMOOTHINGSURFACE";
+
+ switch ( aType ) {
+ case SMOOTHINGSURFACE_LPOINTS:
+ {
+ AddParam( theParams, "Points" );
+ if ( aCI.GetLength() > 1 )
+ theParams[0] << aCI.GetLength() << " points: ";
+ for ( int i = 1, nb = aCI.GetLength(); i <= nb; ++i )
+ theParams[0] << aCI.GetPntOrComp( i ) << " ";
+
+ const Standard_Integer aNbMax = aCI.GetNbMax();
+ const Standard_Integer aDegMax = aCI.GetDegMax();
+ const Standard_Real aDMax = aCI.GetDMax();
+
+ AddParam(theParams, "Max nbr of Bezier pieces", aCI.GetNbMax());
+ AddParam(theParams, "Max BSpline surface degree", aCI.GetDegMax());
+ AddParam(theParams, "3D tolerance of initial approximation", aCI.GetDMax());
+ }
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (AdvancedEngine_SmoothingSurfaceDriver,GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT (AdvancedEngine_SmoothingSurfaceDriver,GEOM_BaseDriver);
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _AdvancedEngine_SmoothingSurfaceDriver_HXX
+#define _AdvancedEngine_SmoothingSurfaceDriver_HXX
+
+#include "GEOM_BaseDriver.hxx"
+
+#include <TFunction_Logbook.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
+#include <TopoDS_Shape.hxx>
+
+DEFINE_STANDARD_HANDLE( AdvancedEngine_SmoothingSurfaceDriver, GEOM_BaseDriver );
+
+class AdvancedEngine_SmoothingSurfaceDriver : public GEOM_BaseDriver
+{
+public:
+ // Methods PUBLIC
+ //
+ AdvancedEngine_SmoothingSurfaceDriver();
+ virtual Standard_Integer Execute(TFunction_Logbook& log) const;
+ virtual void Validate(TFunction_Logbook&) const {}
+ Standard_Boolean MustExecute(const TFunction_Logbook&) const
+ {
+ return Standard_True;
+ }
+ static const Standard_GUID& GetID();
+ ~AdvancedEngine_SmoothingSurfaceDriver() {};
+
+ virtual bool GetCreationInformation(std::string& theOperationName,
+ std::vector<GEOM_Param>& params);
+ // Type management
+ //
+DEFINE_STANDARD_RTTI( AdvancedEngine_SmoothingSurfaceDriver )
+
+private:
+ TopoDS_Shape MakeSmoothingSurfaceUnClosed
+ (const Handle_TColgp_HArray1OfPnt &theListOfPoints,
+ const Standard_Integer theNbMax,
+ const Standard_Integer theDegMax,
+ const Standard_Real theDMax) const;
+};
+
+#endif // _AdvancedEngine_SmoothingSurfaceDriver_HXX
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#include "GEOMImpl_Types.hxx"
+
// Advanced functions (base = 200)
-#define ADVANCED_BASE 200 // NO OPERATION (advanced operations base)
-#define GEOM_TSHAPE 201
-#define GEOM_DIVIDEDDISK 202
-#define GEOM_DIVIDEDCYLINDER 203
-#define GEOM_SMOOTHINGSURFACE 204
-/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
+#define GEOM_TSHAPE ( USER_TYPE + 1 )
+#define GEOM_DIVIDEDDISK ( USER_TYPE + 2 )
+#define GEOM_DIVIDEDCYLINDER ( USER_TYPE + 3 )
+#define GEOM_SMOOTHINGSURFACE ( USER_TYPE + 4 )
+
// Advanced functions sub-operations codes
#define TSHAPE_BASIC 1
#define TSHAPE_CHAMFER 2
#define DIVIDEDDISK_R_VECTOR_PNT 2
#define DIVIDEDCYLINDER_R_H 1
#define SMOOTHINGSURFACE_LPOINTS 1
-/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
SET(_link_LIBRARIES
GEOMEngine
SalomeIDLGEOM
+ SalomeIDLAdvancedGEOM
${KERNEL_SALOMELocalTrace}
${KERNEL_SalomeGenericObj}
${KERNEL_TOOLSDS}
# --- headers ---
SET(AdvancedEngine_HEADERS
+ AdvancedEngine.hxx
AdvancedEngine_Types.hxx
- # AdvancedEngine_OperationsCreator.hh
- # GEOM_AdvancedEngine.hxx
- # GEOMImpl_IAdvancedOperations.hxx
- # GEOM_IAdvancedOperations_i.hh
- # #ADVANCED_INCLUDES:
- # GEOMImpl_IPipeTShape.hxx GEOMImpl_PipeTShapeDriver.hxx
- # GEOMImpl_IDividedDisk.hxx GEOMImpl_DividedDiskDriver.hxx
- # GEOMImpl_IDividedCylinder.hxx GEOMImpl_DividedCylinderDriver.hxx
- # GEOMImpl_ISmoothingSurface.hxx GEOMImpl_SmoothingSurfaceDriver.hxx
+ AdvancedEngine_DividedDiskDriver.hxx
+ AdvancedEngine_PipeTShapeDriver.hxx
+ AdvancedEngine_SmoothingSurfaceDriver.hxx
+ AdvancedEngine_IPipeTShape.hxx
+ AdvancedEngine_ISmoothingSurface.hxx
+ AdvancedEngine_IDividedDisk.hxx
+ AdvancedEngine_IOperations.hxx
+ AdvancedEngine_IOperations_i.hh
+ AdvancedEngine_OperationsCreator.hxx
)
# --- sources ---
SET(AdvancedEngine_SOURCES
AdvancedEngine.cxx
- AdvancedEngine_OperationsCreator.cc
- GEOMImpl_IAdvancedOperations.cxx
- GEOM_IAdvancedOperations_i.cc
- # ADVANCED_SOURCES:
- GEOMImpl_PipeTShapeDriver.cxx
- GEOMImpl_DividedDiskDriver.cxx
- #GEOMImpl_DividedCylinderDriver.cxx
- GEOMImpl_SmoothingSurfaceDriver.cxx
- ##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@##
+ AdvancedEngine_DividedDiskDriver.cxx
+ AdvancedEngine_PipeTShapeDriver.cxx
+ AdvancedEngine_SmoothingSurfaceDriver.cxx
+ AdvancedEngine_IOperations.cxx
+ AdvancedEngine_IOperations_i.cc
+ AdvancedEngine_OperationsCreator.cxx
)
# --- rules ---
TARGET_LINK_LIBRARIES(AdvancedEngine ${_link_LIBRARIES})
INSTALL(TARGETS AdvancedEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-INSTALL(FILES ${AdvancedEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
\ No newline at end of file
+INSTALL(FILES ${AdvancedEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <Standard_Stream.hxx>
-
-#include "AdvancedEngine_Types.hxx"
-
-#include <GEOMImpl_DividedDiskDriver.hxx>
-#include <GEOMImpl_IDividedDisk.hxx>
-#include <GEOMImpl_Types.hxx>
-#include <GEOM_Function.hxx>
-
-// OCCT includes
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Circ.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Ax2.hxx>
-
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-
-#include <Geom_Plane.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Edge.hxx>
-
-#include <TFunction_Logbook.hxx>
-#include <StdFail_NotDone.hxx>
-
-#include <TopExp.hxx>
-
-#include <utilities.h>
-//@@ include required header files here @@//
-
-enum
-{
- SQUARE,
- HEXAGON
-};
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const Standard_GUID& GEOMImpl_DividedDiskDriver::GetID()
-{
- static Standard_GUID aGUID("0b01da9a-c5da-11e1-8d80-78e7d1879630");
- return aGUID;
-}
-
-//=======================================================================
-//function : GEOMImpl_DividedDiskDriver
-//purpose :
-//=======================================================================
-GEOMImpl_DividedDiskDriver::GEOMImpl_DividedDiskDriver()
-{
-}
-
-//=======================================================================
-//function : Execute
-//purpose :
-//=======================================================================
-Standard_Integer GEOMImpl_DividedDiskDriver::Execute(TFunction_Logbook& log) const
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_IDividedDisk aData (aFunction);
- Standard_Integer aType = aFunction->GetType();
-
- TopoDS_Shape aShape;
-
- // Getting data
- double R = aData.GetR();
- double Ratio = aData.GetRatio();
- int Pattern = aData.GetType();
-
- // Build reference disk (in the global coordinate system)
- TopoDS_Shape aDisk;
-
- if (Pattern == SQUARE)
- aDisk = MakeDiskSquare( R, Ratio );
- else if (Pattern == HEXAGON)
- aDisk = MakeDiskHexagon( R, Ratio );
-
- if (aType == DIVIDEDDISK_R_RATIO)
- {
- int theOrientation = aData.GetOrientation();
- aShape = TransformShape(aDisk, theOrientation);
- }
- else if (aType == DIVIDEDDISK_R_VECTOR_PNT)
- {
- Handle(GEOM_Function) aRefPoint = aData.GetCenter();
- Handle(GEOM_Function) aRefVector = aData.GetVector();
- TopoDS_Shape aShapePnt = aRefPoint->GetValue();
- TopoDS_Shape aShapeVec = aRefVector->GetValue();
-
- if (aShapePnt.ShapeType() == TopAbs_VERTEX &&
- aShapeVec.ShapeType() == TopAbs_EDGE)
- {
- gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
- TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
- TopoDS_Vertex V1, V2;
- TopExp::Vertices(anE, V1, V2, Standard_True);
- if (!V1.IsNull() && !V2.IsNull())
- {
- gp_Vec aVec (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
- gp_Dir aDir(aVec);
- aShape = TransformShape(aDisk, aPnt, aDir);
- }
- }
- }
-
- if (aShape.IsNull()) return 0;
-
- aFunction->SetValue(aShape);
-
- log.SetTouched(Label());
-
- return 1;
-}
-
-
-//=======================================================================
-//function : MakeDiskHexagon
-//purpose :
-//=======================================================================
-TopoDS_Shell GEOMImpl_DividedDiskDriver::MakeDiskHexagon(double R, double Ratio) const
-{
- // Geometry
- gp_Dir ZDir(0,0,1);
- gp_Dir XDir(1,0,0);
- gp_Pnt Orig(0,0,0);
-
- // Circle
- gp_Ax1 Ax1(Orig,ZDir);
- gp_Ax2 Ax(Orig,ZDir,XDir);
- gp_Circ aCircle(Ax, R);
-
- // Points
-// gp_Pnt P4(0.01*Ratio*R,0,0);
-// gp_Pnt P3(R,0,0);
-// gp_Pnt P2 = P3.Rotated(Ax1,-M_PI/6.0);
-// gp_Pnt P1(P4.X(),
-// P4.X()/sqrt(3.0),0);
- gp_Pnt P1(0.01*Ratio*R*sqrt(3.0)/2,0,0);
- gp_Pnt P2(R,0,0);
- gp_Pnt P3 = P2.Rotated(Ax1,M_PI/6.0);
- gp_Pnt P4(P1.X(),
- P1.X()/sqrt(3.0),0);
-
-
- //surfaces
- gp_Ax2 anAx (gp::XOY());
- Handle(Geom_Plane) aPlane = new Geom_Plane (anAx);
-
- // Topology
-
- // Vertices
- TopoDS_Vertex O = BRepBuilderAPI_MakeVertex(Orig);
- TopoDS_Vertex V1_init = BRepBuilderAPI_MakeVertex(P1);
- TopoDS_Vertex V2_init = BRepBuilderAPI_MakeVertex(P2);
- TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(P3);
- TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(P4);
-
- TopoDS_Vertex V1 = V1_init;
- TopoDS_Vertex V2 = V2_init;
-
- //Rotation
- gp_Trsf myTrsf;
- myTrsf.SetRotation(Ax1, M_PI/3.0);
-
- BRepBuilderAPI_Transform xform(myTrsf);
- xform.Perform(V1,Standard_True);
- TopoDS_Vertex V1_60 = TopoDS::Vertex(xform.Shape());
- xform.Perform(V2,Standard_True);
- TopoDS_Vertex V2_60 = TopoDS::Vertex(xform.Shape());
-
- // Declaration of shapes (used in the loop)
- TopoDS_Edge E1, E2, E3, E4, E5, E6, E7, E8, E9;
- TopoDS_Wire W1, W2, W3;
- TopoDS_Face F1, F2, F3;
- TopoDS_Shell S;
-
- BRep_Builder aBuilder;
- aBuilder.MakeShell(S);
-
- // Initialisation of edges
- TopoDS_Edge E1_init = BRepBuilderAPI_MakeEdge(V1,TopoDS::Vertex(V2.Reversed()));
- E1 = E1_init;
- TopoDS_Edge E8_init = BRepBuilderAPI_MakeEdge(O,TopoDS::Vertex(V1.Reversed()));
- E8 = E8_init;
-
- for (int i=1;i<=6;i++)
- {
- // Edges
-
- // for Face1
- E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V3.Reversed()));
- E3 = BRepBuilderAPI_MakeEdge(V3,TopoDS::Vertex(V4.Reversed()));
- E4 = BRepBuilderAPI_MakeEdge(V4,TopoDS::Vertex(V1.Reversed()));
-
- // for Face2
- if (i==6)
- {
- E5 = BRepBuilderAPI_MakeEdge(aCircle, V3, TopoDS::Vertex(V2_init.Reversed()));
- E7 = BRepBuilderAPI_MakeEdge(V1_init,TopoDS::Vertex(V4.Reversed()));
- }
- else
- {
- E5 = BRepBuilderAPI_MakeEdge(aCircle, V3, TopoDS::Vertex(V2_60.Reversed()));
- E7 = BRepBuilderAPI_MakeEdge(V1_60,TopoDS::Vertex(V4.Reversed()));
- }
- E6 = BRepBuilderAPI_MakeEdge(V2_60,TopoDS::Vertex(V1_60.Reversed()));
-
- // for Face3
- E9 = BRepBuilderAPI_MakeEdge(V1_60,TopoDS::Vertex(O.Reversed()));
-
-
- // Wires
-
- //Wire1
- aBuilder.MakeWire(W1);
- if (i==1)
- aBuilder.Add(W1,E1);
- else
- aBuilder.Add(W1,TopoDS::Edge(E1.Reversed()));
- aBuilder.Add(W1,E2);
- aBuilder.Add(W1,E3);
- aBuilder.Add(W1,E4);
-
- // Wire 2
- aBuilder.MakeWire(W2);
- aBuilder.Add(W2,TopoDS::Edge(E3.Reversed()));
- aBuilder.Add(W2,E5);
- if (i==6)
- aBuilder.Add(W2,TopoDS::Edge(E1_init.Reversed()));
- else
- aBuilder.Add(W2,E6);
- aBuilder.Add(W2,E7);
-
- // Wire3
- aBuilder.MakeWire(W3);
- if (i==1)
- aBuilder.Add(W3,E8);
- else
- aBuilder.Add(W3,TopoDS::Edge(E8.Reversed()));
- aBuilder.Add(W3,TopoDS::Edge(E4.Reversed()));
- aBuilder.Add(W3,TopoDS::Edge(E7.Reversed()));
- if (i==6)
- aBuilder.Add(W3,TopoDS::Edge(E8_init.Reversed()));
- else
- aBuilder.Add(W3,E9);
-
- // Faces creation
- F1 = BRepBuilderAPI_MakeFace(aPlane,W1);
- F2 = BRepBuilderAPI_MakeFace(aPlane,W2);
- F3 = BRepBuilderAPI_MakeFace(aPlane,W3);
-
- //Shell
- aBuilder.Add(S, F1);
- aBuilder.Add(S, F2);
- aBuilder.Add(S, F3);
-
- // rotation
- V1=V1_60;
- V2=V2_60;
-
- xform.Perform(V1_60,Standard_True);
- V1_60 = TopoDS::Vertex(xform.Shape());
- xform.Perform(V2_60,Standard_True);
- V2_60 = TopoDS::Vertex(xform.Shape());
- xform.Perform(V3,Standard_True);
- V3 = TopoDS::Vertex(xform.Shape());
- xform.Perform(V4,Standard_True);
- V4 = TopoDS::Vertex(xform.Shape());
-
- // "Increment" of edges
- E1=E6;
- E8=E9;
- }
-
- return S;
-}
-
-//=======================================================================
-//function : MakeDiskSquare
-//purpose :
-//=======================================================================
-TopoDS_Shape GEOMImpl_DividedDiskDriver::MakeDiskSquare(double R, double Ratio) const
-{
- // Geometry
- gp_Dir ZDir(0,0,1);
- gp_Dir XDir(1,0,0);
- gp_Pnt Orig(0,0,0);
-
- // Circle
- gp_Ax1 Ax1(Orig,ZDir);
- gp_Ax2 Ax(Orig,ZDir,XDir);
- gp_Circ aCircle(Ax, R);
-
- // Points
- gp_Pnt P1(0.01*Ratio*R,0,0);
- gp_Pnt P2(R,0,0);
-
- //surfaces
- gp_Ax2 anAx (gp::XOY());
- Handle(Geom_Plane) aPlane = new Geom_Plane (anAx);
-
- // Topology
-
- // Vertices
- TopoDS_Vertex V1_init = BRepBuilderAPI_MakeVertex(P1);
- TopoDS_Vertex V2_init = BRepBuilderAPI_MakeVertex(P2);
-
- TopoDS_Vertex V1 = V1_init;
- TopoDS_Vertex V2 = V2_init;
-
- //Rotation
- gp_Trsf myTrsf;
- myTrsf.SetRotation(Ax1, M_PI/2);
-
- BRepBuilderAPI_Transform xform(myTrsf);
- xform.Perform(V1,Standard_True);
- TopoDS_Vertex V1_rotated = TopoDS::Vertex(xform.Shape());
- xform.Perform(V2,Standard_True);
- TopoDS_Vertex V2_rotated = TopoDS::Vertex(xform.Shape());
-
- // Declaration of shapes (used in the loop)
- TopoDS_Edge E1, E2, E3, E4;
- TopoDS_Wire W1, W2;
- TopoDS_Face F1, F2;
- TopoDS_Shell S;
-
- BRep_Builder aBuilder;
- aBuilder.MakeWire(W2); // Central Wire
- aBuilder.MakeShell(S); // Shell
-
- // Initialisation of edges
- TopoDS_Edge E1_init = BRepBuilderAPI_MakeEdge(V1,TopoDS::Vertex(V2.Reversed()));
- E1 = E1_init;
-
- for (int i=1;i<=4;i++)
- {
- // Edges
- // for Face1
-
- E3 = BRepBuilderAPI_MakeEdge(V2_rotated,TopoDS::Vertex(V1_rotated.Reversed()));
- if (i == 4)
- {
- E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V2_init.Reversed()));
- E4 = BRepBuilderAPI_MakeEdge(V1_init,TopoDS::Vertex(V1.Reversed()));
- }
- else
- {
- E2 = BRepBuilderAPI_MakeEdge(aCircle, V2, TopoDS::Vertex(V2_rotated.Reversed()));
- E4 = BRepBuilderAPI_MakeEdge(V1_rotated,TopoDS::Vertex(V1.Reversed()));
- }
-
- // Wires
- //Wire1
- aBuilder.MakeWire(W1);
- if (i==1)
- aBuilder.Add(W1,E1);
- else
- aBuilder.Add(W1,TopoDS::Edge(E1.Reversed()));
- aBuilder.Add(W1,E2);
- if (i==4)
- aBuilder.Add(W1,TopoDS::Edge(E1_init.Reversed()));
- else
- aBuilder.Add(W1,E3);
- aBuilder.Add(W1,E4);
-
- // Wire central
- aBuilder.Add(W2,TopoDS::Edge(E4.Reversed()));
-
- // Faces creation
- F1 = BRepBuilderAPI_MakeFace(aPlane,W1);
-
- //Shell
- aBuilder.Add(S, F1);
-
- // rotation
- V1=V1_rotated;
- V2=V2_rotated;
-
- xform.Perform(V1_rotated,Standard_True);
- V1_rotated = TopoDS::Vertex(xform.Shape());
- xform.Perform(V2_rotated,Standard_True);
- V2_rotated = TopoDS::Vertex(xform.Shape());
-
- // "Increment" of edges
- E1=E3;
- }
- // Central square Face
- F2 = BRepBuilderAPI_MakeFace(aPlane,W2);
- aBuilder.Add(S, F2);
-
- return S;
-}
-
-
-//=======================================================================
-//function : TrasformShape(TopoDS_Shape aShape,int theOrientation)
-//purpose : Perform shape transformation accordingly with specified
-// orientation
-//=======================================================================
-TopoDS_Shape GEOMImpl_DividedDiskDriver::TransformShape(TopoDS_Shape theShape, int theOrientation) const
-{
- gp_Dir N, Vx;
- gp_Pnt theOrigin = gp::Origin();
-
- switch(theOrientation)
- {
- case 1:
- {
- N = gp::DZ();
- Vx = gp::DX();
- break;
- }
- case 2:
- {
- N = gp::DX();
- Vx = gp::DY();
- break;
- }
- case 3:
- {
- N = gp::DY();
- Vx = gp::DZ();
- break;
- }
- }
-
- gp_Ax3 aWPlane = gp_Ax3(theOrigin, N, Vx);
-
- return WPlaneTransform(theShape, aWPlane);
-}
-
-//=======================================================================
-//function : TrasformShape(TopoDS_Shape aShape, gp_Dir V, gp_Pnt P)
-//purpose : Perform shape transformation accordingly with specified
-// pnt and direction
-//=======================================================================
-TopoDS_Shape GEOMImpl_DividedDiskDriver::TransformShape(TopoDS_Shape theShape, gp_Pnt P, gp_Dir V) const
-{
- gp_Ax3 aWPlane( P, V );
- return WPlaneTransform(theShape, aWPlane);
-}
-
-//=======================================================================
-//function : WPlaneTransform
-//purpose : Perform shape transformation accordingly with the given
-// Working Plane
-//=======================================================================
-TopoDS_Shape GEOMImpl_DividedDiskDriver::WPlaneTransform(TopoDS_Shape theShape, gp_Ax3 theWPlane) const
-{
- gp_Trsf aTrans;
- aTrans.SetTransformation(theWPlane);
- aTrans.Invert();
- BRepBuilderAPI_Transform aTransformation (theShape, aTrans, Standard_False);
- return aTransformation.Shape();
-}
-
-//================================================================================
-/*!
- * \brief Returns a name of creation operation and names and values of creation parameters
- */
-//================================================================================
-
-bool GEOMImpl_DividedDiskDriver::
-GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& theParams)
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_IDividedDisk aCI( function );
- Standard_Integer aType = function->GetType();
-
- theOperationName = "DIVIDEDDISK";
-
- switch ( aType ) {
- case DIVIDEDDISK_R_RATIO:
- AddParam( theParams, "Radius", aCI.GetR() );
- AddParam( theParams, "Ratio", aCI.GetRatio() );
- AddParam( theParams, "Orientation", aCI.GetOrientation() );
- AddParam( theParams, "Division pattern", aCI.GetType() );
- break;
- case DIVIDEDDISK_R_VECTOR_PNT:
- AddParam( theParams, "Center Point", aCI.GetCenter() );
- AddParam( theParams, "Vector", aCI.GetVector() );
- AddParam( theParams, "Radius", aCI.GetR() );
- AddParam( theParams, "Division pattern", aCI.GetType() );
- break;
- default:
- return false;
- }
-
- return true;
-}
-
-IMPLEMENT_STANDARD_HANDLE (GEOMImpl_DividedDiskDriver,GEOM_BaseDriver);
-IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_DividedDiskDriver,GEOM_BaseDriver);
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_DividedDiskDriver_HXX
-#define _GEOMImpl_DividedDiskDriver_HXX
-
-#include <TFunction_Driver.hxx>
-
-class Handle_Standard_Type;
-class GEOMImpl_DividedDiskDriver;
-class TopoDS_Shape;
-class TopoDS_Shell;
-class gp_Pnt;
-class gp_Dir;
-class gp_Ax3;
-
-#include "GEOM_BaseDriver.hxx"
-
-DEFINE_STANDARD_HANDLE( GEOMImpl_DividedDiskDriver, GEOM_BaseDriver );
-
-class GEOMImpl_DividedDiskDriver : public GEOM_BaseDriver {
-public:
- // Methods PUBLIC
- //
- Standard_EXPORT GEOMImpl_DividedDiskDriver();
- Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
- Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
- Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
- {
- return Standard_True;
- }
- Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT ~GEOMImpl_DividedDiskDriver() {};
-
- Standard_EXPORT virtual
- bool GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& params);
-private:
- TopoDS_Shape TransformShape (TopoDS_Shape aShape, int theOrientation) const;
- TopoDS_Shape TransformShape (TopoDS_Shape aShape, gp_Pnt P, gp_Dir V) const;
- TopoDS_Shape WPlaneTransform (TopoDS_Shape aShape, gp_Ax3 theWPlane) const;
- TopoDS_Shell MakeDiskHexagon (double R, double Ratio) const;
- TopoDS_Shape MakeDiskSquare (double R, double Ratio) const;
-
- DEFINE_STANDARD_RTTI( GEOMImpl_DividedDiskDriver )
-};
-
-#endif // _GEOMImpl_DividedDiskDriver_HXX
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : GEOMImpl_IAdvancedOperations.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-
-#include "GEOMImpl_IAdvancedOperations.hxx"
-
-#include <Basics_OCCTVersion.hxx>
-
-#include <utilities.h>
-#include <OpUtil.hxx>
-#include <Utils_ExceptHandlers.hxx>
-
-#include "GEOM_Function.hxx"
-#include "GEOM_PythonDump.hxx"
-#include "GEOMUtils.hxx"
-#include "GEOMAlgo_Splitter.hxx"
-#include "GEOMAlgo_FinderShapeOn1.hxx"
-
-#include "GEOMImpl_Gen.hxx"
-#include "GEOMImpl_Types.hxx"
-
-#include "GEOMImpl_IBasicOperations.hxx"
-#include "GEOMImpl_IBooleanOperations.hxx"
-#include "GEOMImpl_IShapesOperations.hxx"
-#include "GEOMImpl_ITransformOperations.hxx"
-#include "GEOMImpl_IBlocksOperations.hxx"
-#include "GEOMImpl_I3DPrimOperations.hxx"
-#include "GEOMImpl_ILocalOperations.hxx"
-#include "GEOMImpl_IHealingOperations.hxx"
-#include "GEOMImpl_IGroupOperations.hxx"
-
-#include "GEOMImpl_GlueDriver.hxx"
-#include "GEOMImpl_PipeTShapeDriver.hxx"
-#include "GEOMImpl_IPipeTShape.hxx"
-#include "GEOMImpl_DividedDiskDriver.hxx"
-#include "GEOMImpl_IDividedDisk.hxx"
-#include <GEOMImpl_SmoothingSurfaceDriver.hxx>
-#include <GEOMImpl_ISmoothingSurface.hxx>
-/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
-
-#include <TDF_Tool.hxx>
-#include <TFunction_DriverTable.hxx>
-#include <TFunction_Driver.hxx>
-#include <TFunction_Logbook.hxx>
-#include <TNaming_CopyShape.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
-
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-
-#include <BRepAdaptor_Surface.hxx>
-#include <BRepAlgoAPI_Cut.hxx>
-#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-#include <BRepPrimAPI_MakeCone.hxx>
-#include <BRepPrimAPI_MakeCylinder.hxx>
-
-#include <gp_Ax3.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <GC_MakeConicalSurface.hxx>
-#include <Geom_CylindricalSurface.hxx>
-
-#include <ShapeAnalysis_Edge.hxx>
-
-#include <cmath>
-
-#include "AdvancedEngine_Types.hxx"
-
-#include <Standard_Stream.hxx>
-#include <Standard_Failure.hxx>
-#include <StdFail_NotDone.hxx>
-#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
-#define HALF_LENGTH_MAIN_PIPE "Main pipe half length" //"Tuyau principal - demi longueur"
-#define HALF_LENGTH_INCIDENT_PIPE "Incident pipe half length" //"Tuyau incident - demi longueur"
-#define CIRCULAR_QUARTER_PIPE "Circular quarter of pipe" //"Circulaire - quart de tuyau"
-#define THICKNESS "Thickness" //"Epaisseur"
-#define FLANGE "Flange" // "Collerette"
-#define CHAMFER_OR_FILLET "Chamfer or fillet" //"Chanfrein ou Raccord"
-#define JUNCTION_FACE_1 "Junction 1" //"Face de jonction 1"
-#define JUNCTION_FACE_2 "Junction 2" //"Face de jonction 2"
-#define JUNCTION_FACE_3 "Junction 3" //"Face de jonction 3"
-
-#define FIND_GROUPS_BY_POINTS 1
-
-//=============================================================================
-/*!
- * Constructor
- */
-//=============================================================================
-GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID) :
- GEOM_IOperations(theEngine, theDocID)
-{
- MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations");
- 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());
-}
-
-//=============================================================================
-/*!
- * Destructor
- */
-//=============================================================================
-GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations()
-{
- MESSAGE("GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations");
- delete myBasicOperations;
- delete myBooleanOperations;
- delete myShapesOperations;
- delete myTransformOperations;
- delete myBlocksOperations;
- delete my3DPrimOperations;
- delete myLocalOperations;
- delete myHealingOperations;
- delete myGroupOperations;
-}
-
-//=============================================================================
-/*!
- * SetPosition
- */
-//=============================================================================
-gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3)
-{
- // Old Local Coordinates System oldLCS
- gp_Pnt P0(0, 0, 0);
- gp_Pnt P1(-theL1, 0, 0);
- gp_Pnt P2(theL1, 0, 0);
- gp_Pnt P3(0, 0, theL2);
-
- gp_Dir oldX(gp_Vec(P1, P2));
- gp_Dir oldZ(gp_Vec(P0, P3));
- gp_Ax3 oldLCS(P0, oldZ, oldX);
-
- // New Local Coordinates System newLCS
- double LocX, LocY, LocZ;
- gp_Pnt newP1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
- gp_Pnt newP2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue()));
- gp_Pnt newP3 = BRep_Tool::Pnt(TopoDS::Vertex(theP3->GetValue()));
- LocX = (newP1.X() + newP2.X()) / 2.;
- LocY = (newP1.Y() + newP2.Y()) / 2.;
- LocZ = (newP1.Z() + newP2.Z()) / 2.;
- gp_Pnt newO(LocX, LocY, LocZ);
-
- gp_Dir newX(gp_Vec(newP1, newP2)); // P1P2 Vector
- gp_Dir newZ(gp_Vec(newO, newP3)); // OP3 Vector
- gp_Ax3 newLCS = gp_Ax3(newO, newZ, newX);
-
- gp_Trsf aTrsf;
- aTrsf.SetDisplacement(oldLCS, newLCS);
-
- return aTrsf;
-}
-
-//=============================================================================
-/*!
- * CheckCompatiblePosition
- *
- */
-//=============================================================================
-bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double& theL2,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3,
- double theTolerance)
-{
- SetErrorCode(KO);
- gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
- gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(theP2->GetValue()));
- gp_Pnt P3 = BRep_Tool::Pnt(TopoDS::Vertex(theP3->GetValue()));
-
- double d12 = P1.Distance(P2);
- double d13 = P1.Distance(P3);
- double d23 = P2.Distance(P3);
- // double d2 = newO.Distance(P3);
-
- if (Abs(d12) <= Precision::Confusion()) {
- SetErrorCode("Junctions points P1 and P2 are identical");
- return false;
- }
- if (Abs(d13) <= Precision::Confusion()) {
- SetErrorCode("Junctions points P1 and P3 are identical");
- return false;
- }
- if (Abs(d23) <= Precision::Confusion()) {
- SetErrorCode("Junctions points P2 and P3 are identical");
- return false;
- }
-
-
- double newL1 = 0.5 * d12;
- double newL2 = sqrt(pow(d13,2)-pow(newL1,2));
- //
- // theL1*(1-theTolerance) <= newL1 <= theL1*(1+theTolerance)
- //
- if (fabs(newL1 - theL1) > Precision::Approximation()) {
- if ( (newL1 * (1 - theTolerance) -theL1 <= Precision::Approximation()) &&
- (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) {
- // std::cerr << "theL1 = newL1" << std::endl;
- theL1 = newL1;
- } else {
- theL1 = -1;
- SetErrorCode("Dimension for main pipe (L1) is incompatible with new position");
- return false;
- }
- }
-
- //
- // theL2*(1-theTolerance) <= newL2 <= theL2*(1+theTolerance)
- //
- if (fabs(newL2 - theL2) > Precision::Approximation()) {
- if ( (newL2 * (1 - theTolerance) -theL2 <= Precision::Approximation()) &&
- (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) {
- theL2 = newL2;
- } else {
- theL2 = -1;
- SetErrorCode("Dimension for incident pipe (L2) is incompatible with new position");
- return false;
- }
- }
-
- SetErrorCode(OK);
- return true;
-
-}
-
-//=============================================================================
-/*!
- * Generate the propagation groups of a Pipe T-Shape used for hexa mesh
- */
-//=============================================================================
-bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theH, double theW, double theRF,
- Handle(TColStd_HSequenceOfTransient) theSeq,
- gp_Trsf aTrsf)
-{
- SetErrorCode(KO);
-
- if (theShape.IsNull()) return false;
-
- TopoDS_Shape aShape = theShape->GetValue();
- if (aShape.IsNull()) {
- SetErrorCode("Shape is not defined");
- return false;
- }
-
- gp_Trsf aTrsfInv = aTrsf.Inverted();
-
-// int expectedGroups = 0;
-// if (shapeType == TSHAPE_BASIC)
-// if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation())
-// expectedGroups = 10;
-// else
-// expectedGroups = 11;
-// else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET)
-// expectedGroups = 12;
-
- double aR1Ext = theR1 + theW1;
- double aR2Ext = theR2 + theW2;
-
- /////////////////////////
- //// Groups of Faces ////
- /////////////////////////
-
- //
- // Comment the following lines when GetInPlace bug is solved
- // == BEGIN
- // Workaround of GetInPlace bug
- // Create a bounding box that fits the shape
- Handle(GEOM_Object) aBox = my3DPrimOperations->MakeBoxDXDYDZ(2*theL1, 2*aR1Ext, aR1Ext+theL2);
- aBox->GetLastFunction()->SetDescription("");
- myTransformOperations->TranslateDXDYDZ(aBox, -theL1, -aR1Ext, -aR1Ext);
- aBox->GetLastFunction()->SetDescription("");
- // Apply transformation to box
- BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False);
- TopoDS_Shape aBoxShapeTrsf = aTransformationBox.Shape();
- aBox->GetLastFunction()->SetValue(aBoxShapeTrsf);
-
- // Get the shell of the box
- Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast
- (myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1));
- aBox->GetLastFunction()->SetDescription("");
- aShell->GetLastFunction()->SetDescription("");
- // Get the common shapes between shell and shape
- Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean
- (theShape, aShell, 1, Standard_False); // MakeCommon
- if (aCommonCompound.IsNull()) {
- SetErrorCode(myBooleanOperations->GetErrorCode());
- return false;
- }
- aCommonCompound->GetLastFunction()->SetDescription("");
- // Explode the faces of common shapes => 3 faces
- Handle(TColStd_HSequenceOfTransient) aCommonFaces =
- myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true);
- aCommonCompound->GetLastFunction()->SetDescription("");
- std::list<Handle(GEOM_Object)> aCompoundOfFacesList;
-
- for (int i=0 ; i<= aCommonFaces->Length()-4 ; i+=4) {
- std::list<Handle(GEOM_Object)> aFacesList;
- for (int j = 1 ; j <= 4 ; j++) {
- Handle(GEOM_Object) aFace = Handle(GEOM_Object)::DownCast(aCommonFaces->Value(i+j)); // Junction faces
- if (!aFace.IsNull()) {
- aFace->GetLastFunction()->SetDescription("");
- aFacesList.push_back(aFace);
- }
- }
- Handle(GEOM_Object) aCompoundOfFaces = myShapesOperations->MakeCompound(aFacesList);
- if (!aCompoundOfFaces.IsNull()) {
- aCompoundOfFaces->GetLastFunction()->SetDescription("");
- aCompoundOfFacesList.push_back(aCompoundOfFaces);
- }
- }
-
- if (aCompoundOfFacesList.size() == 3) {
- Handle(GEOM_Object) aPln1 = aCompoundOfFacesList.front();
- aCompoundOfFacesList.pop_front();
- Handle(GEOM_Object) aPln2 = aCompoundOfFacesList.front();
- aCompoundOfFacesList.pop_front();
- Handle(GEOM_Object) aPln3 = aCompoundOfFacesList.front();
- aCompoundOfFacesList.pop_front();
- // == END
- //
-
-
- // Uncomment the following lines when GetInPlace bug is solved
- // == BEGIN
-// Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0);
-// Handle(GEOM_Object) aP2 = myBasicOperations->MakePointXYZ(-0, 0, theL2);
-// Handle(GEOM_Object) aP3 = myBasicOperations->MakePointXYZ(theL1, 0, 0);
-// aP1->GetLastFunction()->SetDescription("");
-// aP2->GetLastFunction()->SetDescription("");
-// aP3->GetLastFunction()->SetDescription("");
-// Handle(GEOM_Object) aV1 = myBasicOperations->MakeVectorDXDYDZ(-1, 0, 0);
-// Handle(GEOM_Object) aV2 = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
-// Handle(GEOM_Object) aV3 = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
-// aV1->GetLastFunction()->SetDescription("");
-// aV2->GetLastFunction()->SetDescription("");
-// aV3->GetLastFunction()->SetDescription("");
-// Handle(GEOM_Object) aPln1 = myBasicOperations->MakePlanePntVec(aP1, aV1, 2*(aR1Ext+theL2));
-// Handle(GEOM_Object) aPln2 = myBasicOperations->MakePlanePntVec(aP2, aV2, 2*(aR2Ext));
-// Handle(GEOM_Object) aPln3 = myBasicOperations->MakePlanePntVec(aP3, aV3, 2*(aR1Ext+theL2));
-// aPln1->GetLastFunction()->SetDescription("");
-// aPln2->GetLastFunction()->SetDescription("");
-// aPln3->GetLastFunction()->SetDescription("");
-//
-// BRepBuilderAPI_Transform aTransformation1(aPln1->GetValue(), aTrsf, Standard_False);
-// TopoDS_Shape aTrsf_Shape1 = aTransformation1.Shape();
-// aPln1->GetLastFunction()->SetValue(aTrsf_Shape1);
-// BRepBuilderAPI_Transform aTransformation2(aPln2->GetValue(), aTrsf, Standard_False);
-// TopoDS_Shape aTrsf_Shape2 = aTransformation2.Shape();
-// aPln2->GetLastFunction()->SetValue(aTrsf_Shape2);
-// BRepBuilderAPI_Transform aTransformation3(aPln3->GetValue(), aTrsf, Standard_False);
-// TopoDS_Shape aTrsf_Shape3 = aTransformation3.Shape();
-// aPln3->GetLastFunction()->SetValue(aTrsf_Shape3);
- // == END
- //
-
- Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1);
- if (junctionFaces1.IsNull())
- junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound
- (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
- if (!junctionFaces1.IsNull()) {
- junctionFaces1->GetLastFunction()->SetDescription("");
- junctionFaces1->SetName("JUNCTION_FACE_1");
- theSeq->Append(junctionFaces1);
- }
- else {
- SetErrorCode("Junction face 1 not found");
- // theSeq->Append(aPln1);
- // return false;
- }
- Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2);
- if (junctionFaces2.IsNull())
- junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound
- (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
- if (!junctionFaces2.IsNull()) {
- junctionFaces2->GetLastFunction()->SetDescription("");
- junctionFaces2->SetName("JUNCTION_FACE_2");
- theSeq->Append(junctionFaces2);
- }
- else {
- SetErrorCode("Junction face 2 not found");
- // theSeq->Append(aPln2);
- // return false;
- }
- Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3);
- if (junctionFaces3.IsNull())
- junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound
- (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN);
- if (!junctionFaces3.IsNull()) {
- junctionFaces3->GetLastFunction()->SetDescription("");
- junctionFaces3->SetName("JUNCTION_FACE_3");
- theSeq->Append(junctionFaces3);
- }
- else {
- SetErrorCode("Junction face 3 not found");
- // theSeq->Append(aPln3);
- // return false;
- }
- // Comment the following lines when GetInPlace bug is solved
- // == BEGIN
- }
- // == END
-
- /////////////////////////
- //// Groups of Edges ////
- /////////////////////////
- // Result of propagate
-
- Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
-
- TCollection_AsciiString theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) aSeqPropagate = myBlocksOperations->Propagate(theShape);
- if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) {
- SetErrorCode("Propagation groups not found");
- return false;
- }
- Standard_Integer aNbGroups = aSeqPropagate->Length();
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
-
-#ifdef FIND_GROUPS_BY_POINTS
- // BEGIN: new groups search
-
- // W2 R2
- // .----.-----.----.
- // e| | | | |
- // | | | | |
- // . | | | .
- // g / ''..| | |..'' \
- // f / ''''''' \
- // .---.--'.. | | | ..'--.---.
- // |a \ '''...........''' / |
- // |-------\------' | '------/-------.
- // | \ | / |
- // c| \ | / |
- // | R1 \ | / |
- // | \ | / |
- // ._________________|_________________.
- // | L1 | |
- // | | |
- // | | |
- // b| | |
- // | | |
- // |-----------------|-----------------|
- // | W1 | |
- // '-----------------'-----------------'
- // d
-
- // "Thickness" group (a)
- gp_Pnt aPntA (-theL1, 0, theR1 + theW1/2.);
- aPntA.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexA (aPntA);
- TopoDS_Vertex aVertA = TopoDS::Vertex(mkVertexA.Shape());
- TopoDS_Shape anEdgeA = GEOMUtils::GetEdgeNearPoint(aShape, aVertA);
-
- // "Circular quarter of pipe" group (b)
- gp_Pnt aPntB (-theL1, -aR1Ext * sin(M_PI/4.), -aR1Ext * sin(M_PI/4.));
- aPntB.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexB (aPntB);
- TopoDS_Vertex aVertB = TopoDS::Vertex(mkVertexB.Shape());
- TopoDS_Shape anEdgeB = GEOMUtils::GetEdgeNearPoint(aShape, aVertB);
-
- // "Circular quarter of pipe" group (c)
- gp_Pnt aPntC (-theL1, -aR1Ext * sin(M_PI/4.), aR1Ext * sin(M_PI/4.));
- aPntC.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexC (aPntC);
- TopoDS_Vertex aVertC = TopoDS::Vertex(mkVertexC.Shape());
- TopoDS_Shape anEdgeC = GEOMUtils::GetEdgeNearPoint(aShape, aVertC);
-
- // "Main pipe half length" group (d)
- gp_Pnt aPntD (-theL1/2., 0, -aR1Ext);
- aPntD.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexD (aPntD);
- TopoDS_Vertex aVertD = TopoDS::Vertex(mkVertexD.Shape());
- TopoDS_Shape anEdgeD = GEOMUtils::GetEdgeNearPoint(aShape, aVertD);
-
- // "Incident pipe half length" group (e)
- double aTol10 = Precision::Confusion() * 10.;
- gp_Pnt aPntE (-aR2Ext, 0, theL2 - aTol10);
- aPntE.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexE (aPntE);
- TopoDS_Vertex aVertE = TopoDS::Vertex(mkVertexE.Shape());
- TopoDS_Shape anEdgeE = GEOMUtils::GetEdgeNearPoint(aShape, aVertE);
-
- // "Flange" group (f)
- double aFx = - aR2Ext - aTol10;
- if (shapeType == TSHAPE_CHAMFER)
- aFx -= theW;
- else if (shapeType == TSHAPE_FILLET)
- aFx -= theRF;
- gp_Pnt aPntF (aFx, 0, aR1Ext);
- aPntF.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexF (aPntF);
- TopoDS_Vertex aVertF = TopoDS::Vertex(mkVertexF.Shape());
- TopoDS_Shape anEdgeF = GEOMUtils::GetEdgeNearPoint(aShape, aVertF);
-
- // "Chamfer or Fillet" group (g)
- TopoDS_Shape anEdgeG;
- if (shapeType == TSHAPE_CHAMFER) {
- gp_Pnt aPntG (-aR2Ext - theW/2., 0, aR1Ext + theH/2.);
- aPntG.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexG (aPntG);
- TopoDS_Vertex aVertG = TopoDS::Vertex(mkVertexG.Shape());
- anEdgeG = GEOMUtils::GetEdgeNearPoint(aShape, aVertG);
- }
- else if (shapeType == TSHAPE_FILLET) {
- gp_Pnt aPntG (-aR2Ext - theRF/2., 0, aR1Ext + theRF/2.);
- aPntG.Transform(aTrsf);
- BRepBuilderAPI_MakeVertex mkVertexG (aPntG);
- TopoDS_Vertex aVertG = TopoDS::Vertex(mkVertexG.Shape());
- anEdgeG = GEOMUtils::GetEdgeNearPoint(aShape, aVertG);
- }
-
- for (int i = 1 ; i <= aNbGroups; i++) {
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i));
- if (aGroup.IsNull())
- continue;
-
- TopoDS_Shape aGroupShape = aGroup->GetValue();
- TopTools_IndexedMapOfShape anEdgesMap;
- TopExp::MapShapes(aGroupShape, TopAbs_EDGE, anEdgesMap);
-
- if (anEdgesMap.Contains(anEdgeA)) { // a
- aGroup->SetName("THICKNESS");
- theSeq->Append(aGroup);
- }
- else if (anEdgesMap.Contains(anEdgeB)) { // b
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- theSeq->Append(aGroup);
- }
- else if (anEdgesMap.Contains(anEdgeC)) { // c
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- theSeq->Append(aGroup);
- }
- else if (anEdgesMap.Contains(anEdgeD)) { // d
- aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
- theSeq->Append(aGroup);
- }
- else if (anEdgesMap.Contains(anEdgeE)) { // e
- aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
- theSeq->Append(aGroup);
- }
- else if (anEdgesMap.Contains(anEdgeF)) { // f
- aGroup->SetName("FLANGE");
- theSeq->Append(aGroup);
- }
- else if (shapeType == TSHAPE_CHAMFER) { // g
- if (anEdgesMap.Contains(anEdgeG)) {
- aGroup->SetName("CHAMFER");
- theSeq->Append(aGroup);
- }
- }
- else if (shapeType == TSHAPE_FILLET) { // g
- if (anEdgesMap.Contains(anEdgeG)) {
- aGroup->SetName("FILLET");
- theSeq->Append(aGroup);
- }
- }
- else {
- }
- }
- // END: new groups search
-#else
- bool addGroup;
- bool circularFoundAndAdded = false;
- bool circularFound10 = false;
- bool incidentPipeFound = false;
- bool mainPipeFound = false;
- bool mainPipeFoundAndAdded = false;
- bool radialFound =false;
- bool flangeFound = false;
- bool flangeFoundAndAdded = false;
- bool chamferOrFilletFound = false;
-
- for (int i = 1 ; i <= aNbGroups; i++) {
- addGroup = false;
-
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i));
- if (aGroup.IsNull())
- continue;
-
- TopoDS_Shape aGroupShape = aGroup->GetValue();
- BRepBuilderAPI_Transform aTransformationShapeInv (aGroupShape, aTrsfInv, Standard_False);
- TopoDS_Shape aGroupShapeTrsfInv = aTransformationShapeInv.Shape();
-
- TopTools_IndexedMapOfShape anEdgesMap;
- TopExp::MapShapes(aGroupShapeTrsfInv,TopAbs_EDGE, anEdgesMap);
- Standard_Integer nbEdges = anEdgesMap.Extent();
-
- if (shapeType == TSHAPE_BASIC) {
- if ((nbEdges >= 21) || /*R1Ext = R2Ext*/(nbEdges == 17)) { // 17, 17+8*{1,2,3}, 21, 21+8*{1,2,3}
- addGroup = true;
- aGroup->SetName("THICKNESS");
- }
- else if (nbEdges == 6) {
- if (!circularFoundAndAdded) {
- circularFoundAndAdded = true;
- addGroup = true;
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- }
- }
- else if (nbEdges == 8) {
- incidentPipeFound = true;
- mainPipeFound = false;
- radialFound = false;
- flangeFound = false;
-
- TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX);
- while (Ex.More()) {
- gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- double x=aP.X(), y=aP.Y(), z=aP.Z();
-
-
- if ((Abs(x) > aR2Ext + Precision::Confusion()) ||
- (Abs(y) > aR2Ext + Precision::Confusion())) {
- incidentPipeFound = false;
- }
-
- if ( z < -Precision::Confusion()) {
- // length of main pipe
- mainPipeFound = true;
- if (!mainPipeFoundAndAdded) {
- mainPipeFoundAndAdded = true;
- addGroup = true;
- aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
- }
- }
-
- else if (Abs(x) > (theL1-Precision::Confusion())) {
- // discretisation circulaire
- radialFound = true;
- if (!circularFoundAndAdded) {
- circularFoundAndAdded = true;
- addGroup = true;
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- }
- }
- Ex.Next();
- }
- if (incidentPipeFound) {
- addGroup = true;
- aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
- }
- if (!addGroup && (!incidentPipeFound &&
- !radialFound &&
- !mainPipeFound &&
- !flangeFound)) {
- // Flange (collerette)
- flangeFound = true;
- addGroup = true;
- aGroup->SetName("FLANGE");
- }
- }
- else
- continue;
- }
- else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) {
- if (nbEdges >= 25) { // 25, 25+8, 25+16, 25+24
- addGroup = true;
- aGroup->SetName("THICKNESS");
- }
- else if ((nbEdges == 10) || (nbEdges == 6)) {
- if (!circularFoundAndAdded) {
- addGroup = true;
- circularFoundAndAdded = true;
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- if (nbEdges == 10) {
- circularFound10 = true;
- }
- }
- else if (!circularFound10 && nbEdges == 10) {
- circularFound10 = true;
- addGroup = true;
- aGroup->SetName("CIRCULAR_QUARTER_PIPE");
- }
- }
- else if (nbEdges == 8) {
- incidentPipeFound = true;
- mainPipeFound = true;
- flangeFound = false;
-
- bool isNearZ0 = false;
- bool isBelowZ0 = false;
-
- TopExp_Explorer Ex (aGroupShapeTrsfInv,TopAbs_VERTEX);
- while (Ex.More()) {
- gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- double x=aP.X(), y=aP.Y(), z=aP.Z();
-
- // tuy_princ_long_avant & tuy_princ_long_apres
- //bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) &&
- // ((y <= aR1Ext + Precision::Confusion()) ||
- // (y <= -(aR1Ext + Precision::Confusion())) ||
- // (y <= theR1 + Precision::Confusion()) ||
- // (y == -(theR1 + Precision::Confusion()))));
- bool isMain = ((z < Precision::Confusion() || x < Precision::Confusion()) &&
- (fabs(y) > theR1 - Precision::Confusion() ||
- fabs(y) < Precision::Confusion()));
-
- if (!isMain) {
- mainPipeFound = false;
- }
-
- // collerette
- //if (z < Precision::Confusion() && !isMain) {
- // flangeFound = true;
- // if (!flangeFoundAndAdded) {
- // flangeFoundAndAdded = true;
- // addGroup = true;
- // aGroup->SetName("FLANGE");
- // }
- //}
- if (fabs(z) < Precision::Confusion()) isNearZ0 = true;
- if (z < - Precision::Confusion()) isBelowZ0 = true;
-
- // tuyau incident
- if ((Abs(x) > aR2Ext + Precision::Confusion()) ||
- (Abs(y) > aR2Ext + Precision::Confusion())) {
- incidentPipeFound = false;
- }
- Ex.Next();
- }
- if (mainPipeFound) {
- addGroup = true;
- aGroup->SetName("HALF_LENGTH_MAIN_PIPE");
- }
- if (incidentPipeFound) {
- addGroup = true;
- aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE");
- }
- if (isNearZ0 && !isBelowZ0) {
- flangeFound = true;
- if (!flangeFoundAndAdded) {
- flangeFoundAndAdded = true;
- addGroup = true;
- aGroup->SetName("FLANGE");
- }
- }
- if (!addGroup && (!incidentPipeFound &&
- !mainPipeFound &&
- !flangeFound &&
- !chamferOrFilletFound)) {
- addGroup = true;
- chamferOrFilletFound = true;
- if (shapeType == TSHAPE_CHAMFER)
- aGroup->SetName("CHAMFER");
- else
- aGroup->SetName("FILLET");
- }
- }
- else
- continue;
- }
- // Add group to the list
- if (addGroup)
- theSeq->Append(aGroup);
- }
-#endif
-
- SetErrorCode(OK);
- return true;
-}
-
-//=============================================================================
-/*!
- * Return faces that are laying on surface.
- */
-//=============================================================================
-bool GEOMImpl_IAdvancedOperations::GetFacesOnSurf
- (const TopoDS_Shape &theShape,
- const Handle_Geom_Surface& theSurface,
- const Standard_Real theTolerance,
- TopTools_ListOfShape &theFaces)
-{
- GEOMAlgo_FinderShapeOn1 aFinder;
-
- aFinder.SetShape(theShape);
- aFinder.SetTolerance(theTolerance);
- aFinder.SetSurface(theSurface);
- aFinder.SetShapeType(TopAbs_FACE);
- aFinder.SetState(GEOMAlgo_ST_ON);
-
- // Sets the minimal number of inner points for the faces that do not have own
- // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
- // Default value=3
- aFinder.SetNbPntsMin(3);
- // Sets the maximal number of inner points for edges or faces.
- // It is usefull for the cases when this number is very big (e.g =2000) to improve
- // the performance. If this value =0, all inner points will be taken into account.
- // Default value=0
- aFinder.SetNbPntsMax(100);
- aFinder.Perform();
-
- // Interprete results
- Standard_Integer iErr = aFinder.ErrorStatus();
- // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
- if (iErr) {
- MESSAGE(" iErr : " << iErr);
- TCollection_AsciiString aMsg (" iErr : ");
- aMsg += TCollection_AsciiString(iErr);
- SetErrorCode(aMsg);
- return false;
- }
- Standard_Integer iWrn = aFinder.WarningStatus();
- // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
- if (iWrn) {
- MESSAGE(" *** iWrn : " << iWrn);
- }
-
- const TopTools_ListOfShape &aListRes = aFinder.Shapes(); // the result
- TopTools_ListIteratorOfListOfShape anIter (aListRes);
-
- for (; anIter.More(); anIter.Next()) {
- theFaces.Append(anIter.Value());
- }
-
- return true;
-}
-
-//=============================================================================
-/*!
- * Creates and returns conical face.
- */
-//=============================================================================
-TopoDS_Shape GEOMImpl_IAdvancedOperations::MakeConicalFace
- (const gp_Ax2 &theAxis,
- const double theRadius,
- const double theRadiusThin,
- const double theHeight,
- const gp_Trsf &theTrsf)
-{
- BRepPrimAPI_MakeCone aMkCone (theAxis, theRadius, theRadiusThin, theHeight);
- TopoDS_Shape aResult;
-
- aMkCone.Build();
- if (aMkCone.IsDone()) {
- TopExp_Explorer anExp(aMkCone.Shape(), TopAbs_FACE);
-
- for (; anExp.More(); anExp.Next()) {
- TopoDS_Face aFace = TopoDS::Face(anExp.Current());
-
- if (aFace.IsNull() == Standard_False) {
- BRepAdaptor_Surface anAdaptor(aFace, Standard_False);
-
- if (anAdaptor.GetType() == GeomAbs_Cone) {
- // This is a conical face. Transform and return it.
- BRepBuilderAPI_Transform aTransf(aFace, theTrsf, Standard_False);
-
- aResult = aTransf.Shape();
- break;
- }
- }
- }
- }
-
- return aResult;
-}
-
-//=============================================================================
-/*!
- * Generate the internal group of a Pipe T-Shape
- */
-//=============================================================================
-bool GEOMImpl_IAdvancedOperations::MakeInternalGroup
- (const Handle(GEOM_Object) &theShape,
- const double theR1, const double theLen1,
- const double theR2, const double theLen2,
- const double theRL, double theTransLenL,
- const double theRR, double theTransLenR,
- const double theRI, double theTransLenI,
- const Handle(TColStd_HSequenceOfTransient) &theSeq,
- const gp_Trsf &theTrsf)
-{
- SetErrorCode(KO);
-
- if (theShape.IsNull()) {
- return false;
- }
-
- TopoDS_Shape aShape = theShape->GetValue();
-
- if (aShape.IsNull()) {
- SetErrorCode("Shape is not defined");
- return false;
- }
-
- // Compute tolerance
- Standard_Real aMaxTol = -RealLast();
- TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
-
- for (; anExp.More(); anExp.Next()) {
- TopoDS_Vertex aVertex = TopoDS::Vertex(anExp.Current());
-
- if (aVertex.IsNull() == Standard_False) {
- const Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
-
- if (aTol > aMaxTol) {
- aMaxTol = aTol;
- }
- }
- }
-
- // Construct internal surfaces.
- Standard_Integer i = 0;
- const Standard_Integer aMaxNbSurf = 5;
- Handle(Geom_Surface) aSurface[aMaxNbSurf];
- TopTools_ListOfShape aConicalFaces;
- Standard_Real aTolConf = Precision::Confusion();
-
- // 1. Construct the internal surface of main pipe.
- gp_Ax2 anAxis1 (gp::Origin(), gp::DX(), gp::DZ());
- gp_Ax2 anAxis2 (gp::Origin(), gp::DZ(), gp::DX());
-
- aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theR1);
-
- // 2. Construct the internal surface of incident pipe.
- aSurface[i++] = new Geom_CylindricalSurface(anAxis2, theR2);
-
- // 3. Construct the internal surface of left reduction pipe.
- if (theRL > aTolConf) {
- aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theRL);
-
- if (theTransLenL > aTolConf) {
- // 3.1. Construct the internal surface of left transition pipe.
- gp_Pnt aPLeft (-theLen1, 0., 0.);
- gp_Ax2 anAxisLeft (aPLeft, -gp::DX(), gp::DZ());
- TopoDS_Shape aConeLeft =
- MakeConicalFace(anAxisLeft, theR1, theRL, theTransLenL, theTrsf);
-
- if (aConeLeft.IsNull() == Standard_False) {
- aConicalFaces.Append(aConeLeft);
- }
- }
- }
-
- // 4. Construct the internal surface of right reduction pipe.
- if (theRR > aTolConf) {
- // There is no need to construct another cylinder of the same radius. Skip it.
- if (Abs(theRR - theRL) > aTolConf) {
- aSurface[i++] = new Geom_CylindricalSurface(anAxis1, theRR);
- }
-
- if (theTransLenL > aTolConf) {
- // 4.1. Construct the internal surface of right transition pipe.
- gp_Pnt aPRight (theLen1, 0., 0.);
- gp_Ax2 anAxisRight (aPRight, gp::DX(), gp::DZ());
- TopoDS_Shape aConeRight =
- MakeConicalFace(anAxisRight, theR1, theRR, theTransLenR, theTrsf);
-
- if (aConeRight.IsNull() == Standard_False) {
- aConicalFaces.Append(aConeRight);
- }
- }
- }
-
- // 5. Construct the internal surface of incident reduction pipe.
- if (theRI > aTolConf) {
- aSurface[i++] = new Geom_CylindricalSurface(anAxis2, theRI);
-
- if (theTransLenI > aTolConf) {
- // 5.1. Construct the internal surface of incident transition pipe.
- gp_Pnt aPInci (0., 0., theLen2);
- gp_Ax2 anAxisInci (aPInci, gp::DZ(), gp::DX());
- TopoDS_Shape aConeInci =
- MakeConicalFace(anAxisInci, theR2, theRI, theTransLenI, theTrsf);
-
- if (aConeInci.IsNull() == Standard_False) {
- aConicalFaces.Append(aConeInci);
- }
- }
- }
-
- // Get faces that are laying on cylindrical surfaces.
- TopTools_ListOfShape aFaces;
- gp_Trsf anInvTrsf = theTrsf.Inverted();
-
- for (i = 0; i < aMaxNbSurf; i++) {
- if (aSurface[i].IsNull()) {
- break;
- }
-
- aSurface[i]->Transform(theTrsf);
-
- TopTools_ListOfShape aLocalFaces;
-
- if (!GetFacesOnSurf(aShape, aSurface[i], aMaxTol, aLocalFaces)) {
- return false;
- }
-
- if (i < 2) {
- // Check if the result contains outer cylinders.
- // It is required for main and incident pipes.
- TopTools_ListIteratorOfListOfShape anIter(aLocalFaces);
-
- while (anIter.More()) {
- TopExp_Explorer anExp(anIter.Value(), TopAbs_VERTEX);
- Standard_Boolean isInside = Standard_False;
-
- // Get a vertex from this shape
- if (anExp.More()) {
- TopoDS_Vertex aVtx = TopoDS::Vertex(anExp.Current());
-
- if (aVtx.IsNull() == Standard_False) {
- gp_Pnt aPnt = BRep_Tool::Pnt(aVtx);
-
- aPnt.Transform(anInvTrsf);
-
- if (i == 0) {
- // Check if the point is inside the main pipe.
- isInside = (Abs(aPnt.X()) <= theLen1);
- } else { // i == 1
- // Check if the point is inside the incident pipe.
- isInside = (aPnt.Z() <= theLen2);
- }
- }
- }
-
- if (isInside) {
- // Keep this face.
- anIter.Next();
- } else {
- // Remove this face.
- aLocalFaces.Remove(anIter);
- }
- }
- }
-
- aFaces.Append(aLocalFaces);
- }
-
- // Get faces that are laying on conical faces.
- if (aConicalFaces.IsEmpty() == Standard_False) {
- Handle(GEOM_Object) aCone =
- GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- Handle(GEOM_Function) aFunction =
- aCone->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
- TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces);
- Handle(GEOM_Object) aConeFromShape;
-
- for (; aFIter.More(); aFIter.Next()) {
- aFunction->SetValue(aFIter.Value());
- aConeFromShape = myShapesOperations->GetInPlace(theShape, aCone);
-
- if (aConeFromShape.IsNull() == Standard_False) {
- aConeFromShape->GetLastFunction()->SetDescription("");
- TopoDS_Shape aConeFaces = aConeFromShape->GetValue();
- TopExp_Explorer anExp(aConeFaces, TopAbs_FACE);
-
- for (; anExp.More(); anExp.Next()) {
- TopoDS_Face aConeFace = TopoDS::Face(anExp.Current());
-
- if (aConeFace.IsNull() == Standard_False) {
- aFaces.Append(aConeFace);
- }
- }
- }
- }
- }
-
- // Create a group of internal faces.
- if (aFaces.IsEmpty() == Standard_False) {
- Handle(GEOM_Object) aGroup = myGroupOperations->CreateGroup(theShape, TopAbs_FACE);
-
- if (aGroup.IsNull() == Standard_False) {
- aGroup->GetLastFunction()->SetDescription("");
- aGroup->SetName("INTERNAL_FACES");
-
- TopTools_IndexedMapOfShape anIndices;
- Handle(TColStd_HSequenceOfInteger) aSeqIDs = new TColStd_HSequenceOfInteger;
-
- TopExp::MapShapes(aShape, anIndices);
-
- TopTools_ListIteratorOfListOfShape anIter(aFaces);
-
- for (; anIter.More(); anIter.Next()) {
- const TopoDS_Shape &aFace = anIter.Value();
- const Standard_Integer anIndex = anIndices.FindIndex(aFace);
-
- if (anIndex > 0) {
- aSeqIDs->Append(anIndex);
- }
- }
-
- myGroupOperations->UnionIDs(aGroup, aSeqIDs);
- aGroup->GetLastFunction()->SetDescription("");
- theSeq->Append(aGroup);
- }
- }
-
- SetErrorCode(OK);
-
- return true;
-}
-
-bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theH, double theW,
- double theRF, bool isNormal)
-{
- SetErrorCode(KO);
-
- // Build tools for partition operation:
- // 1 face and 2 planes
- // Face
- Handle(GEOM_Object) arete_intersect_int, arete_intersect_ext;
- Handle(GEOM_Object) wire_t, wire_t2, face_t, face_t2;
- Handle(GEOM_Object) chan_racc;
- Handle(GEOM_Object) vi1, vi2;
- Handle(GEOM_Object) Te3;
-
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- Handle(GEOM_Object) Vector_Z = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
- Vector_Z->GetLastFunction()->SetDescription("");
-
- // Useful values
- double aSize = 2*(theL1 + theL2);
- double aR1Ext = theR1 + theW1;
- double aR2Ext = theR2 + theW2;
- double theVertCylinderRadius = aR2Ext + theW + theRF;
- double theHoriCylinderRadius = aR1Ext + theH + theRF;
-
- // Common edges on internal cylinder
- Handle(GEOM_Object) box_i = my3DPrimOperations->MakeBoxDXDYDZ(theR2, theR2, theR1);
- box_i->GetLastFunction()->SetDescription("");
- box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0);
- box_i->GetLastFunction()->SetDescription("");
-
- Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
- TCollection_AsciiString theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) edges_i =
- myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (edges_i.IsNull() || edges_i->Length() == 0) {
- SetErrorCode("Internal edges not found");
- return false;
- }
- for (int i=1; i<=edges_i->Length();i++) {
- Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_i->Value(i));
- anObj->GetLastFunction()->SetDescription("");
- }
- arete_intersect_int = Handle(GEOM_Object)::DownCast(edges_i->Value(1));
-
- // search for vertices located on both internal pipes
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) vertices_i =
- myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (vertices_i.IsNull() || vertices_i->Length() == 0) {
- SetErrorCode("Internal vertices not found");
- return false;
- }
-
- double d1min = theR2+theW2, d2min=theR2+theW2;
- for (int i = 1; i <= vertices_i->Length(); i++) {
- Handle(GEOM_Object) v = Handle(GEOM_Object)::DownCast(vertices_i->Value(i));
- v->GetLastFunction()->SetDescription("");
- TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue());
- gp_Pnt aP = BRep_Tool::Pnt(aVertex);
- if (Abs(aP.X()) <= Precision::Confusion()) {
- if (Abs(aP.Y()) < d1min) {
- vi1 = v;
- d1min = Abs(aP.Y());
- }
- } else if (Abs(aP.Y()) <= Precision::Confusion()) {
- if (Abs(aP.X()) < d2min) {
- vi2 = v;
- d2min = Abs(aP.X());
- }
- }
- }
- if (vi1.IsNull() || vi2.IsNull()) {
- SetErrorCode("Cannot find internal intersection vertices");
- return false;
- }
-
- std::list<Handle(GEOM_Object)> theShapes;
-
- if (isNormal) {
- Handle(GEOM_Object) ve1, ve2;
- TopoDS_Vertex vertex1, vertex2;
-
- Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(aR2Ext, aR2Ext, aR1Ext);
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -aR2Ext, -aR2Ext, 0);
- box_e->GetLastFunction()->SetDescription("");
-
- // search for vertices located on both external pipes
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) vertices_e =
- myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (vertices_e.IsNull() || vertices_e->Length() == 0) {
- SetErrorCode("External vertices not found");
- return false;
- }
-
- double d1max = 0, d2max = 0;
- for (int i = 1; i <= vertices_e->Length(); i++) {
- Handle(GEOM_Object) v = Handle(GEOM_Object)::DownCast(vertices_e->Value(i));
- v->GetLastFunction()->SetDescription("");
- TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue());
- gp_Pnt aP = BRep_Tool::Pnt(aVertex);
- if (Abs(aP.X()) <= Precision::Confusion()) {
- if (Abs(aP.Y()) > d1max) {
- ve1 = v;
- vertex1 = aVertex;
- d1max = Abs(aP.Y());
- }
- } else if (Abs(aP.Y()) <= Precision::Confusion()) {
- if (Abs(aP.X()) > d2max) {
- ve2 = v;
- vertex2 = aVertex;
- d2max = Abs(aP.X());
- }
- }
- }
- if (ve1.IsNull() || ve2.IsNull()) {
- SetErrorCode("Cannot find external intersection vertices");
- return false;
- }
- Handle(GEOM_Object) edge_e1, edge_e2;
-
- // Common edges on external cylinder
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) edges_e =
- myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- SetErrorCode("External edges not found");
- return false;
- }
- ShapeAnalysis_Edge sae;
- for (int i=1; i<=edges_e->Length();i++) {
- Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
- anObj->GetLastFunction()->SetDescription("");
- TopoDS_Edge anEdge = TopoDS::Edge(anObj->GetValue());
- if ( !anEdge.IsNull() &&
- (sae.FirstVertex(anEdge).IsSame(vertex1) || sae.LastVertex(anEdge).IsSame(vertex1)) &&
- (sae.FirstVertex(anEdge).IsSame(vertex2) || sae.LastVertex(anEdge).IsSame(vertex2))) {
- arete_intersect_ext = anObj;
- }
- }
-
- edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1);
- if (edge_e1.IsNull()) {
- SetErrorCode("Edge 1 could not be built");
- return false;
- }
-
- edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2);
- if (edge_e2.IsNull()) {
- SetErrorCode("Edge 2 could not be built");
- return false;
- }
-
- edge_e1->GetLastFunction()->SetDescription("");
- edge_e2->GetLastFunction()->SetDescription("");
-
- std::list<Handle(GEOM_Object)> edge_e_elist;
- edge_e_elist.push_back(arete_intersect_int);
- edge_e_elist.push_back(edge_e1);
- edge_e_elist.push_back(arete_intersect_ext);
- edge_e_elist.push_back(edge_e2);
- wire_t = myShapesOperations->MakeWire(edge_e_elist, 1e-7);
- if (wire_t.IsNull()) {
- SetErrorCode("Impossible to build wire");
- return false;
- }
- wire_t->GetLastFunction()->SetDescription("");
- face_t = myShapesOperations->MakeFace(wire_t, false);
- if (face_t.IsNull()) {
- SetErrorCode("Impossible to build face");
- return false;
- }
- face_t->GetLastFunction()->SetDescription("");
-
- theShapes.push_back(theShape);
- theShapes.push_back(vi1);
- theShapes.push_back(vi2);
- theShapes.push_back(ve1);
- theShapes.push_back(ve2);
- theShapes.push_back(edge_e1);
- theShapes.push_back(edge_e2);
- theShapes.push_back(wire_t);
- theShapes.push_back(face_t);
- }
- else {
- Handle(GEOM_Object) P1, P2, P3, P4, P5, P6;
- int idP1, idP2, idP3, idP4;
- int PZX, PZY;
- double ZX=0, ZY=0;
- std::vector<int> LX;
- std::vector<int> LY;
- Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ
- (theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius);
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ
- (box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0);
- box_e->GetLastFunction()->SetDescription("");
-
- aFunction = theShape->GetLastFunction();
- theDesc = aFunction->GetDescription();
- Handle(TColStd_HSequenceOfTransient) extremVertices =
- myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN);
- // Recover previous description to get rid of Propagate dump
- aFunction->SetDescription(theDesc);
-
- if (extremVertices.IsNull() || extremVertices->Length() == 0) {
- if (theRF == 0)
- SetErrorCode("Vertices on chamfer not found");
- else
- SetErrorCode("Vertices on fillet not found");
- return false;
- }
-
- theShapes.push_back(theShape);
- theShapes.push_back(box_e);
- if (extremVertices->Length() != 6) {
- // for (int i=1; i<=extremVertices->Length(); i++){
- // theShapes.push_back(Handle(GEOM_Object)::DownCast(extremVertices->Value(i)));
- // }
- // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
- // TopoDS_Shape aCompoundShape = aCompound->GetValue();
- // theShape->GetLastFunction()->SetValue(aCompoundShape);
- SetErrorCode("Bad number of vertices on chamfer found");
- return false;
- }
-
- for (int i=1; i<=extremVertices->Length(); i++){
- Handle(GEOM_Object) aV = Handle(GEOM_Object)::DownCast(extremVertices->Value(i));
- aV->GetLastFunction()->SetDescription("");
- gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aV->GetValue()));
-
- if (Abs(aP.X()) <= Precision::Confusion()) {
- if (Abs(aP.Y()) - theR2 > Precision::Confusion()) {
- LX.push_back(i);
- if (aP.Z()-ZX > Precision::Confusion()) {
- ZX = aP.Z();
- PZX = i;
- }
- }
- }
- else {
- if (Abs(aP.X()) - theR2 > Precision::Confusion()) {
- LY.push_back(i);
- if (aP.Z() - ZY > Precision::Confusion()) {
- ZY = aP.Z();
- PZY = i;
- }
- }
- }
- }
-
- idP2 = PZX;
- idP4 = PZY;
- idP1 = LX.at(0);
- if (LX.at(0) == PZX)
- idP1 = LX.at(1);
- idP3 = LY.at(0);
- if (LY.at(0) == PZY)
- idP3 = LY.at(1);
-
- P1 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP1));
- P2 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP2));
- P3 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP3));
- P4 = Handle(GEOM_Object)::DownCast(extremVertices->Value(idP4));
-
- Handle(GEOM_Object) Cote_1 = myBasicOperations->MakeLineTwoPnt(P1, vi1);
- if (Cote_1.IsNull()) {
- SetErrorCode("Impossible to build edge in thickness");
- return false;
- }
- Cote_1->GetLastFunction()->SetDescription("");
-
- Handle(GEOM_Object) Cote_2 = myBasicOperations->MakeLineTwoPnt(vi2, P3);
- if (Cote_2.IsNull()) {
- SetErrorCode("Impossible to build edge in thickness");
- return false;
- }
- Cote_2->GetLastFunction()->SetDescription("");
-
- // edge_chan_princ = arete du chanfrein (ou raccord) sur le tuyau principal
- // edge_chan_inc = arete du chanfrein (ou raccord) sur le tuyau incident
- // std::cerr << "Getting chamfer edge on main pipe" << std::endl;
- Handle(GEOM_Object) edge_chan_princ = myBlocksOperations->GetEdge(theShape, P1, P3);
- if (edge_chan_princ.IsNull()) {
- SetErrorCode("Impossible to find edge on main pipe");
- return false;
- }
- edge_chan_princ->GetLastFunction()->SetDescription("");
-
- Handle(GEOM_Object) edge_chan_inc = myBlocksOperations->GetEdge(theShape, P2, P4);
- if (edge_chan_inc.IsNull()) {
- SetErrorCode("Impossible to find edge on incident pipe");
- return false;
- }
- edge_chan_inc->GetLastFunction()->SetDescription("");
-
- std::list<Handle(GEOM_Object)> edgeList1;
- edgeList1.push_back(edge_chan_princ);
- edgeList1.push_back(Cote_1);
- edgeList1.push_back(arete_intersect_int);
- edgeList1.push_back(Cote_2);
-
- // std::cerr << "Creating wire 1" << std::endl;
- wire_t = myShapesOperations->MakeWire(edgeList1, 1e-7);
- if (wire_t.IsNull()) {
- SetErrorCode("Impossible to build wire");
- return false;
- }
- wire_t->GetLastFunction()->SetDescription("");
-
- // std::cerr << "Creating face 1" << std::endl;
- face_t = myShapesOperations->MakeFace(wire_t, false);
- if (face_t.IsNull()) {
- SetErrorCode("Impossible to build face");
- return false;
- }
- face_t->GetLastFunction()->SetDescription("");
- theShapes.push_back(face_t);
-
- gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(P2->GetValue()));
- gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue()));
- double deltaZ = aP2.Z() - aP5.Z();
- // std::cerr << "Creating new point from vi1 with deltaZ = " << deltaZ << std::endl;
- Handle(GEOM_Object) P5bis = myTransformOperations->TranslateDXDYDZCopy(vi1, 0, 0, deltaZ);
- if (P5bis.IsNull()) {
- SetErrorCode("Impossible to translate vertex");
- return false;
- }
- P5bis->GetLastFunction()->SetDescription("");
-
- gp_Pnt aP4 = BRep_Tool::Pnt(TopoDS::Vertex(P4->GetValue()));
- gp_Pnt aP6 = BRep_Tool::Pnt(TopoDS::Vertex(vi2->GetValue()));
- deltaZ = aP4.Z() - aP6.Z();
- // std::cerr << "Creating new point from vi2 with deltaZ = " << deltaZ << std::endl;
- Handle(GEOM_Object) P6bis = myTransformOperations->TranslateDXDYDZCopy(vi2, 0, 0, deltaZ);
- if (P6bis.IsNull()) {
- SetErrorCode("Impossible to translate vertex");
- return false;
- }
- P6bis->GetLastFunction()->SetDescription("");
-
- // std::cerr << "Creating new line 1 from 2 previous points" << std::endl;
- Handle(GEOM_Object) Cote_3 = myBasicOperations->MakeLineTwoPnt(P5bis, P2);
- if (Cote_3.IsNull()) {
- SetErrorCode("Impossible to build edge in thickness");
- return false;
- }
- Cote_3->GetLastFunction()->SetDescription("");
-
- // std::cerr << "Creating new line 2 from 2 previous points" << std::endl;
- Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4);
- if (Cote_4.IsNull()) {
- SetErrorCode("Impossible to build edge in thickness");
- return false;
- }
- Cote_4->GetLastFunction()->SetDescription("");
-
- // std::cerr << "Creating new line 3 from 2 previous points" << std::endl;
- Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis);
- if (Cote_4.IsNull()) {
- SetErrorCode("Impossible to build edge in thickness");
- return false;
- }
- Cote_5->GetLastFunction()->SetDescription("");
-
- //std::list<Handle(GEOM_Object)> edgeList2;
- //edgeList2.push_back(edge_chan_inc);
- //edgeList2.push_back(Cote_3);
- //edgeList2.push_back(Cote_5);
- //edgeList2.push_back(Cote_4);
- // std::cerr << "Creating wire 2" << std::endl;
- //wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7);
- //if (wire_t2.IsNull()) {
- // SetErrorCode("Impossible to build wire");
- // return false;
- //}
- //wire_t2->GetLastFunction()->SetDescription("");
- // std::cerr << "Creating face 2" << std::endl;
- //face_t2 = myShapesOperations->MakeFace(wire_t2, false);
-
- // Mantis issue 0021682
- face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - (theR2 + theW2));
- //face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - 2.0*theR2);
- if (face_t2.IsNull()) {
- SetErrorCode("Impossible to build face");
- return false;
- }
- face_t2->GetLastFunction()->SetDescription("");
- theShapes.push_back(face_t2);
- }
-
- // Planes
- Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
- Handle(GEOM_Object) aVZ = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1);
- Handle(GEOM_Object) aVXZ = myBasicOperations->MakeVectorDXDYDZ(aR1Ext, 0, 0.5*(theL1+theVertCylinderRadius));
- Handle(GEOM_Object) aPlnOZ = myBasicOperations->MakePlanePntVec(aP0, aVZ, aSize);
- Handle(GEOM_Object) aPlnOXZ = myBasicOperations->MakePlanePntVec(aP0, aVXZ, aSize);
- aP0->GetLastFunction()->SetDescription("");
- aVZ->GetLastFunction()->SetDescription("");
- aVXZ->GetLastFunction()->SetDescription("");
- aPlnOZ->GetLastFunction()->SetDescription("");
- aPlnOXZ->GetLastFunction()->SetDescription("");
- theShapes.push_back(aPlnOZ);
- theShapes.push_back(aPlnOXZ);
-
- // Partition
- Handle(TColStd_HSequenceOfTransient) partitionShapes = new TColStd_HSequenceOfTransient;
- Handle(TColStd_HSequenceOfTransient) theTools = new TColStd_HSequenceOfTransient;
- Handle(TColStd_HSequenceOfTransient) theKeepInside = new TColStd_HSequenceOfTransient;
- Handle(TColStd_HSequenceOfTransient) theRemoveInside = new TColStd_HSequenceOfTransient;
- Handle(TColStd_HArray1OfInteger) theMaterials;
-
- partitionShapes->Append(theShape);
- theTools->Append(aPlnOZ);
- if (Abs(aR1Ext - aR2Ext) > Precision::Confusion())
- theTools->Append(aPlnOXZ);
- theTools->Append(face_t);
- if (!isNormal)
- theTools->Append(face_t2);
-
- Te3 = myBooleanOperations->MakePartition
- (partitionShapes, theTools, theKeepInside, theRemoveInside,
- TopAbs_SOLID, false, theMaterials, 0, false, Standard_False);
- if (Te3.IsNull()) {
- SetErrorCode("Impossible to build partition of TShape");
- return false;
- }
- Te3->GetLastFunction()->SetDescription("");
-
- // Last verification: result should be a block
- std::list<GEOMImpl_IBlocksOperations::BCError> errList;
- if (!myBlocksOperations->CheckCompoundOfBlocks(Te3,errList)) {
- SetErrorCode("TShape is not a compound of block");
- return false;
- }
-
-// // BEGIN Compound of created shapes - Only for debug purpose
-// theShapes.clear();
-// theShapes.push_back(theShape);
-// theShapes.push_back(aPlnOZ);
-// if (Abs(aR1Ext - aR2Ext) > Precision::Confusion() )
-// theShapes.push_back(aPlnOXZ);
-// theShapes.push_back(face_t);
-// if (!isNormal)
-// theShapes.push_back(face_t2);
-//
-// Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes);
-// TopoDS_Shape aCompoundShape = aCompound->GetValue();
-// theShape->GetLastFunction()->SetValue(aCompoundShape);
-// // END Compound of created shapes - Only for debug purpose
-
- TopoDS_Shape aShape = Te3->GetValue();
- theShape->GetLastFunction()->SetValue(aShape);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return false;
- }
-
- SetErrorCode(OK);
- return true;
-}
-
-// Mirror and glue faces
-bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2)
-{
- SetErrorCode(KO);
-
- // Useful values
- double aSize = 2*(theL1 + theL2);
- double aR1Ext = theR1 + theW1;
-
- // Planes
- Handle(GEOM_Object) aP0 = myBasicOperations->MakePointXYZ(0, 0, 0);
- aP0->GetLastFunction()->SetDescription("");
- Handle(GEOM_Object) aVX = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0);
- Handle(GEOM_Object) aVY = myBasicOperations->MakeVectorDXDYDZ(0, 1, 0);
- aVX->GetLastFunction()->SetDescription("");
- aVY->GetLastFunction()->SetDescription("");
- Handle(GEOM_Object) aPlane_OX = myBasicOperations->MakePlanePntVec(aP0, aVX, 2*(aR1Ext + theL2));
- Handle(GEOM_Object) aPlane_OY = myBasicOperations->MakePlanePntVec(aP0, aVY, aSize);
- aPlane_OX->GetLastFunction()->SetDescription("");
- aPlane_OY->GetLastFunction()->SetDescription("");
-
- Handle(GEOM_Object) Te4 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OX);
- if (Te4.IsNull()) {
- SetErrorCode("Impossible to build mirror of quarter TShape");
- return false;
- }
-
- Handle(GEOM_Object) Te5 = myTransformOperations->MirrorPlaneCopy(theShape, aPlane_OY);
- if (Te5.IsNull()) {
- SetErrorCode("Impossible to build mirror of half TShape");
- return false;
- }
-
- Handle(GEOM_Object) Te6 = myTransformOperations->MirrorPlaneCopy(Te4, aPlane_OY);
- if (Te6.IsNull()) {
- SetErrorCode("Impossible to build mirror of half TShape");
- return false;
- }
-
- std::list<Handle(GEOM_Object)> aShapesList;
- aShapesList.push_back(theShape);
- aShapesList.push_back(Te4);
- aShapesList.push_back(Te5);
- aShapesList.push_back(Te6);
- Handle(GEOM_Object) Te7 = myShapesOperations->MakeCompound(aShapesList);
- if (Te7.IsNull()) {
- SetErrorCode("Impossible to build compound");
- return false;
- }
-
- // Copy source shape
- TopoDS_Shape aShapeCopy;
- TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
- TNaming_CopyShape::CopyTool(Te7->GetValue(), aMapTShapes, aShapeCopy);
-
- Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
- if (Te8.IsNull()) {
- SetErrorCode("Impossible to glue faces of TShape");
- return false;
- }
-
- TopoDS_Shape aShape = Te8->GetValue();
- BRepCheck_Analyzer anAna (aShape, Standard_True);
-
- if (!anAna.IsValid()) {
- // Try to do gluing with the tolerance equal to maximal
- // tolerance of vertices of the source shape.
- Standard_Real aTolMax = -RealLast();
-
- for (TopExp_Explorer ExV (aShapeCopy, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
- TopoDS_Vertex aVertex = TopoDS::Vertex(ExV.Current());
- Standard_Real aTol = BRep_Tool::Tolerance(aVertex);
-
- if (aTol > aTolMax) {
- aTolMax = aTol;
- }
- }
-
- // Perform gluing
- Te7->GetLastFunction()->SetValue(aShapeCopy);
- Te8 = myShapesOperations->MakeGlueFaces(Te7, aTolMax, true);
-
- if (Te8.IsNull()) {
- SetErrorCode("Impossible to glue faces of TShape");
- return false;
- }
-
- aShape = Te8->GetValue();
- }
-
-
- theShape->GetLastFunction()->SetValue(aShape);
-
- Te4->GetLastFunction()->SetDescription("");
- Te5->GetLastFunction()->SetDescription("");
- Te6->GetLastFunction()->SetDescription("");
- Te7->GetLastFunction()->SetDescription("");
- Te8->GetLastFunction()->SetDescription("");
-
- SetErrorCode(OK);
- return true;
-}
-
-//=======================================================================
-//function : MakePipeTShapeThicknessReduction
-//purpose : Static method. Add thiskness reduction elements at the three
-// open ends of the T-Shape.
-//=======================================================================
-TopoDS_Shape GEOMImpl_IAdvancedOperations::MakePipeTShapeThicknessReduction
- (TopoDS_Shape theShape,
- double r1, double w1, double l1,
- double r2, double w2, double l2,
- double rL, double wL, double ltransL, double lthinL,
- double rR, double wR, double ltransR, double lthinR,
- double rI, double wI, double ltransI, double lthinI,
- bool fuseReductions)
-{
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- //
- // ---------------------.
- // W \
- // ---------------------. \
- // ^ \ '-----------------.
- // |R \ Wthin |
- // | '-----------------'
- // v Rthin
- // --.--.--.--.--.--.--.--.--.--.--.--.--.--.--
- // Ltrans Lthin
-
- TopoDS_Shape aResult = theShape;
- double aTol = Precision::Confusion();
-
- gp_Vec aVX = gp::DX(), aVZ = gp::DZ();
-
- // Left reduction (rL, wL, ltransL, lthinL)
- if (rL > aTol && wL > aTol && ltransL > aTol) {
- gp_Pnt aPLeft (-l1, 0, 0);
- gp_Ax2 anAxesLeft (aPLeft, -aVX, aVZ);
- TopoDS_Shape aReductionLeft = GEOMImpl_IAdvancedOperations::MakeThicknessReduction
- (anAxesLeft, r1, w1, rL, wL, ltransL, lthinL, fuseReductions);
-
- if (fuseReductions) {
- BRepAlgoAPI_Fuse fuseL (aResult, aReductionLeft);
- if (!fuseL.IsDone())
- StdFail_NotDone::Raise("Cannot fuse Te with left reduction");
- aResult = fuseL.Shape();
- }
- else {
- BRep_Builder B;
- TopoDS_Compound C;
- B.MakeCompound(C);
- B.Add(C, aResult);
- B.Add(C, aReductionLeft);
- aResult = C;
- }
- }
-
- // Right reduction
- if (rR > aTol && wR > aTol && ltransR > aTol) {
- gp_Pnt aPRight (l1, 0, 0);
- gp_Ax2 anAxesRight (aPRight, aVX, aVZ);
- TopoDS_Shape aReductionRight = GEOMImpl_IAdvancedOperations::MakeThicknessReduction
- (anAxesRight, r1, w1, rR, wR, ltransR, lthinR, fuseReductions);
-
- if (fuseReductions) {
- BRepAlgoAPI_Fuse fuseR (aResult, aReductionRight);
- if (!fuseR.IsDone())
- StdFail_NotDone::Raise("Cannot fuse Te with right reduction");
- aResult = fuseR.Shape();
- }
- else {
- BRep_Builder B;
- TopoDS_Compound C;
- B.MakeCompound(C);
- B.Add(C, aResult);
- B.Add(C, aReductionRight);
- aResult = C;
- }
- }
-
- // Incident reduction
- if (rI > aTol && wI > aTol && ltransI > aTol) {
- gp_Pnt aPInci (0, 0, l2);
- gp_Ax2 anAxesInci (aPInci, aVZ, aVX);
- TopoDS_Shape aReductionInci = GEOMImpl_IAdvancedOperations::MakeThicknessReduction
- (anAxesInci, r2, w2, rI, wI, ltransI, lthinI, fuseReductions);
-
- if (fuseReductions) {
- BRepAlgoAPI_Fuse fuseInci (aResult, aReductionInci);
- if (!fuseInci.IsDone())
- StdFail_NotDone::Raise("Cannot fuse Te with incident reduction");
- aResult = fuseInci.Shape();
- }
- else {
- BRep_Builder B;
- TopoDS_Compound C;
- B.MakeCompound(C);
- B.Add(C, aResult);
- B.Add(C, aReductionInci);
- aResult = C;
- }
- }
-
- // Get rid of extra compounds
- TopTools_ListOfShape listShapeRes;
- GEOMUtils::AddSimpleShapes(aResult, listShapeRes);
- aResult = listShapeRes.First(); // useful for the case "fuseReductions == true"
-
- if (!fuseReductions && listShapeRes.Extent() > 1) {
- // Simplify T-Shape compound (get rid of sub-compounds) and glue duplicated faces
- BRep_Builder B;
- TopoDS_Compound C;
- B.MakeCompound(C);
-
- TopTools_ListIteratorOfListOfShape itSub (listShapeRes);
- for (; itSub.More(); itSub.Next())
- B.Add(C, itSub.Value());
-
- // GlueFaces
- aResult = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
- }
-
- return aResult;
-}
-
-//=======================================================================
-//function : MakeThicknessReduction
-//purpose : Static method. Create one thickness reduction element.
-//=======================================================================
-TopoDS_Shape GEOMImpl_IAdvancedOperations::MakeThicknessReduction (gp_Ax2 theAxes,
- const double R, const double W,
- const double Rthin, const double Wthin,
- const double Ltrans, const double Lthin,
- bool fuse)
-{
- double aTol = Precision::Confusion();
- if (Rthin < aTol || Wthin < aTol || Ltrans < aTol) {
- StdFail_NotDone::Raise("Cannot build thickness reduction: too small values");
- }
- bool isThinPart = (Lthin > aTol);
-
- // .
- // W |\
- // . \
- // ^ \ '-----------------.
- // |R \| | Wthin
- // | '-----------------'
- // v Rthin
- // --.--.--.--.--.--.--.--.--.--.--.--.--> theAxes.Direction()
- // Ltrans Lthin
-
- double RExt = R + W;
- double RthinExt = Rthin + Wthin;
-
- gp_Dir aNormal = theAxes.Direction();
- gp_Dir anXDir = theAxes.XDirection();
- gp_Pnt aPntCyl (theAxes.Location().XYZ() + aNormal.XYZ()*Ltrans);
- gp_Ax2 anAxesCyl (aPntCyl, aNormal, anXDir);
-
- // Build the transition part
- BRepPrimAPI_MakeCone ConeExt (theAxes, RExt, RthinExt, Ltrans);
- BRepPrimAPI_MakeCone ConeInt (theAxes, R, Rthin, Ltrans);
- ConeExt.Build();
- ConeInt.Build();
- if (!ConeExt.IsDone() || !ConeInt.IsDone())
- StdFail_NotDone::Raise("Cannot build cones of thickness reduction");
- BRepAlgoAPI_Cut cut1 (ConeExt.Shape(), ConeInt.Shape());
- if (!cut1.IsDone())
- StdFail_NotDone::Raise("Coudn't build transition part of thickness reduction");
- TopoDS_Shape aReduction = cut1.Shape();
-
- // Build the thin part, if required
- TopoDS_Shape aThinPart;
- if (isThinPart) {
- BRepPrimAPI_MakeCylinder CExt (anAxesCyl, RthinExt, Lthin);
- BRepPrimAPI_MakeCylinder CInt (anAxesCyl, Rthin, Lthin);
- CExt.Build();
- CInt.Build();
- if (!CExt.IsDone() || !CInt.IsDone())
- StdFail_NotDone::Raise("Cannot build cylinders of thickness reduction");
- BRepAlgoAPI_Cut cut2 (CExt.Shape(), CInt.Shape());
- if (!cut2.IsDone())
- StdFail_NotDone::Raise("Coudn't build thin part of thickness reduction");
- aThinPart = cut2.Shape();
- }
-
- // Join parts
- if (fuse) {
- if (isThinPart) {
- BRepAlgoAPI_Fuse fuse1 (aReduction, aThinPart);
- if (!fuse1.IsDone())
- StdFail_NotDone::Raise("Cannot fuse parts of thickness reduction");
- aReduction = fuse1.Shape();
- }
- }
- else {
- // Partition the reduction on blocks
- gp_Ax3 anAxesPln1 (aPntCyl, theAxes.XDirection(), aNormal);
- gp_Ax3 anAxesPln2 (aPntCyl, theAxes.YDirection(), aNormal);
- gp_Pln aPln1 (anAxesPln1);
- gp_Pln aPln2 (anAxesPln2);
- double aSize = Ltrans + Lthin + R + Rthin + Wthin; // to guarantee enough size in all directions
- TopoDS_Shape aTool1 = BRepBuilderAPI_MakeFace(aPln1, -aSize, +aSize, -aSize, +aSize).Shape();
- TopoDS_Shape aTool2 = BRepBuilderAPI_MakeFace(aPln2, -aSize, +aSize, -aSize, +aSize).Shape();
-
- GEOMAlgo_Splitter PS;
- PS.AddArgument(aReduction);
- if (isThinPart)
- PS.AddArgument(aThinPart);
- PS.AddTool(aTool1);
- PS.AddTool(aTool2);
- PS.SetLimit(TopAbs_SOLID);
- PS.Perform();
-
- aReduction = PS.Shape();
- }
-
- return aReduction;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShape
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
- GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- bool theHexMesh)
-{
- MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape");
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
-
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- GEOMImpl_IPipeTShape aData (aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- if (isTRL || isTRR || isTRI) {
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape, TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., aSeq, gp_Trsf()))
- return NULL;
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, gp_Trsf())) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShape("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theHexMesh;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups..
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition
- (double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- bool theHexMesh,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3)
-{
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- /////////////////
- // TSHAPE CODE
- /////////////////
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- // Check new position
- if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
- return NULL;
- }
-
- GEOMImpl_IPipeTShape aData(aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- if (isTRL || isTRR || isTRI) {
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- TopoDS_Shape Te = aShape->GetValue();
-
- // Set Position
- gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
- BRepBuilderAPI_Transform aTransformation(Te, aTrsf, Standard_False);
- TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
- aFunction->SetValue(aTrsf_Shape);
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape,TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., aSeq, aTrsf)) {
- return NULL;
- }
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, aTrsf)) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShape("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeChamfer
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of chamfer.
- * \param theW Width of chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer
- (double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theH, double theW,
- bool theHexMesh)
-{
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- GEOMImpl_IPipeTShape aData(aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetH(theH);
- aData.SetW(theW);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // BEGIN of chamfer
- TopoDS_Shape aShapeShape = aShape->GetValue();
- TopTools_IndexedMapOfShape anEdgesIndices;
- TopExp::MapShapes(aShapeShape, anEdgesIndices);
- // Common edges on external cylinders
- Handle(GEOM_Object) box_e;
- if (theHexMesh) {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
- }
- else {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
- }
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
- box_e->GetLastFunction()->SetDescription("");
-
- Handle(TColStd_HSequenceOfInteger) edges_e =
- myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- box_e->GetLastFunction()->SetDescription("");
-
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- SetErrorCode("External edges not found");
- return NULL;
- }
- int nbEdgesInChamfer = 0;
- std::list<int> theEdges;
- for (int i=1; i<=edges_e->Length();i++) {
- int edgeID = edges_e->Value(i);
- TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
- TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
- int iv=0;
- while (Ex.More()) {
- iv ++;
- gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
- nbEdgesInChamfer ++;
- theEdges.push_back(edgeID);
- }
- Ex.Next();
- }
- if (theHexMesh && nbEdgesInChamfer == 1)
- break;
- }
- Handle(GEOM_Object) aChamfer;
- try {
- aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
- if (aChamfer.IsNull()) {
- SetErrorCode("Chamfer can not be computed on the given shape with the given parameters");
- return NULL;
- }
- aChamfer->GetLastFunction()->SetDescription("");
-
- TopoDS_Shape aChamferShape = aChamfer->GetValue();
- aFunction->SetValue(aChamferShape);
- // END of chamfer
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (isTRL || isTRR || isTRI) {
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2,
- theH, theW, 0., aSeq, gp_Trsf()))
- return NULL;
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, gp_Trsf())) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeChamfer("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theH << ", " << theW << ", " << theHexMesh;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeChamferWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of chamfer.
- * \param theW Width of chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition
- (double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theH, double theW,
- bool theHexMesh,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3)
-{
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- // Check new position
- if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
- return NULL;
- }
-
- GEOMImpl_IPipeTShape aData(aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetH(theH);
- aData.SetW(theW);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // BEGIN of chamfer
- TopoDS_Shape aShapeShape = aShape->GetValue();
- TopTools_IndexedMapOfShape anEdgesIndices;
- TopExp::MapShapes(aShapeShape, anEdgesIndices);
- // Common edges on external cylinders
- Handle(GEOM_Object) box_e;
- if (theHexMesh) {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
- }
- else {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
- }
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
- box_e->GetLastFunction()->SetDescription("");
-
- Handle(TColStd_HSequenceOfInteger) edges_e =
- myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- box_e->GetLastFunction()->SetDescription("");
-
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- SetErrorCode("External edges not found");
- return NULL;
- }
- int nbEdgesInChamfer = 0;
- std::list<int> theEdges;
- for (int i=1; i<=edges_e->Length();i++) {
- int edgeID = edges_e->Value(i);
- TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
- TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
- while (Ex.More()) {
- gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
- nbEdgesInChamfer ++;
- theEdges.push_back(edgeID);
- }
- Ex.Next();
- }
- if (theHexMesh && nbEdgesInChamfer == 1)
- break;
- }
- Handle(GEOM_Object) aChamfer;
- try {
- aChamfer = myLocalOperations->MakeChamferEdges(aShape, theW, theH, theEdges);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
- if (aChamfer.IsNull()) {
- SetErrorCode("Chamfer can not be computed on the given shape with the given parameters");
- return NULL;
- }
- aChamfer->GetLastFunction()->SetDescription("");
-
- TopoDS_Shape aChamferShape = aChamfer->GetValue();
- aFunction->SetValue(aChamferShape);
- // END of chamfer
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (isTRL || isTRR || isTRI) {
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // Set Position
- gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
- BRepBuilderAPI_Transform aTransformation (aShape->GetValue(), aTrsf, Standard_False);
- TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
- aFunction->SetValue(aTrsf_Shape);
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2,
- theH, theW, 0., aSeq, aTrsf))
- return NULL;
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, aTrsf)) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeChamfer("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theH << ", " << theW << ", " << theHexMesh << ", "
- << theP1 << ", " << theP2 << ", " << theP3;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeFillet
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet
- (double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theRF, bool theHexMesh)
-{
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- GEOMImpl_IPipeTShape aData(aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetRF(theRF);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // BEGIN of fillet
- TopoDS_Shape aShapeShape = aShape->GetValue();
- TopTools_IndexedMapOfShape anEdgesIndices;
- TopExp::MapShapes(aShapeShape, anEdgesIndices);
- // Common edges on external cylinders
- Handle(GEOM_Object) box_e;
- if (theHexMesh) {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
- }
- else {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
- }
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
- box_e->GetLastFunction()->SetDescription("");
-
- Handle(TColStd_HSequenceOfInteger) edges_e =
- myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- box_e->GetLastFunction()->SetDescription("");
-
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- SetErrorCode("External edges not found");
- return NULL;
- }
- int nbEdgesInFillet = 0;
- std::list<int> theEdges;
- for (int i=1; i<=edges_e->Length();i++) {
- int edgeID = edges_e->Value(i);
- TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
- TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
- while (Ex.More()) {
- gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
- nbEdgesInFillet ++;
- theEdges.push_back(edgeID);
- }
- Ex.Next();
- }
- if (theHexMesh && nbEdgesInFillet == 1)
- break;
- }
-
- Handle(GEOM_Object) aFillet;
- try {
- aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
- if (aFillet.IsNull()) {
- //SetErrorCode("Fillet can not be computed on the given shape with the given parameters");
- SetErrorCode(myLocalOperations->GetErrorCode());
- return NULL;
- }
- aFillet->GetLastFunction()->SetDescription("");
-
- TopoDS_Shape aFilletShape = aFillet->GetValue();
- aFunction->SetValue(aFilletShape);
- // END of fillet
-
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (1)
-// the following block, when enabled, leads to partitioning problems
-#if 0
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (1)
- // BEGIN: Limit tolerances (debug)
- Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07);
- TopoDS_Shape aCorr1Shape = aCorr1->GetValue();
- aShape->GetLastFunction()->SetValue(aCorr1Shape);
- aCorr1->GetLastFunction()->SetDescription("");
- // END: Limit tolerances (debug)
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (2)
-#endif
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (2)
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (isTRL || isTRR || isTRI) {
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., theRF, aSeq, gp_Trsf()))
- return NULL;
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, gp_Trsf())) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeFillet("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theRF << ", " << theHexMesh;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeFilletWithPosition
- * \brief Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition
- (double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theRF, bool theHexMesh,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3)
-{
- SetErrorCode(KO);
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_PipeTShapeDriver::GetID()) return NULL;
-
- // Check new position
- if (!CheckCompatiblePosition(theL1, theL2, theP1, theP2, theP3, 0.01)) {
- return NULL;
- }
-
- GEOMImpl_IPipeTShape aData(aFunction);
-
- aData.SetR1(theR1);
- aData.SetW1(theW1);
- aData.SetL1(theL1);
- aData.SetR2(theR2);
- aData.SetW2(theW2);
- aData.SetL2(theL2);
- aData.SetRF(theRF);
- aData.SetHexMesh(theHexMesh);
-
- bool isTRL = (theRL + theWL + theLtransL + theLthinL) > Precision::Confusion();
- bool isTRR = (theRR + theWR + theLtransR + theLthinR) > Precision::Confusion();
- bool isTRI = (theRI + theWI + theLtransI + theLthinI) > Precision::Confusion();
-
- //Compute the resulting value
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("TShape driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // BEGIN of fillet
- TopoDS_Shape aShapeShape = aShape->GetValue();
- TopTools_IndexedMapOfShape anEdgesIndices;
- TopExp::MapShapes(aShapeShape, anEdgesIndices);
- // Common edges on external cylinders
- Handle(GEOM_Object) box_e;
- if (theHexMesh) {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(theR2+theW2, theR2+theW2, theR1+theW1);
- }
- else {
- box_e = my3DPrimOperations->MakeBoxDXDYDZ(2*(theR2+theW2), 2*(theR2+theW2), theR1+theW1);
- }
- box_e->GetLastFunction()->SetDescription("");
- box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0);
- box_e->GetLastFunction()->SetDescription("");
-
- Handle(TColStd_HSequenceOfInteger) edges_e =
- myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN);
- box_e->GetLastFunction()->SetDescription("");
-
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- SetErrorCode("External edges not found");
- return NULL;
- }
- int nbEdgesInFillet = 0;
- std::list<int> theEdges;
- for (int i=1; i<=edges_e->Length();i++) {
- int edgeID = edges_e->Value(i);
- TopoDS_Shape theEdge = anEdgesIndices.FindKey(edgeID);
- TopExp_Explorer Ex(theEdge,TopAbs_VERTEX);
- while (Ex.More()) {
- gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current()));
- if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) {
- nbEdgesInFillet ++;
- theEdges.push_back(edgeID);
- }
- Ex.Next();
- }
- if (theHexMesh && nbEdgesInFillet == 1)
- break;
- }
-
- Handle(GEOM_Object) aFillet;
- try {
- aFillet = myLocalOperations->MakeFilletEdges(aShape, theRF, theEdges);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
- if (aFillet.IsNull()) {
- SetErrorCode("Fillet can not be computed on the given shape with the given parameters");
- return NULL;
- }
- aFillet->GetLastFunction()->SetDescription("");
-
- TopoDS_Shape aFilletShape = aFillet->GetValue();
- aFunction->SetValue(aFilletShape);
- // END of fillet
-
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (3)
-// the following block, when enabled, leads to partitioning problems
-#if 0
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (3)
- // BEGIN: Limit tolerances (debug)
- Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07);
- TopoDS_Shape aCorr1Shape = aCorr1->GetValue();
- aShape->GetLastFunction()->SetValue(aCorr1Shape);
- aCorr1->GetLastFunction()->SetDescription("");
- // END: Limit tolerances (debug)
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN (4)
-#endif
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END (4)
-
- if (theHexMesh) {
- if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false))
- return NULL;
- if (!MakePipeTShapeMirrorAndGlue(aShape, theR1, theW1, theL1, theR2, theW2, theL2))
- return NULL;
- }
-
- // Add thickness reduction elements
- // at the three extremities: Left, Right and Incident
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (isTRL || isTRR || isTRI) {
- TopoDS_Shape aResShape =
- MakePipeTShapeThicknessReduction(aShape->GetValue(), theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- !theHexMesh);
- aFunction->SetValue(aResShape);
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- // Set Position
- gp_Trsf aTrsf = GetPositionTrsf(theL1, theL2, theP1, theP2, theP3);
- BRepBuilderAPI_Transform aTransformation (aShape->GetValue(), aTrsf, Standard_False);
- TopoDS_Shape aTrsf_Shape = aTransformation.Shape();
- aFunction->SetValue(aTrsf_Shape);
-
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
- aSeq->Append(aShape);
-
- try {
- if (theHexMesh) {
- // Get the groups
- if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., theRF, aSeq, aTrsf))
- return NULL;
- }
-
- // Get internal group.
- if (!MakeInternalGroup(aShape, theR1, theL1, theR2, theL2, theRL, theLtransL,
- theRR, theLtransR, theRI, theLtransI,
- aSeq, aTrsf)) {
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- TCollection_AsciiString anEntry, aListRes("[");
- // Iterate over the sequence aSeq
- Standard_Integer aNbGroups = aSeq->Length();
- Standard_Integer i = 1;
- for (; i <= aNbGroups; i++) {
- Handle(Standard_Transient) anItem = aSeq->Value(i);
- if (anItem.IsNull()) continue;
- Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(anItem);
- if (aGroup.IsNull()) continue;
- //Make a Python command
- TDF_Tool::Entry(aGroup->GetEntry(), anEntry);
- aListRes += anEntry + ", ";
- }
- aListRes.Trunc(aListRes.Length() - 2);
-
- GEOM::TPythonDump pd (aFunction);
-
- pd << aListRes.ToCString() << "] = geompy.MakePipeTShapeFillet("
- << theR1 << ", " << theW1 << ", " << theL1 << ", "
- << theR2 << ", " << theW2 << ", " << theL2 << ", "
- << theRF << ", " << theHexMesh << ", "
- << theP1 << ", " << theP2 << ", " << theP3;
-
- // thickness reduction
- if (isTRL)
- pd << ", theRL=" << theRL << ", theWL=" << theWL
- << ", theLtransL=" << theLtransL << ", theLthinL=" << theLthinL;
- if (isTRR)
- pd << ", theRR=" << theRR << ", theWR=" << theWR
- << ", theLtransR=" << theLtransR << ", theLthinR=" << theLthinR;
- if (isTRI)
- pd << ", theRI=" << theRI << ", theWI=" << theWI
- << ", theLtransI=" << theLtransI << ", theLthinI=" << theLthinI;
-
- pd << ")";
-
- SetErrorCode(OK);
-
- return aSeq;
-}
-
-//=============================================================================
-/*!
- * This function allows to create a disk already divided into blocks. It can be
- * used to create divided pipes for later meshing in hexaedra.
- * \param theR Radius of the disk
- * \param theRatio Relative size of the central square diagonal against the disk diameter
- * \param theOrientation Plane on which the disk will be built
- * \param thePattern The division pattern of the disk (hexagon or square in the center)
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDisk (double theR, double theRatio,
- int theOrientation, int thePattern)
-{
- SetErrorCode(KO);
-
- if (theOrientation != 1 &&
- theOrientation != 2 &&
- theOrientation != 3)
- {
- SetErrorCode("theOrientation must be 1(=OXY), 2(=OYZ) or 3(=OZX)");
- return NULL;
- }
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
-
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_DividedDiskDriver::GetID()) return NULL;
-
- GEOMImpl_IDividedDisk aData (aFunction);
-
- aData.SetR(theR);
- aData.SetRatio(theRatio);
- aData.SetOrientation(theOrientation);
- aData.SetType(thePattern);
-
- //Compute the resulting value
- try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("DividedDisk driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- std::string aPatternStr;
-
- switch(thePattern)
- {
- case 0:
- aPatternStr = "GEOM.SQUARE";
- break;
- case 1:
- aPatternStr = "GEOM.HEXAGON";
- break;
- }
-
- //Make a Python command
- GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDisk(" << theR << ", " << theOrientation << ", " << aPatternStr.c_str() << ")";
-
- SetErrorCode(OK);
-
- return aShape;
-}
-
-//=============================================================================
-/*!
- * This function allows to create a disk already divided into blocks. It can be
- * used to create divided pipes for later meshing in hexaedra.
- * \param theR Radius of the disk
- * \param theRatio Relative size of the central square diagonal against the disk diameter
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt,
- Handle(GEOM_Object) theVec,
- double theR,
- double theRatio,
- int thePattern)
-{
- SetErrorCode(KO);
-
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
-
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_DividedDiskDriver::GetID()) return NULL;
-
- GEOMImpl_IDividedDisk aData (aFunction);
-
- Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
- Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
-
- if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
-
- aData.SetCenter(aRefPnt);
- aData.SetVector(aRefVec);
-
- aData.SetR(theR);
- aData.SetRatio(theRatio);
- aData.SetType(thePattern);
-
- //Compute the resulting value
- try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("DividedDisk driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- std::string aPatternStr;
-
- switch(thePattern)
- {
- case 0:
- aPatternStr = "GEOM.SQUARE";
- break;
- case 1:
- aPatternStr = "GEOM.HEXAGON";
- break;
- }
-
-
- //Make a Python command
- GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedDiskPntVecR(" << thePnt << ", " << theVec << ", " << theR << ", " << aPatternStr.c_str() << ")";
-
- SetErrorCode(OK);
-
- return aShape;
-}
-
-//=============================================================================
-/*!
- * Builds a cylinder prepared for hexa meshes
- * \param theR Radius of the cylinder
- * \param theH Height of the cylinder
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR,
- double theH,
- int thePattern)
-{
- SetErrorCode(KO);
-
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
-
- Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
- aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk
-
- aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0);
-
- Handle(GEOM_Function) aFunction = aShape->GetLastFunction();
- aFunction->SetDescription(""); // Erase dump of MakePrismDXDYDZ
- aShape->SetType(GEOM_DIVIDEDCYLINDER);
-
- std::string aPatternStr;
-
- switch(thePattern)
- {
- case 0:
- aPatternStr = "GEOM.SQUARE";
- break;
- case 1:
- aPatternStr = "GEOM.HEXAGON";
- break;
- }
-
- //Make a Python command
- GEOM::TPythonDump(aFunction) << aShape << " = geompy.MakeDividedCylinder(" << theR << ", " << theH << ", " << aPatternStr.c_str() << ")";
-
- SetErrorCode(OK);
-
- return aShape;
-}
-//=============================================================================
-/*!
- * Create a smoothing surface from a set of points
- * \param thelPoints list of points or compounds of points
- * \param theNbMax maximum number of Bezier pieces in the resulting surface.
- * \param theDegMax maximum degree of the resulting BSpline surface
- * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints,
- int theNbMax,
- int theDegMax,
- double theDMax)
-{
- SetErrorCode(KO);
-
- //Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE);
-
- //Add a new shape function with parameters
- Handle(GEOM_Function) aFunction = aShape->AddFunction(GEOMImpl_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS);
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_SmoothingSurfaceDriver::GetID()) return NULL;
-
- GEOMImpl_ISmoothingSurface aData (aFunction);
-
- int aLen = thelPoints.size();
- aData.SetLength(aLen);
- int ind = 1;
- std::list<Handle(GEOM_Object)>::iterator it = thelPoints.begin();
- for (; it != thelPoints.end(); it++, ind++) {
- Handle(GEOM_Function) aRefObj = (*it)->GetLastFunction();
- if (aRefObj.IsNull()) {
- SetErrorCode("NULL point or compound for bSplineFaceShape");
- return NULL;
- }
- aData.SetPntOrComp(ind, aRefObj);
- }
-
- aData.SetNbMax(theNbMax);
- aData.SetDegMax(theDegMax);
- aData.SetDMax(theDMax);
-
- //Compute the resulting value
- try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("SmoothingSurface driver failed");
- return NULL;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- GEOM::TPythonDump pd (aFunction);
- pd << aShape << " = geompy.MakeSmoothingSurface([";
- it = thelPoints.begin();
- pd << (*it++);
- while (it != thelPoints.end()) {
- pd << ", " << (*it++);
- }
- pd << "], "
- << theNbMax << ", "
- << theDegMax << ", "
- << theDMax <<")";
-
- SetErrorCode(OK);
-
- return aShape;
-}
-/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : GEOMImpl_IAdvancedOperations.hxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-
-#ifndef _GEOMImpl_IAdvancedOperations_HXX_
-#define _GEOMImpl_IAdvancedOperations_HXX_
-
-#include <Utils_SALOME_Exception.hxx>
-#include "GEOM_IOperations.hxx"
-#include "GEOM_Engine.hxx"
-#include "GEOM_Object.hxx"
-
-#include <list>
-#include <gp_Ax2.hxx>
-
-class GEOMImpl_IBasicOperations;
-class GEOMImpl_IBooleanOperations;
-class GEOMImpl_IShapesOperations;
-class GEOMImpl_ITransformOperations;
-class GEOMImpl_IBlocksOperations;
-class GEOMImpl_I3DPrimOperations;
-class GEOMImpl_ILocalOperations;
-class GEOMImpl_IHealingOperations;
-class GEOMImpl_IGroupOperations;
-class Handle_Geom_Surface;
-class TopTools_ListOfShape;
-
-class GEOMImpl_IAdvancedOperations: public GEOM_IOperations {
-private:
- bool MakePipeTShapePartition(Handle(GEOM_Object) theShape,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theH = 0, double theW = 0,
- double theRF = 0, bool isNormal = true);
-
- bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2);
-
- bool MakePipeTShapeThicknessReduction (Handle(GEOM_Object) theShape,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI);
-
- bool MakeGroups(Handle(GEOM_Object) theShape, int shapType,
- double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theH, double theW, double theRF,
- Handle(TColStd_HSequenceOfTransient) theSeq,
- gp_Trsf aTrsf);
-
- bool GetFacesOnSurf(const TopoDS_Shape &theShape,
- const Handle_Geom_Surface& theSurface,
- const Standard_Real theTolerance,
- TopTools_ListOfShape &theFaces);
-
- TopoDS_Shape MakeConicalFace(const gp_Ax2 &theAxis,
- const double theRadius,
- const double theRadiusThin,
- const double theHeight,
- const gp_Trsf &theTrsf);
-
- bool MakeInternalGroup(const Handle(GEOM_Object) &theShape,
- const double theR1, const double theLen1,
- const double theR2, const double theLen2,
- const double theRL, const double theTransLenL,
- const double theRR, const double theTransLenR,
- const double theRI, const double theTransLenI,
- const Handle(TColStd_HSequenceOfTransient) &theSeq,
- const gp_Trsf &theTrsf);
-
- gp_Trsf GetPositionTrsf(double theL1, double theL2,
- Handle(GEOM_Object) P1 = 0,
- Handle(GEOM_Object) P2 = 0,
- Handle(GEOM_Object) P3 = 0);
-
- bool CheckCompatiblePosition(double& theL1, double& theL2,
- Handle(GEOM_Object) theP1,
- Handle(GEOM_Object) theP2,
- Handle(GEOM_Object) theP3,
- double theTolerance);
-
-private:
- GEOMImpl_IBasicOperations* myBasicOperations;
- GEOMImpl_IBooleanOperations* myBooleanOperations;
- GEOMImpl_IShapesOperations* myShapesOperations;
- GEOMImpl_ITransformOperations* myTransformOperations;
- GEOMImpl_IBlocksOperations* myBlocksOperations;
- GEOMImpl_I3DPrimOperations* my3DPrimOperations;
- GEOMImpl_ILocalOperations* myLocalOperations;
- GEOMImpl_IHealingOperations* myHealingOperations;
- GEOMImpl_IGroupOperations* myGroupOperations;
-
-public:
-
- /*!
- * \brief Add three thickness reductions at the open ends of the pipe T-Shape
- *
- * \param theShape - the pipe T-Shape
- * \param r1 - the internal radius of main pipe
- * \param w1 - the thickness of main pipe
- * \param l1 - the half-length of main pipe
- * \param r2 - the internal radius of incident pipe
- * \param w2 - the thickness of incident pipe
- * \param l2 - the half-length of main pipe
- * \param r*, w*, ltrans* and lthin* - internal radius, thickness, length of transition part
- * and length of thin part of left(L), right(R) and
- * incident(I) thickness reduction correspondingly
- * \param fuseReductions - boolean flag (use true to generate single solid,
- * false to obtain parts, useful for hexameshing)
- * \retval TopoDS_Shape - Resulting shape
- */
- Standard_EXPORT static TopoDS_Shape MakePipeTShapeThicknessReduction
- (TopoDS_Shape theShape,
- double r1, double w1, double l1,
- double r2, double w2, double l2,
- double rL, double wL, double ltransL, double lthinL,
- double rR, double wR, double ltransR, double lthinR,
- double rI, double wI, double ltransI, double lthinI,
- bool fuseReductions);
-
- /*!
- * \brief Create one thickness reduction element
- *
- * This method is called three times from MakePipeTShapeThicknessReduction
- * to create three thickness reductions (one per each open end of a pipe T-Shape)
- *
- * \param theAxes - the position
- * \param R - the internal radius of main pipe
- * \param W - the thickness of main pipe
- * \param Rthin - the internal radius of thin part
- * \param Wthin - the thickness of thin part
- * \param Ltrans - the length of transition part
- * \param Lthin - the length of thin part
- * \param fuse - boolean flag (use true to generate single solid,
- * false to obtain parts, useful for hexameshing)
- * \retval TopoDS_Shape - Resulting shape
- */
- Standard_EXPORT static TopoDS_Shape MakeThicknessReduction (gp_Ax2 theAxes,
- const double R, const double W,
- const double Rthin, const double Wthin,
- const double Ltrans, const double Lthin,
- bool fuse);
-
-public:
- Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID);
- Standard_EXPORT ~GEOMImpl_IAdvancedOperations();
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShape(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- bool theHexMesh = true);
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShapeWithPosition(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- bool theHexMesh = true,
- Handle(GEOM_Object) P1 = 0,
- Handle(GEOM_Object) P2 = 0,
- Handle(GEOM_Object) P3 = 0);
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShapeChamfer(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theH, double theW,
- bool theHexMesh = true);
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theH, double theW,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- bool theHexMesh = true,
- Handle(GEOM_Object) P1 = 0,
- Handle(GEOM_Object) P2 = 0,
- Handle(GEOM_Object) P3 = 0);
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShapeFillet(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theRF, bool theHexMesh = true);
-
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
- MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1,
- double theR2, double theW2, double theL2,
- double theRL, double theWL, double theLtransL, double theLthinL,
- double theRR, double theWR, double theLtransR, double theLthinR,
- double theRI, double theWI, double theLtransI, double theLthinI,
- double theRF, bool theHexMesh = true,
- Handle(GEOM_Object) P1 = 0,
- Handle(GEOM_Object) P2 = 0,
- Handle(GEOM_Object) P3 = 0);
-
- Standard_EXPORT Handle(GEOM_Object) MakeDividedDisk (double theR, double theRatio,
- int theOrientation, int thePattern);
- Standard_EXPORT Handle(GEOM_Object) MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt,
- Handle(GEOM_Object) theVec,
- double theR,
- double theRatio,
- int thePattern);
-
- Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR,
- double theH,
- int thePattern);
-
- Standard_EXPORT Handle(GEOM_Object) MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints,
- int theNbMax,
- int theDegMax,
- double theDMax);
- /*@@ insert new functions before this line @@ do not remove this line @@*/
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_IDividedDisk_HXX_
-#define _GEOMImpl_IDividedDisk_HXX_
-
-#include "GEOM_Function.hxx"
-
-#define DIVIDEDDISK_ARG_R 1
-#define DIVIDEDDISK_ARG_RATIO 2
-#define DIVIDEDDISK_ARG_ORIENT 3
-
-#define DIVIDEDDISK_ARG_CENTER 4
-#define DIVIDEDDISK_ARG_VECTOR 5
-
-#define DIVIDEDDISK_ARG_TYPE 6
-
-class GEOMImpl_IDividedDisk
-{
-public:
- GEOMImpl_IDividedDisk(Handle(GEOM_Function) theFunction): _func(theFunction) {}
-
- void SetR(double theR) { _func->SetReal(DIVIDEDDISK_ARG_R, theR); }
- double GetR() { return _func->GetReal(DIVIDEDDISK_ARG_R); }
-
- void SetRatio(double theRatio) { _func->SetReal(DIVIDEDDISK_ARG_RATIO, theRatio); }
- double GetRatio() { return _func->GetReal(DIVIDEDDISK_ARG_RATIO); }
-
- void SetOrientation(int theOrientation) { _func->SetInteger(DIVIDEDDISK_ARG_ORIENT, theOrientation); }
- int GetOrientation() { return _func->GetInteger(DIVIDEDDISK_ARG_ORIENT); }
-
- void SetType(int theType) { _func->SetInteger(DIVIDEDDISK_ARG_TYPE, theType); }
- int GetType() { return _func->GetInteger(DIVIDEDDISK_ARG_TYPE); }
-
- void SetCenter(Handle(GEOM_Function) theP) { _func->SetReference(DIVIDEDDISK_ARG_CENTER, theP); }
- void SetVector(Handle(GEOM_Function) theV) { _func->SetReference(DIVIDEDDISK_ARG_VECTOR, theV); }
-
- Handle(GEOM_Function) GetCenter() { return _func->GetReference(DIVIDEDDISK_ARG_CENTER); }
- Handle(GEOM_Function) GetVector() { return _func->GetReference(DIVIDEDDISK_ARG_VECTOR); }
-
-private:
- Handle(GEOM_Function) _func;
-};
-
-#endif // _GEOMImpl_IDividedDisk_HXX_
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_IPipeTShape_HXX_
-#define _GEOMImpl_IPipeTShape_HXX_
-
-#include "GEOM_Function.hxx"
-
-#include <TColStd_HArray1OfReal.hxx>
-
-class GEOMImpl_IPipeTShape
-{
-public:
- GEOMImpl_IPipeTShape(Handle(GEOM_Function) theFunction): _func(theFunction) {}
-
- void SetR1(double theR1) { _func->SetReal(TSHAPE_ARG_R1, theR1); }
- double GetR1() { return _func->GetReal(TSHAPE_ARG_R1); }
-
- void SetW1(double theW1) { _func->SetReal(TSHAPE_ARG_W1, theW1); }
- double GetW1() { return _func->GetReal(TSHAPE_ARG_W1); }
-
- void SetL1(double theL1) { _func->SetReal(TSHAPE_ARG_L1, theL1); }
- double GetL1() { return _func->GetReal(TSHAPE_ARG_L1); }
-
- void SetR2(double theR2) { _func->SetReal(TSHAPE_ARG_R2, theR2); }
- double GetR2() { return _func->GetReal(TSHAPE_ARG_R2); }
-
- void SetW2(double theW2) { _func->SetReal(TSHAPE_ARG_W2, theW2); }
- double GetW2() { return _func->GetReal(TSHAPE_ARG_W2); }
-
- void SetL2(double theL2) { _func->SetReal(TSHAPE_ARG_L2, theL2); }
- double GetL2() { return _func->GetReal(TSHAPE_ARG_L2); }
-
- void SetH(double theH) { _func->SetReal(TSHAPE_ARG_H, theH); }
- double GetH() { return _func->GetReal(TSHAPE_ARG_H); }
-
- void SetW(double theW) { _func->SetReal(TSHAPE_ARG_W, theW); }
- double GetW() { return _func->GetReal(TSHAPE_ARG_W); }
-
- void SetRF(double theRF) { _func->SetReal(TSHAPE_ARG_RF, theRF); }
- double GetRF() { return _func->GetReal(TSHAPE_ARG_RF); }
-
- void SetHexMesh(int theHexMesh) { _func->SetInteger(TSHAPE_ARG_HEXMESH, theHexMesh); }
- int GetHexMesh() { return _func->GetInteger(TSHAPE_ARG_HEXMESH); }
-
- void SetP1(const Handle(GEOM_Function)& theP1){_func->SetReference(TSHAPE_ARG_P1, theP1); }
- Handle(GEOM_Function) GetP1() { return _func->GetReference(TSHAPE_ARG_P1); }
-
- void SetP2(const Handle(GEOM_Function)& theP2){_func->SetReference(TSHAPE_ARG_P2, theP2); }
- Handle(GEOM_Function) GetP2() { return _func->GetReference(TSHAPE_ARG_P2); }
-
- void SetP3(const Handle(GEOM_Function)& theP3){_func->SetReference(TSHAPE_ARG_P3, theP3); }
- Handle(GEOM_Function) GetP3() { return _func->GetReference(TSHAPE_ARG_P3); }
-
-private:
- enum {
- // main pipe
- TSHAPE_ARG_R1 = 1,
- TSHAPE_ARG_W1 = 2,
- TSHAPE_ARG_L1 = 3,
-
- // incident pipe
- TSHAPE_ARG_R2 = 4,
- TSHAPE_ARG_W2 = 5,
- TSHAPE_ARG_L2 = 6,
-
- // chamfer
- TSHAPE_ARG_H = 7,
- TSHAPE_ARG_W = 8,
-
- // fillet
- TSHAPE_ARG_RF = 9,
-
- // partition
- TSHAPE_ARG_HEXMESH = 10,
-
- // junction points
- TSHAPE_ARG_P1 = 11,
- TSHAPE_ARG_P2 = 12,
- TSHAPE_ARG_P3 = 13
- };
-
-private:
- Handle(GEOM_Function) _func;
-};
-
-#endif // _GEOMImpl_IPipeTShape_HXX_
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_ISmoothingSurface_HXX_
-#define _GEOMImpl_ISmoothingSurface_HXX_
-
-#include "GEOM_Function.hxx"
-
-#define SMOOTHINGSURFACE_ARG_LENG 1
-#define SMOOTHINGSURFACE_ARG_LAST 2
-#define SMOOTHINGSURFACE_ARG_NB_MAX 3
-#define SMOOTHINGSURFACE_ARG_DEG_MAX 4
-#define SMOOTHINGSURFACE_ARG_D_MAX 5
-
-class GEOMImpl_ISmoothingSurface
-{
-public:
- GEOMImpl_ISmoothingSurface(Handle(GEOM_Function) theFunction): _func(theFunction) {}
-
- void SetLength(int theLen) { _func->SetInteger(SMOOTHINGSURFACE_ARG_LENG, theLen); }
- int GetLength() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_LENG); }
-
- void SetPntOrComp(int theId, Handle(GEOM_Function) theP) { _func->SetReference(SMOOTHINGSURFACE_ARG_LAST + theId, theP); }
- Handle(GEOM_Function) GetPntOrComp(int theId) { return _func->GetReference(SMOOTHINGSURFACE_ARG_LAST + theId); }
-
- void SetNbMax(int theNbMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_NB_MAX, theNbMax); }
- int GetNbMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_NB_MAX); }
-
- void SetDegMax(int theDegMax) { _func->SetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX, theDegMax); }
- int GetDegMax() { return _func->GetInteger(SMOOTHINGSURFACE_ARG_DEG_MAX); }
-
- void SetDMax(double theDMax) { _func->SetReal(SMOOTHINGSURFACE_ARG_D_MAX, theDMax); }
- double GetDMax() { return _func->GetReal(SMOOTHINGSURFACE_ARG_D_MAX); }
-
-private:
- Handle(GEOM_Function) _func;
-};
-
-#endif // _GEOMImpl_ISmoothingSurface_HXX_
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GEOMImpl_PipeTShapeDriver.hxx>
-
-#include <GEOMImpl_IPipeTShape.hxx>
-#include <GEOMImpl_Types.hxx>
-#include <GEOMImpl_Block6Explorer.hxx>
-#include <GEOMImpl_IAdvancedOperations.hxx>
-
-#include <GEOM_Function.hxx>
-#include <GEOM_IOperations.hxx>
-
-#include <GEOMUtils.hxx>
-
-#include <GEOMAlgo_FinderShapeOn1.hxx>
-#include <GEOMAlgo_FinderShapeOn2.hxx>
-#include <GEOMAlgo_ClsfBox.hxx>
-
-#include <TFunction_Logbook.hxx>
-#include <StdFail_NotDone.hxx>
-
-// Partition includes
-#include <GEOMAlgo_Splitter.hxx>
-#include <Geom_CylindricalSurface.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Ax2.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Trsf.hxx>
-
-#include <BRepPrimAPI_MakeCone.hxx>
-#include <BRepPrimAPI_MakeCylinder.hxx>
-#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepAlgoAPI_Cut.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-#include <BRepFilletAPI_MakeFillet.hxx>
-#include <BRepFilletAPI_MakeChamfer.hxx>
-#include <BRep_Builder.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-#include <TopoDS.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <vector>
-//@@ include required header files here @@//
-
-#include "AdvancedEngine_Types.hxx"
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const Standard_GUID& GEOMImpl_PipeTShapeDriver::GetID()
-{
- static Standard_GUID aGUID("1C3A0F3F-729D-4E83-8232-78E74FC5637C");
- return aGUID;
-}
-
-//=======================================================================
-//function : GEOMImpl_PipeTShapeDriver
-//purpose :
-//=======================================================================
-GEOMImpl_PipeTShapeDriver::GEOMImpl_PipeTShapeDriver()
-{
-}
-
-//=======================================================================
-//function : getShapesOnBoxIDs
- /*!
- * \brief Find IDs of sub-shapes complying with given status about surface
- * \param theBox - the box to check state of sub-shapes against
- * \param theShape - the shape to explore
- * \param theShapeType - type of sub-shape of theShape
- * \param theState - required state
- * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
- */
-//=======================================================================
-Handle(TColStd_HSequenceOfInteger)
-GEOMImpl_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
- const TopoDS_Shape& aShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState) const
-{
- Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
-
- // Check presence of triangulation, build if need
- if (!GEOMUtils::CheckTriangulation(aShape)) {
- StdFail_NotDone::Raise("Cannot build triangulation on the shape");
- return aSeqOfIDs;
- }
-
- // Call algo
- GEOMAlgo_FinderShapeOn2 aFinder;
- Standard_Real aTol = 0.0001; // default value
-
- Handle(GEOMAlgo_ClsfBox) aClsfBox = new GEOMAlgo_ClsfBox;
- aClsfBox->SetBox(aBox);
-
- aFinder.SetShape(aShape);
- aFinder.SetTolerance(aTol);
- aFinder.SetClsf(aClsfBox);
- aFinder.SetShapeType( (TopAbs_ShapeEnum)theShapeType );
- aFinder.SetState(theState);
- aFinder.Perform();
-
- // Interprete results
- Standard_Integer iErr = aFinder.ErrorStatus();
- // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
- if (iErr) {
- TCollection_AsciiString aMsg (" iErr : ");
- aMsg += TCollection_AsciiString(iErr);
- StdFail_NotDone::Raise(aMsg.ToCString());
- return aSeqOfIDs;
- }
-
-
- const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
-
- if (listSS.Extent() < 1) {
- StdFail_NotDone::Raise(NOT_FOUND_ANY); // NPAL18017
- return aSeqOfIDs;
- }
-
- // Fill sequence of object IDs
- aSeqOfIDs = new TColStd_HSequenceOfInteger;
-
- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(aShape, anIndices);
-
- TopTools_ListIteratorOfListOfShape itSub (listSS);
- for (int index = 1; itSub.More(); itSub.Next(), ++index) {
- int id = anIndices.FindIndex(itSub.Value());
-// std::cerr << "Shape with ID " << id << " found" << std::endl;
- aSeqOfIDs->Append(id);
- }
-
- return aSeqOfIDs;
-}
-
-//=======================================================================
-//function : GetShapesOnSurfaceIDs
- /*!
- * \brief Find IDs of sub-shapes complying with given status about surface
- * \param theSurface - the surface to check state of sub-shapes against
- * \param theShape - the shape to explore
- * \param theShapeType - type of sub-shape of theShape
- * \param theState - required state
- * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
- */
-//=======================================================================
-Handle(TColStd_HSequenceOfInteger)
- GEOMImpl_PipeTShapeDriver::GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
- const TopoDS_Shape& theShape,
- TopAbs_ShapeEnum theShapeType,
- GEOMAlgo_State theState) const
-{
- Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
-
- // Check presence of triangulation, build if need
- if (!GEOMUtils::CheckTriangulation(theShape)) {
- StdFail_NotDone::Raise("Cannot build triangulation on the shape");
- return aSeqOfIDs;
- }
-
- // Call algo
- GEOMAlgo_FinderShapeOn1 aFinder;
- Standard_Real aTol = 1e-6;
-
- aFinder.SetShape(theShape);
- aFinder.SetTolerance(aTol);
- aFinder.SetSurface(theSurface);
- aFinder.SetShapeType(theShapeType);
- aFinder.SetState(theState);
-
- // Sets the minimal number of inner points for the faces that do not have own
- // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
- // Default value=3
- aFinder.SetNbPntsMin(3);
- // Sets the maximal number of inner points for edges or faces.
- // It is usefull for the cases when this number is very big (e.g =2000) to improve
- // the performance. If this value =0, all inner points will be taken into account.
- // Default value=0
- aFinder.SetNbPntsMax(0);
-
- aFinder.Perform();
-
- // Interprete results
- Standard_Integer iErr = aFinder.ErrorStatus();
- // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
- if (iErr) {
-// MESSAGE(" iErr : " << iErr);
- TCollection_AsciiString aMsg (" iErr : ");
- aMsg += TCollection_AsciiString(iErr);
- StdFail_NotDone::Raise(aMsg.ToCString());
- return aSeqOfIDs;
- }
-// Standard_Integer iWrn = aFinder.WarningStatus();
- // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
-// if (iWrn) {
-// MESSAGE(" *** iWrn : " << iWrn);
-// }
-
- const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
-
- if (listSS.Extent() < 1) {
- //StdFail_NotDone::Raise("Not a single sub-shape of the requested type found on the given surface");
- StdFail_NotDone::Raise(NOT_FOUND_ANY); // NPAL18017
- return aSeqOfIDs;
- }
-
- // Fill sequence of object IDs
- aSeqOfIDs = new TColStd_HSequenceOfInteger;
-
- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(theShape, anIndices);
-
- TopTools_ListIteratorOfListOfShape itSub (listSS);
- for (int index = 1; itSub.More(); itSub.Next(), ++index) {
- int id = anIndices.FindIndex(itSub.Value());
- aSeqOfIDs->Append(id);
- }
-
- return aSeqOfIDs;
-}
-
-//=======================================================================
-//function : GetCommonShapesOnCylinders
-//purpose : return the common shapes between 2 cylindrical surfaces
-// along OX and OZ
-//=======================================================================
-void GEOMImpl_PipeTShapeDriver::GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
- TopAbs_ShapeEnum theShapeType,
- double r1,
- double r2,
- Handle(TopTools_HSequenceOfShape)& commonShapes) const
-{
- gp_Pnt aP0 (0, 0, 0);
- gp_Vec aVX = gp::DX(), aVZ = gp::DZ();
- gp_Ax3 anAxis1 (aP0, aVX, aVZ), anAxis2 (aP0, aVZ, aVX);
-
- TopTools_IndexedMapOfShape aMapOfShapes;
- aMapOfShapes.Clear();
- TopExp::MapShapes(theShape, aMapOfShapes);
-
- commonShapes->Clear();
-
- int myID;
- bool found = false;
-
- // Create a cylinder surface
- Handle(Geom_Surface) aC1Ext = new Geom_CylindricalSurface(anAxis1, r1);
- if ( aC1Ext.IsNull() )
- StdFail_NotDone::Raise("Couldn't build main cylindrical surface");
- // Find object IDs
- Handle(TColStd_HSequenceOfInteger) aSeqExt1 = GetShapesOnSurfaceIDs( aC1Ext, theShape, theShapeType, GEOMAlgo_ST_ON );
- // Create a cylinder surface
- Handle(Geom_Surface) aC2Ext = new Geom_CylindricalSurface(anAxis2, r2);
- if ( aC2Ext.IsNull() )
- StdFail_NotDone::Raise("Couldn't build incident cylindrical surface");
- // Find object IDs
- Handle(TColStd_HSequenceOfInteger) aSeqExt2 = GetShapesOnSurfaceIDs( aC2Ext, theShape, theShapeType, GEOMAlgo_ST_ON );
- // # Recherche (dans le quart de Te) de l'arete d'intersection des 2 cylindres
- // # Search in theShape for common shape of type theShapeType on the intersection of 2 pipes
- found = false;
- for (int i=1; i<=aSeqExt2->Length();i++) {
-// std::cerr << "aSeqExt2->Value(i): " << aSeqExt2->Value(i) << std::endl;
- for (int j=1; j<=aSeqExt1->Length();j++) {
-// std::cerr << "aSeqExt1->Value(j): " << aSeqExt1->Value(j) << std::endl;
- if (aSeqExt1->Value(j) == aSeqExt2->Value(i)) {
- myID = aSeqExt1->Value(j);
- commonShapes->Append(aMapOfShapes.FindKey(myID));
- found = true;
- }
- }
- }
- if (!found)
- StdFail_NotDone::Raise("Common shapes couldn't be found");
-}
-
-//=======================================================================
-//function : MakePipeTShape
-//purpose :
-//=======================================================================
-TopoDS_Shape GEOMImpl_PipeTShapeDriver::MakePipeTShape (const double r1, const double w1, const double l1,
- const double r2, const double w2, const double l2) const
-{
- double r1Ext = r1 + w1;
- double r2Ext = r2 + w2;
-
- gp_Pnt aP0 (0, 0, 0);
- gp_Pnt aP1 (-l1, 0, 0);
- gp_Vec aVX = gp::DX(), aVY = gp::DY(), aVZ = gp::DZ();
- gp_Ax2 anAxes1 (aP1, aVX, aVZ);
- gp_Ax2 anAxes2 (aP0, aVZ, aVX);
-
- // Build the initial pipes
- BRepPrimAPI_MakeCylinder C1Int (anAxes1, r1, Abs(2 * l1));
- BRepPrimAPI_MakeCylinder C1Ext (anAxes1, r1Ext, Abs(2 * l1));
- BRepPrimAPI_MakeCylinder C2Int (anAxes2, r2, Abs(l2));
- BRepPrimAPI_MakeCylinder C2Ext (anAxes2, r2Ext, Abs(l2));
- C1Int.Build();
- C1Ext.Build();
- C2Int.Build();
- C2Ext.Build();
- if (!C1Int.IsDone() || !C1Ext.IsDone() || !C2Int.IsDone() || !C2Ext.IsDone()) {
- StdFail_NotDone::Raise("Cannot build cylinders");
- }
-
- // Fuse the 2 pipes
- BRepAlgoAPI_Fuse fuse1 (C1Ext.Shape(), C2Ext.Shape());
- if (!fuse1.IsDone()) {
- StdFail_NotDone::Raise("Cannot fuse cylinders");
- }
-
- // Remove small radius main pipe
- BRepAlgoAPI_Cut cut1 (fuse1.Shape(), C1Int.Shape());
- if (!cut1.IsDone()) {
- StdFail_NotDone::Raise("Coudn't cut cylinders");
- }
-
- // Remove small radius incident pipe => Te
- BRepAlgoAPI_Cut Te (cut1.Shape(), C2Int.Shape());
- if (!Te.IsDone()) {
- StdFail_NotDone::Raise("Coudn't cut cylinders");
- }
-
- return Te.Shape();
-}
-
-//=======================================================================
-//function : MakeQuarterPipeTShape
-//purpose :
-//=======================================================================
-TopoDS_Shape GEOMImpl_PipeTShapeDriver::MakeQuarterPipeTShape (const double r1, const double w1, const double l1,
- const double r2, const double w2, const double l2) const
-{
- TopoDS_Shape Te = MakePipeTShape(r1, w1, l1, r2, w2, l2);
- if (Te.IsNull())
- StdFail_NotDone::Raise("Couldn't build Pipe TShape");
-
- // Get a quarter of shape => Te2
- double r1Ext = r1 + w1;
- BRepPrimAPI_MakeBox box1 (gp_Pnt(0, -2*r1Ext, -2*r1Ext), gp_Pnt( Abs(2 * l1), 2*r1Ext, Abs(2*l2)));
- BRepPrimAPI_MakeBox box2 (gp_Pnt(0, 2*r1Ext, -2*r1Ext), gp_Pnt(-Abs(2 * l1), 0, Abs(2*l2)));
- box1.Build();
- box2.Build();
- if (!box1.IsDone() || !box2.IsDone()) {
- StdFail_NotDone::Raise("Couldn't build boxes");
- }
- BRepAlgoAPI_Cut cut3 (Te, box1.Shape());
- if (!cut3.IsDone()) {
- StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
- }
- BRepAlgoAPI_Cut Te4 (cut3.Shape(), box2.Shape());
- if (!Te4.IsDone()) {
- StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
- }
-
- return Te4.Shape();
-}
-
-//=======================================================================
-//function : Execute
-//purpose :
-//=======================================================================
-Standard_Integer GEOMImpl_PipeTShapeDriver::Execute (TFunction_Logbook& log) const
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_IPipeTShape aData (aFunction);
- Standard_Integer aType = aFunction->GetType();
-
- TopoDS_Shape aShape, Te4, Te4Part;
- //TopoDS_Edge arete_intersect_int;
- //Handle(TopTools_HSequenceOfShape) edges_e = new TopTools_HSequenceOfShape;
- Handle(TColStd_HSequenceOfInteger) edges_e;
- //Handle(TopTools_HSequenceOfShape) edges_i = new TopTools_HSequenceOfShape;
- //gp_Pnt aP0 (0, 0, 0);
- //gp_Vec aVX = gp::DX(), aVY = gp::DY(), aVZ = gp::DZ();
- bool hexMesh = (bool) aData.GetHexMesh();
-
- // Useful values
- //double aSize = 2*(aData.GetL1() + aData.GetL2());
- double epsilon = Precision::Approximation();
- double aR1Ext = aData.GetR1() + aData.GetW1();
- double aR2Ext = aData.GetR2() + aData.GetW2();
-
- if (aData.GetR2() > aData.GetR1() + epsilon) {
- StdFail_NotDone::Raise("TShape cannot be computed if R2 > R1");
- }
-
- if (aR2Ext > aR1Ext + epsilon) {
- StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 > R1+W1");
- }
-
- // external radius are equal
- if (fabs(aR2Ext - aR1Ext) < epsilon) {
- if (aType == TSHAPE_CHAMFER)
- StdFail_NotDone::Raise("TShape with chamfer cannot be computed if R2+W2 = R1+W1");
- if (aType == TSHAPE_FILLET)
- StdFail_NotDone::Raise("TShape with fillet cannot be computed if R2+W2 = R1+W1");
- // internal radius are different => not possible
- if (fabs(aData.GetR2() - aData.GetR1()) > epsilon) {
- StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 = R1+W1 and R2 != R1");
- }
- }
-
- if (aR1Ext >= aData.GetL2() + epsilon) {
- StdFail_NotDone::Raise("TShape cannot be computed if R1+W1 >= L2");
- }
- if (aR2Ext >= aData.GetL1() + epsilon) {
- StdFail_NotDone::Raise("TShape cannot be computed if R2+W2 >= L1");
- }
-
- if (aType == TSHAPE_CHAMFER) {
- if (aData.GetH() >= (aData.GetL2() - aR1Ext + epsilon)) {
- StdFail_NotDone::Raise("TShape cannot be computed: height of chamfer is too high");
- }
-
- if (aData.GetW() >= (aData.GetL1() - aR2Ext + epsilon))
- StdFail_NotDone::Raise("TShape cannot be computed: width of chamfer is too high");
- }
-
- if (aType == TSHAPE_FILLET) {
- if (aData.GetRF() >= (aData.GetL2() - aR1Ext + epsilon) ||
- aData.GetRF() >= (aData.GetL1() - aR2Ext + epsilon))
- StdFail_NotDone::Raise("TShape cannot be computed: radius of fillet is too high");
- }
-
- if (hexMesh) {
- // Create a quarter of a basic T-Shape pipe
- //std::cerr << "Create a quarter of a basic T-Shape pipe" << std::endl;
- Te4 = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
- aData.GetR2(), aData.GetW2(), aData.GetL2());
- }
- else {
- // No need to cut pipe t-shape
- //std::cerr << "Create a basic T-Shape pipe" << std::endl;
- Te4 = MakePipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
- aData.GetR2(), aData.GetW2(), aData.GetL2());
- }
- aShape = Te4;
-/*
- if (aType == TSHAPE_BASIC) {
- aShape = Te4;
-// aShape = MakeQuarterPipeTShape(aData.GetR1(), aData.GetW1(), aData.GetL1(),
-// aData.GetR2(), aData.GetW2(), aData.GetL2());
- }
- else if (aType == TSHAPE_CHAMFER) {
- // TShape with chamfer
-// BRep_Builder BB;
-// TopoDS_Compound CC;
-// BB.MakeCompound(CC);
- // Create chamfer on the edges edges_e
- BRepFilletAPI_MakeChamfer chamfer (Te4);
- TopTools_IndexedMapOfShape anEdgesIndices;
- TopExp::MapShapes(Te4, anEdgesIndices);
-
- TopoDS_Shape theBox;
- if (hexMesh) {
- BRepPrimAPI_MakeBox aBox (gp_Pnt(0,0,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
- aBox.Build();
- if (!aBox.IsDone()) {
- StdFail_NotDone::Raise("Couldn't build box");
- }
- theBox = aBox.Shape();
- }
- else {
- BRepPrimAPI_MakeBox aBox (gp_Pnt(aR2Ext,aR2Ext,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
- aBox.Build();
- if (!aBox.IsDone()) {
- StdFail_NotDone::Raise("Couldn't build box");
- }
- theBox = aBox.Shape();
- }
- Handle(TColStd_HSequenceOfInteger) edges_e = new TColStd_HSequenceOfInteger;
- edges_e = GetShapesOnBoxIDs(theBox, Te4, TopAbs_EDGE, GEOMAlgo_ST_IN);
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- StdFail_NotDone::Raise("Common edges not found");
- }
-
- TopTools_IndexedDataMapOfShapeListOfShape M;
- GEOMImpl_Block6Explorer::MapShapesAndAncestors(Te4, TopAbs_EDGE, TopAbs_FACE, M);
-// std::cerr << "Number of IDs: " << edges_e->Length() << std::endl;
- int nbEdgesInChamfer = 0;
- for (int i=1;i<=edges_e->Length();i++) {
-// std::cerr << "Get Edge with ID #" << i << std::endl;
- int theId = edges_e->Value(i);
-// std::cerr << "ID #" << i << "= " << theId << std::endl;
-// std::cerr << "Search for edge in shape" << std::endl;
- TopoDS_Edge theEdge = TopoDS::Edge(anEdgesIndices.FindKey(theId));
-// std::cerr << "Found" << std::endl;
-// std::cerr << "Keep only edges with a vertex on (x, x, re1)" << std::endl;
- TopExp_Explorer ExVertices;
- for (ExVertices.Init(theEdge,TopAbs_VERTEX); ExVertices.More(); ExVertices.Next()) {
- gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(ExVertices.Current()));
- if (aPt.Z() - aR1Ext <= epsilon) {
-// std::cerr << "aPt.Z() = aR1Ext => keep this edge" << std::endl;
- nbEdgesInChamfer ++;
- const TopTools_ListOfShape& aFL = M.FindFromKey(theEdge);
- TopoDS_Face F = TopoDS::Face( aFL.First() );
- if (hexMesh)
- chamfer.Add(aData.GetH(), aData.GetW(), theEdge, F);
- else
- chamfer.Add(aData.GetW(), aData.GetH(), theEdge, F);
- break;
- }
- }
-// std::cerr << "Test if hexMesh: ";
- if (hexMesh && nbEdgesInChamfer == 1) {
-// std::cerr << "Yes => stop after 1 edge" << std::endl;
- break;
- }
-// std::cerr << "No => continue for other edges" << std::endl;
- // BB.Add(CC, edges_e->Value(i));
- // const TopTools_ListOfShape& aFL = M.FindFromKey(TopoDS::Edge(edges_e->Value(i)));
- // chamfer.Add(aData.GetW(), aData.GetH(), TopoDS::Edge(edges_e->Value(i)), F);
- }
-// std::cerr << "Build chamfer with " << nbEdgesInChamfer << " edges" << std::endl;
-// }
- chamfer.Build();
- if (!chamfer.IsDone()) {
- StdFail_NotDone::Raise("Chamfer can not be computed on the given shape with the given parameters");
- }
-
-// BB.Add(CC, chamfer.Shape());
-
-// aShape = CC;
- aShape = chamfer.Shape();
- }
- else if (aType == TSHAPE_FILLET) {
- // TShape with fillet
- // Create fillet on the edge arete_intersect_ext
- BRepFilletAPI_MakeFillet fill (Te4);
-
- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(Te4, anIndices);
-
- TopoDS_Shape theBox;
- if (hexMesh) {
- BRepPrimAPI_MakeBox aBox (gp_Pnt(0,0,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
- aBox.Build();
- if (!aBox.IsDone()) {
- StdFail_NotDone::Raise("Couldn't build box");
- }
- theBox = aBox.Shape();
- }
- else {
- BRepPrimAPI_MakeBox aBox (gp_Pnt(aR2Ext,aR2Ext,0),gp_Pnt(-aR2Ext, -aR2Ext, aR1Ext));
- aBox.Build();
- if (!aBox.IsDone()) {
- StdFail_NotDone::Raise("Couldn't build box");
- }
- theBox = aBox.Shape();
- }
- Handle(TColStd_HSequenceOfInteger) edges_e = new TColStd_HSequenceOfInteger;
- edges_e = GetShapesOnBoxIDs(theBox, Te4, TopAbs_EDGE, GEOMAlgo_ST_IN);
- if (edges_e.IsNull() || edges_e->Length() == 0) {
- StdFail_NotDone::Raise("Common edges not found");
- }
-
-// fill.Add(TopoDS::Edge(edges_e->Value(1)));
-// if (!hexMesh) {
- for (int i=1;i<=edges_e->Length();i++) {
- if (hexMesh && (i > 1))
- break;
- TopoDS_Edge theEdge = TopoDS::Edge(anIndices.FindKey(edges_e->Value(i)));
- fill.Add(theEdge);
-// fill.Add(TopoDS::Edge(edges_e->Value(i)));
- }
-// }
- fill.SetRadius(aData.GetRF(), 1, 1);
- fill.Build();
- if (!fill.IsDone()) {
- StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius");
- }
-
- aShape = fill.Shape();
- }
- else {
- // other construction modes here
- }
-*/
- if (aShape.IsNull()) return 0;
-
- aFunction->SetValue(aShape);
-
- log.SetTouched(Label());
-
- return 1;
-}
-
-//================================================================================
-/*!
- * \brief Returns a name of creation operation and names and values of creation parameters
- */
-//================================================================================
-
-bool GEOMImpl_PipeTShapeDriver::
-GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& theParams)
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_IPipeTShape aCI( function );
- Standard_Integer aType = function->GetType();
-
- theOperationName = "PIPETSHAPE";
-
- switch ( aType ) {
- case TSHAPE_BASIC:
- AddParam( theParams, "Main radius", aCI.GetR1() );
- AddParam( theParams, "Main width", aCI.GetW1() );
- AddParam( theParams, "Main half-length", aCI.GetL1() );
- AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
- AddParam( theParams, "Incident pipe width", aCI.GetW2() );
- AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
- AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
- break;
- case TSHAPE_CHAMFER:
- AddParam( theParams, "Main radius", aCI.GetR1() );
- AddParam( theParams, "Main width", aCI.GetW1() );
- AddParam( theParams, "Main half-length", aCI.GetL1() );
- AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
- AddParam( theParams, "Incident pipe width", aCI.GetW2() );
- AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
- AddParam( theParams, "Chamfer height", aCI.GetH() );
- AddParam( theParams, "Chamfer width", aCI.GetW() );
- AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
- break;
- case TSHAPE_FILLET:
- AddParam( theParams, "Main radius", aCI.GetR1() );
- AddParam( theParams, "Main width", aCI.GetW1() );
- AddParam( theParams, "Main half-length", aCI.GetL1() );
- AddParam( theParams, "Incident pipe radius", aCI.GetR2() );
- AddParam( theParams, "Incident pipe width", aCI.GetW2() );
- AddParam( theParams, "Incident pipe half-length", aCI.GetL2() );
- AddParam( theParams, "Fillet radius", aCI.GetRF() );
- AddParam( theParams, "For hex mesh", aCI.GetHexMesh() );
- break;
- default:
- return false;
- }
-
- return true;
-}
-
-IMPLEMENT_STANDARD_HANDLE (GEOMImpl_PipeTShapeDriver,GEOM_BaseDriver);
-IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_PipeTShapeDriver,GEOM_BaseDriver);
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_PipeTShapeDriver_HXX
-#define _GEOMImpl_PipeTShapeDriver_HXX
-
-#include <TFunction_Driver.hxx>
-
-#include "GEOMAlgo_State.hxx"
-
-#include <TopAbs_ShapeEnum.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_HSequenceOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TColStd_HSequenceOfInteger.hxx>
-#include <gp_Ax2.hxx>
-
-#include <Handle_Geom_Surface.hxx>
-
-class Handle_Standard_Type;
-class GEOMImpl_PipeTShapeDriver;
-
-
-
-#include "GEOM_BaseDriver.hxx"
-
-DEFINE_STANDARD_HANDLE( GEOMImpl_PipeTShapeDriver, GEOM_BaseDriver );
-
-class GEOMImpl_PipeTShapeDriver : public GEOM_BaseDriver {
-public:
- // Methods PUBLIC
- //
- Standard_EXPORT GEOMImpl_PipeTShapeDriver();
- Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
- Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
- Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
- {
- return Standard_True;
- }
- Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT ~GEOMImpl_PipeTShapeDriver() {};
-
- Standard_EXPORT virtual
- bool GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& params);
- // Type management
- //
-DEFINE_STANDARD_RTTI( GEOMImpl_PipeTShapeDriver )
-
-private:
-
- /*!
- * \brief Create a T-Shape based on pipes
- * \param r1 - the internal radius of main pipe
- * \param w1 - the thickness of main pipe
- * \param l1 - the half-length of main pipe
- * \param r2 - the internal radius of incident pipe
- * \param w2 - the thickness of incident pipe
- * \param l2 - the half-length of main pipe
- * \retval TopoDS_Shape - Resulting shape
- */
- TopoDS_Shape MakePipeTShape(double r1, double w1, double l1,
- double r2, double w2, double l2) const;
-
- /*!
- * \brief Create a quarter of a T-Shape based on pipes
- * \param r1 - the internal radius of main pipe
- * \param w1 - the thickness of main pipe
- * \param l1 - the half-length of main pipe
- * \param r2 - the internal radius of incident pipe
- * \param w2 - the thickness of incident pipe
- * \param l2 - the half-length of main pipe
- * \retval TopoDS_Shape - Resulting shape
- */
- TopoDS_Shape MakeQuarterPipeTShape(double r1, double w1, double l1,
- double r2, double w2, double l2) const;
-
- /*!
- * \brief Find IDs of sub-shapes complying with given status about surface
- * \param theSurface - the surface to check state of sub-shapes against
- * \param theShape - the shape to explore
- * \param theShapeType - type of sub-shape of theShape
- * \param theState - required state
- * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
- */
- Handle(TColStd_HSequenceOfInteger)
- GetShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
- const TopoDS_Shape& theShape,
- TopAbs_ShapeEnum theShapeType,
- GEOMAlgo_State theState) const;
-
- /*!
- * \brief Find IDs of sub-shapes complying with given status about surface
- * \param theBox - the box to check state of sub-shapes against
- * \param theShape - the shape to explore
- * \param theShapeType - type of sub-shape of theShape
- * \param theState - required state
- * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
- */
- Handle(TColStd_HSequenceOfInteger)
- GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
- const TopoDS_Shape& aShape,
- const Standard_Integer theShapeType,
- GEOMAlgo_State theState) const;
-
- //=======================================================================
- //function : getCommonShapesOnCylinders
- //purpose : return the common edge between 2 cylindrical surfaces
- // along OX and OZ
- //=======================================================================
- void GetCommonShapesOnCylinders(const TopoDS_Shape& theShape,
- TopAbs_ShapeEnum theShapeType,
- double r, double r2,
- Handle(TopTools_HSequenceOfShape)& commonShapes) const;
-
-};
-
-#endif // _GEOMImpl_PipeTShapeDriver_HXX
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <Standard_Stream.hxx>
-
-#include "AdvancedEngine_Types.hxx"
-
-#include <GEOMImpl_SmoothingSurfaceDriver.hxx>
-#include <GEOMImpl_ISmoothingSurface.hxx>
-#include <GEOMImpl_Types.hxx>
-#include <GEOM_Function.hxx>
-
-#include <TFunction_Logbook.hxx>
-#include <StdFail_NotDone.hxx>
-
-//@@ include required header files here @@//
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <TColgp_SequenceOfPnt.hxx>
-#include <TColgp_Array2OfPnt.hxx>
-#include <TColgp_SequenceOfXY.hxx>
-#include <TColgp_SequenceOfXYZ.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-
-#include <BRepAdaptor_HSurface.hxx>
-
-#include <BRep_Builder.hxx>
-#include <BRepGProp.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepPrimAPI_MakeSphere.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepAlgoAPI_Cut.hxx>
-
-#include <GeomPlate_Surface.hxx>
-#include <GeomPlate_BuildPlateSurface.hxx>
-#include <GeomPlate_PointConstraint.hxx>
-#include <GeomPlate_MakeApprox.hxx>
-#include <GeomPlate_PlateG0Criterion.hxx>
-#include <GeomPlate_BuildAveragePlane.hxx>
-
-#include <Geom_BSplineSurface.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Plane.hxx>
-
-#include <GProp_GProps.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Ax3.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Vec.hxx>
-
-#include <GC_MakePlane.hxx>
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const Standard_GUID& GEOMImpl_SmoothingSurfaceDriver::GetID()
-{
- static Standard_GUID aGUID("1C3A0F30-729D-4E83-8232-78E74FC5637C");
- return aGUID;
-}
-
-//=======================================================================
-//function : GEOMImpl_SmoothingSurfaceDriver
-//purpose :
-//=======================================================================
-GEOMImpl_SmoothingSurfaceDriver::GEOMImpl_SmoothingSurfaceDriver()
-{
-}
-
-//=======================================================================
-//function : MakeSmoothingSurfaceUnClosed
-//purpose :
-//=======================================================================
-TopoDS_Shape GEOMImpl_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed
- (const Handle_TColgp_HArray1OfPnt &theListOfPoints,
- const Standard_Integer theNbMax,
- const Standard_Integer theDegMax,
- const Standard_Real theDMax) const
-{
- TopoDS_Face aInitShape;
-
- // Create an average Plane
- //Handle(TColgp_HArray1OfPnt) HAP = new TColgp_HArray1OfPnt(1,theListOfPoints.Length())
- GeomPlate_BuildAveragePlane gpbap(theListOfPoints,theListOfPoints->Length(),Precision::Confusion(),1,1);
- Handle(Geom_Plane) plane(gpbap.Plane());
- Standard_Real Umin, Umax, Vmin, Vmax;
- gpbap.MinMaxBox(Umin,Umax,Vmin,Vmax);
- // cout << "Vals : " << Umin << ", " << Umax << ", " << Vmin << ", " << Vmax << endl;
- BRepBuilderAPI_MakeFace mf(plane,Umin,Umax,Vmin,Vmax,Precision::Confusion());
- aInitShape = mf.Face();
- //return aInitShape;
-
- GeomPlate_BuildPlateSurface aBuilder(3,10);
- // ** Initialization of surface
- Handle(BRepAdaptor_HSurface) HSI = new BRepAdaptor_HSurface();
- HSI->ChangeSurface().Initialize(aInitShape);
- aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->ChangeSurface().Face()));
-
- Standard_Integer j, j1, j2;
- // cout << "Init surface" << endl;
- j1 = theListOfPoints->Lower();
- j2 = theListOfPoints->Upper();
- for (j=j1; j<=j2 ; j++)
- {
- gp_Pnt aPnt = theListOfPoints->Value(j);
- Handle(GeomPlate_PointConstraint) PCont = new GeomPlate_PointConstraint(aPnt,0);
- aBuilder.Add(PCont);
- }
- // cout << "avant Perform surface" << endl;
- aBuilder.Perform();
- // cout << "Perform surface" << endl;
-
- // A ce niveau : surface algo
- Handle(GeomPlate_Surface) gpPlate = aBuilder.Surface();
-
- Standard_Integer nbcarreau = (theNbMax > 0 ? theNbMax : 2);
- Standard_Integer degmax = (theDegMax > 0 ? theDegMax : 8);
- Standard_Real seuil = theDMax;
-
- if (seuil <= 0.) {
- seuil = Max(0.0001,10*aBuilder.G0Error());
- }
-
- GeomPlate_MakeApprox Mapp(gpPlate,0.0001,nbcarreau,degmax,seuil);
- // cout << "Approx surface" << endl;
-
- Handle (Geom_Surface) Surf (Mapp.Surface());
-
- aBuilder.Surface()->Bounds( Umin, Umax, Vmin, Vmax);
-
- BRepBuilderAPI_MakeFace MF(Surf,Umin, Umax, Vmin, Vmax, Precision::Confusion());
- TopoDS_Shape aShape = MF.Shape();
-
- return aShape;
-}
-
-
-//=======================================================================
-//function : Execute
-//purpose :
-//=======================================================================
-Standard_Integer GEOMImpl_SmoothingSurfaceDriver::Execute(TFunction_Logbook& log) const
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
- if (aFunction.IsNull()) return 0;
-
- Standard_Integer aType = aFunction->GetType();
-
- if (aType != SMOOTHINGSURFACE_LPOINTS) return 0;
- // cout << "Youhou : " << aType << endl;
-
- GEOMImpl_ISmoothingSurface aData (aFunction);
-
- // Fill the map of vertices.
- Standard_Integer aNbShapes = aData.GetLength();
- TopTools_MapOfShape aMapPoints;
- Standard_Integer i;
-
- for (i = 1; i <= aNbShapes; i++) {
- Handle(GEOM_Function) aFShape = aData.GetPntOrComp(i);
- TopoDS_Shape aShape = aFShape->GetValue();
-
- if (aShape.ShapeType() == TopAbs_VERTEX) {
- aMapPoints.Add(aShape);
- } else {
- TopExp_Explorer anExp(aShape, TopAbs_VERTEX);
-
- for (; anExp.More(); anExp.Next()) {
- aMapPoints.Add(anExp.Current());
- }
- }
- }
-
- // Add points to the array of points.
- const Standard_Integer aNbPoints = aMapPoints.Extent();
- Handle(TColgp_HArray1OfPnt) anArrayofPnt =
- new TColgp_HArray1OfPnt(1, aNbPoints);
- TopTools_MapIteratorOfMapOfShape anIter(aMapPoints);
-
- for (i = 1; anIter.More(); anIter.Next(), i++) {
- TopoDS_Vertex aPoint = TopoDS::Vertex(anIter.Key());
- gp_Pnt aPnt = BRep_Tool::Pnt(aPoint);
-
- anArrayofPnt->SetValue(i, aPnt);
- }
-
- const Standard_Integer aNbMax = aData.GetNbMax();
- const Standard_Integer aDegMax = aData.GetDegMax();
- const Standard_Real aDMax = aData.GetDMax();
-
- // Make smoothing surface.
- TopoDS_Shape aShape = GEOMImpl_SmoothingSurfaceDriver::
- MakeSmoothingSurfaceUnClosed(anArrayofPnt, aNbMax, aDegMax, aDMax);
-
- if (aShape.IsNull()) return 0;
-
- aFunction->SetValue(aShape);
-
- log.SetTouched(Label());
-
- return 1;
-}
-
-//================================================================================
-/*!
- * \brief Returns a name of creation operation and names and values of creation parameters
- */
-//================================================================================
-
-bool GEOMImpl_SmoothingSurfaceDriver::
-GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& theParams)
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_ISmoothingSurface aCI( function );
- Standard_Integer aType = function->GetType();
-
- theOperationName = "SMOOTHINGSURFACE";
-
- switch ( aType ) {
- case SMOOTHINGSURFACE_LPOINTS:
- {
- AddParam( theParams, "Points" );
- if ( aCI.GetLength() > 1 )
- theParams[0] << aCI.GetLength() << " points: ";
- for ( int i = 1, nb = aCI.GetLength(); i <= nb; ++i )
- theParams[0] << aCI.GetPntOrComp( i ) << " ";
-
- const Standard_Integer aNbMax = aCI.GetNbMax();
- const Standard_Integer aDegMax = aCI.GetDegMax();
- const Standard_Real aDMax = aCI.GetDMax();
-
- AddParam(theParams, "Max nbr of Bezier pieces", aCI.GetNbMax());
- AddParam(theParams, "Max BSpline surface degree", aCI.GetDegMax());
- AddParam(theParams, "3D tolerance of initial approximation", aCI.GetDMax());
- }
- break;
- default:
- return false;
- }
-
- return true;
-}
-
-IMPLEMENT_STANDARD_HANDLE (GEOMImpl_SmoothingSurfaceDriver,GEOM_BaseDriver);
-IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_SmoothingSurfaceDriver,GEOM_BaseDriver);
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_SmoothingSurfaceDriver_HXX
-#define _GEOMImpl_SmoothingSurfaceDriver_HXX
-
-#ifndef _TFunction_Driver_HeaderFile
-#include <TFunction_Driver.hxx>
-#endif
-#ifndef _TFunction_Logbook_HeaderFile
-#include <TFunction_Logbook.hxx>
-#endif
-#ifndef _Standard_CString_HeaderFile
-#include <Standard_CString.hxx>
-#endif
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TopoDS_Shape.hxx>
-
-class Handle_Standard_Type;
-class GEOMImpl_SmoothingSurfaceDriver;
-
-
-
-#include "GEOM_BaseDriver.hxx"
-
-DEFINE_STANDARD_HANDLE( GEOMImpl_SmoothingSurfaceDriver, GEOM_BaseDriver );
-
-class GEOMImpl_SmoothingSurfaceDriver : public GEOM_BaseDriver {
-public:
- // Methods PUBLIC
- //
- Standard_EXPORT GEOMImpl_SmoothingSurfaceDriver();
- Standard_EXPORT virtual Standard_Integer Execute(TFunction_Logbook& log) const;
- Standard_EXPORT virtual void Validate(TFunction_Logbook&) const {}
- Standard_EXPORT Standard_Boolean MustExecute(const TFunction_Logbook&) const
- {
- return Standard_True;
- }
- Standard_EXPORT static const Standard_GUID& GetID();
- Standard_EXPORT ~GEOMImpl_SmoothingSurfaceDriver() {};
-
- Standard_EXPORT virtual
- bool GetCreationInformation(std::string& theOperationName,
- std::vector<GEOM_Param>& params);
- // Type management
- //
-DEFINE_STANDARD_RTTI( GEOMImpl_SmoothingSurfaceDriver )
-
-private:
- TopoDS_Shape MakeSmoothingSurfaceUnClosed
- (const Handle_TColgp_HArray1OfPnt &theListOfPoints,
- const Standard_Integer theNbMax,
- const Standard_Integer theDegMax,
- const Standard_Real theDMax) const;
-};
-
-#endif // _GEOMImpl_SmoothingSurfaceDriver_HXX
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOM_ADVANCEDENGINE_HXX_
-#define _GEOM_ADVANCEDENGINE_HXX_
-
-#ifdef WIN32
- #if defined ADVANCEDENGINE_EXPORTS || defined AdvancedEngine_EXPORTS
- #define ADVANCEDENGINE_EXPORT __declspec( dllexport )
- #else
- #define ADVANCEDENGINE_EXPORT __declspec( dllimport )
- #endif
-#else
- #define ADVANCEDENGINE_EXPORT
-#endif
-
-#endif
\ No newline at end of file
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : GEOM_IAdvancedOperations.cc
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-
-#include <Standard_Stream.hxx>
-
-#include "GEOM_IAdvancedOperations_i.hh"
-
-#include <utilities.h>
-#include <OpUtil.hxx>
-#include <Utils_ExceptHandlers.hxx>
-
-#include "GEOM_Engine.hxx"
-#include "GEOM_Object.hxx"
-
-//=============================================================================
-/*!
- * constructor:
- */
-//=============================================================================
-GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_IAdvancedOperations* theImpl)
-:GEOM_IOperations_i(thePOA, theEngine, theImpl)
-{
- MESSAGE("GEOM_IAdvancedOperations_i::GEOM_IAdvancedOperations_i");
-}
-
-//=============================================================================
-/*!
- * destructor
- */
-//=============================================================================
-GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i()
-{
- MESSAGE("GEOM_IAdvancedOperations_i::~GEOM_IAdvancedOperations_i");
-}
-
-//=============================================================================
-/*!
- * MakePipeTShape
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShape
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
- if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull())return aSeq._retn();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeChamfer
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of chamfer.
- * \param theW Width of chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamfer
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theH, theW, theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeChamferWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeChamferWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theH, theW, theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeFillet
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFillet
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theRF, theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeFilletWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeFilletWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
- theRF, theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTR
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTR
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTRWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length).
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
- if (aP1.IsNull() || aP2.IsNull() || aP3.IsNull()) return aSeq._retn();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTRChamfer
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of chamfer.
- * \param theW Width of chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRChamfer
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theH, theW, theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTRChamferWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A chamfer is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theH Height of the chamfer.
- * \param theW Width of the chamfer.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRChamferWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theH, theW, theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTRFillet
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * Center of the shape is (0,0,0). The main plane of the T-shape is XOY.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet.
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRFillet
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theRF, CORBA::Boolean theHexMesh)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theRF, theHexMesh);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * MakePipeTShapeTRFilletWithPosition
- * Create a T-shape object with specified caracteristics for the main and
- * the incident pipes (radius, width, half-length). A fillet is created
- * on the junction of the pipes.
- * The extremities of the main pipe are located on junctions points P1 and P2.
- * The extremity of the incident pipe is located on junction point P3.
- * \param theR1 Internal radius of main pipe
- * \param theW1 Width of main pipe
- * \param theL1 Half-length of main pipe
- * \param theR2 Internal radius of incident pipe (R2 < R1)
- * \param theW2 Width of incident pipe (R2+W2 < R1+W1)
- * \param theL2 Half-length of incident pipe
- * \param theRF Radius of curvature of fillet
- * \param theHexMesh Boolean indicating if shape is prepared for hex mesh
- * \param theP1 1st junction point of main pipe
- * \param theP2 2nd junction point of main pipe
- * \param theP3 Junction point of incident pipe
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* GEOM_IAdvancedOperations_i::MakePipeTShapeTRFilletWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theRF, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3)
-{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference vertices
- Handle(GEOM_Object) aP1 = GetObjectImpl(theP1);
- Handle(GEOM_Object) aP2 = GetObjectImpl(theP2);
- Handle(GEOM_Object) aP3 = GetObjectImpl(theP3);
-
- //Create the TShape
- Handle(TColStd_HSequenceOfTransient) aHSeq =
- GetOperations()->MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theRF, theHexMesh, aP1, aP2, aP3);
- if (!GetOperations()->IsDone() || aHSeq.IsNull())
- return aSeq._retn();
-
- Standard_Integer aLength = aHSeq->Length();
- aSeq->length(aLength);
- for (Standard_Integer i = 1; i <= aLength; i++)
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
-
- return aSeq._retn();
-}
-
-//=============================================================================
-/*!
- * This function allows to create a disk already divided into blocks. It can be
- * use to create divided pipes for later meshing in hexaedra.
- * \param theR Radius of the disk
- * \param theRatio Relative size of the central square diagonal against the disk diameter
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDisk (CORBA::Double theR,
- CORBA::Double theRatio,
- CORBA::Short theOrientation,
- GEOM::pattern thePattern)
-{
- GEOM::GEOM_Object_var aGEOMObject;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the DividedDisk
- Handle(GEOM_Object) anObject = GetOperations()->MakeDividedDisk(theR, theRatio, theOrientation, thePattern);
- if (!GetOperations()->IsDone() || anObject.IsNull())
- return aGEOMObject._retn();
-
- return GetObject(anObject);
-}
-
-//=============================================================================
-/*!
- * MakeDividedDiskPntVecR
- */
-//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr thePnt,
- GEOM::GEOM_Object_ptr theVec,
- CORBA::Double theR,
- CORBA::Double theRatio,
- GEOM::pattern thePattern)
-{
- GEOM::GEOM_Object_var aGEOMObject;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference points
- Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
- Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
-
- if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
-
- // Make DividedDisk
- Handle(GEOM_Object) anObject =
- GetOperations()->MakeDividedDiskPntVecR(aPnt, aVec, theR, theRatio, thePattern);
- if (!GetOperations()->IsDone() || anObject.IsNull())
- return aGEOMObject._retn();
-
- return GetObject(anObject);
-}
-
-//=============================================================================
-/*!
- * Builds a cylinder prepared for hexa meshes
- * \param theR Radius of the cylinder
- * \param theH Height of the cylinder
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR,
- CORBA::Double theH,
- GEOM::pattern thePattern)
-{
- GEOM::GEOM_Object_var aGEOMObject;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Create the DividedCylinder
- Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
- if (!GetOperations()->IsDone() || anObject.IsNull())
- return aGEOMObject._retn();
-
- return GetObject(anObject);
-}
-
-//=============================================================================
-/*!
- *
- * \param thelPoints list of points
- * \param theNbMax maximum number of Bezier pieces in the resulting surface.
- * \param theDegMax maximum degree of the resulting BSpline surface
- * \param theDMax specifies maximum value of the GeomPlate_PlateG0Criterion criterion.
- * \return New GEOM_Object, containing the created shape.
- */
-//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints,
- CORBA::Long theNbMax,
- CORBA::Long theDegMax,
- CORBA::Double theDMax)
-{
- GEOM::GEOM_Object_var aGEOMObject;
-
- //Set a not done flag
- GetOperations()->SetNotDone();
-
- //Get the reference point
- int ind = 0;
- int aLen = thelPoints.length();
- std::list<Handle(GEOM_Object)> aPoints;
- for (; ind < aLen; ind++) {
- Handle(GEOM_Object) aPnt = GetObjectImpl(thelPoints[ind]);
- if (aPnt.IsNull()) return aGEOMObject._retn();
- aPoints.push_back(aPnt);
- }
- //Create the SmoothingSurface
- Handle(GEOM_Object) anObject = GetOperations()->MakeSmoothingSurface
- (aPoints, theNbMax, theDegMax, theDMax);
- if (!GetOperations()->IsDone() || anObject.IsNull())
- return aGEOMObject._retn();
-
- return GetObject(anObject);
-}
-
-/*@@ insert new functions before this line @@ do not remove this line @@*/
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : GEOM_IAdvancedOperations.hh
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-
-#ifndef _GEOM_IAdvancedOperations_i_HeaderFile
-#define _GEOM_IAdvancedOperations_i_HeaderFile
-
-#include "GEOMImpl_Gen.hxx"
-
-#include <SALOMEconfig.h>
-
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include "GEOM_IOperations_i.hh"
-#include "GEOM_Object_i.hh"
-#include "GEOM_AdvancedEngine.hxx"
-
-#include "GEOMImpl_IAdvancedOperations.hxx"
-
-class ADVANCEDENGINE_EXPORT GEOM_IAdvancedOperations_i :
- public virtual POA_GEOM::GEOM_IAdvancedOperations,
- public virtual GEOM_IOperations_i
-{
- public:
- GEOM_IAdvancedOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_IAdvancedOperations* theImpl);
- ~GEOM_IAdvancedOperations_i();
-
- // PipeTShape without thickness reduction
- GEOM::ListOfGO* MakePipeTShape (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::ListOfGO* MakePipeTShapeChamfer (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeChamferWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::ListOfGO* MakePipeTShapeFillet (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeFilletWithPosition (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRF, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
-
- // PipeTShape with thickness reduction
- GEOM::ListOfGO* MakePipeTShapeTR
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeTRWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::ListOfGO* MakePipeTShapeTRChamfer
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeTRChamferWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theH, CORBA::Double theW, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
- GEOM::ListOfGO* MakePipeTShapeTRFillet
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theRF, CORBA::Boolean theHexMesh);
- GEOM::ListOfGO* MakePipeTShapeTRFilletWithPosition
- (CORBA::Double theR1, CORBA::Double theW1, CORBA::Double theL1,
- CORBA::Double theR2, CORBA::Double theW2, CORBA::Double theL2,
- CORBA::Double theRL, CORBA::Double theWL, CORBA::Double theLtransL, CORBA::Double theLthinL,
- CORBA::Double theRR, CORBA::Double theWR, CORBA::Double theLtransR, CORBA::Double theLthinR,
- CORBA::Double theRI, CORBA::Double theWI, CORBA::Double theLtransI, CORBA::Double theLthinI,
- CORBA::Double theRF, CORBA::Boolean theHexMesh,
- GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
-
- GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR,
- CORBA::Double theRatio,
- CORBA::Short theOrientation,
- GEOM::pattern thePattern);
-
- GEOM::GEOM_Object_ptr MakeDividedDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
- GEOM::GEOM_Object_ptr theVector,
- CORBA::Double theR,
- CORBA::Double theRatio,
- GEOM::pattern thePattern);
-
- GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR,
- CORBA::Double theH,
- GEOM::pattern thePattern);
- GEOM::GEOM_Object_ptr MakeSmoothingSurface (const GEOM::ListOfGO& thelPoints,
- CORBA::Long theNbMax,
- CORBA::Long theDegMax,
- CORBA::Double theDMax);
- /*@@ insert new functions before this line @@ do not remove this line @@*/
-
- ::GEOMImpl_IAdvancedOperations* GetOperations()
- { return (::GEOMImpl_IAdvancedOperations*)GetImpl(); }
-};
-
-#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ICON_OBJBROWSER_ADVANCED_201</source>
+ <translation>tree_pipetshape.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_ADVANCED_202</source>
+ <translation>divided_disk.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_ADVANCED_203</source>
+ <translation>dividedcylinder.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_ADVANCED_204</source>
+ <translation>tree_smoothingsurface.png</translation>
+ </message>
+
+ <message>
+ <source>ICON_DLG_PIPETSHAPE</source>
+ <translation>pipetshape.png</translation>
+ </message>
+ <message>
+ <source>ICO_PIPETSHAPE</source>
+ <translation>pipetshape.png</translation>
+ </message>
+ <message>
+ <source>ICO_PIPETSHAPE_IMPORT</source>
+ <translation>pipetshape_import_icon.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE</source>
+ <translation>dlg_pipetshape.png</translation>
+ </message>
+ <message>
+ <source>IMG_PIPETSHAPE_SECT</source>
+ <translation>pipetshape_section.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_L1</source>
+ <translation>dlg_pipetshapel1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_R1</source>
+ <translation>dlg_pipetshaper1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_W1</source>
+ <translation>dlg_pipetshapew1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_L2</source>
+ <translation>dlg_pipetshapel2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_R2</source>
+ <translation>dlg_pipetshaper2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_W2</source>
+ <translation>dlg_pipetshapew2.png</translation>
+ </message>
+
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET</source>
+ <translation>dlg_pipetshapefillet.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_L1</source>
+ <translation>dlg_pipetshapefilletl1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_R1</source>
+ <translation>dlg_pipetshapefilletr1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_W1</source>
+ <translation>dlg_pipetshapefilletw1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_L2</source>
+ <translation>dlg_pipetshapefilletl2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_R2</source>
+ <translation>dlg_pipetshapefilletr2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_W2</source>
+ <translation>dlg_pipetshapefilletw2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_FILLET_RF</source>
+ <translation>dlg_pipetshapefilletrf.png</translation>
+ </message>
+
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER</source>
+ <translation>dlg_pipetshapechamfer.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_L1</source>
+ <translation>dlg_pipetshapechamferl1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_R1</source>
+ <translation>dlg_pipetshapechamferr1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_W1</source>
+ <translation>dlg_pipetshapechamferw1.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_L2</source>
+ <translation>dlg_pipetshapechamferl2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_R2</source>
+ <translation>dlg_pipetshapechamferr2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_W2</source>
+ <translation>dlg_pipetshapechamferw2.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_H</source>
+ <translation>dlg_pipetshapechamferh.png</translation>
+ </message>
+ <message>
+ <source>DLG_PIPETSHAPE_CHAMFER_W</source>
+ <translation>dlg_pipetshapechamferw.png</translation>
+ </message>
+
+<!--
+ <message>
+ <source>ICON_DLG_PIPETSHAPEGROUPS</source>
+ <translation>pipetshapegroups.png</translation>
+ </message>
+ <message>
+ <source>ICO_PIPETSHAPEGROUPS</source>
+ <translation>pipetshapegroups.png</translation>
+ </message>
+-->
+
+ <message>
+ <source>ICON_DLG_DIVIDEDDISK_R_RATIO</source>
+ <translation>divided_disk.png</translation>
+ </message>
+ <message>
+ <source>ICO_DIVIDEDDISK</source>
+ <translation>divided_disk.png</translation>
+ </message>
+
+ <message>
+ <source>ICON_DLG_DIVIDEDCYLINDER_R_H</source>
+ <translation>dividedcylinder_r_h.png</translation>
+ </message>
+ <message>
+ <source>ICO_DIVIDEDCYLINDER</source>
+ <translation>dividedcylinder.png</translation>
+ </message>
+
+ <message>
+ <source>ICON_DLG_SMOOTHINGSURFACE_LPOINTS</source>
+ <translation>smoothingsurface_lpoints.png</translation>
+ </message>
+ <message>
+ <source>ICO_SMOOTHINGSURFACE</source>
+ <translation>smoothingsurface.png</translation>
+ </message>
+ <!-- @@ insert new functions before this line @@ do not remove this line @@ -->
+ </context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>GEOM_ADVANCED</source>
+ <translation>Advanced shape: type %1</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_201</source>
+ <translation>Pipe TShape</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_202</source>
+ <translation>Divided Disk</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_203</source>
+ <translation>Divided Cylinder</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK</source>
+ <translation>Divided Disk</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK_TITLE</source>
+ <translation>Divided Disk construction</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER</source>
+ <translation>Divided Cylinder</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
+ <translation>Divided Cylinder construction</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDCYLINDER</source>
+ <translation>Divided Cylinder</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDCYLINDER</source>
+ <translation>Divided Cylinder</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDCYLINDER</source>
+ <translation>Divided Cylinder</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDDISK</source>
+ <translation>Divided Disk</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDDISK</source>
+ <translation>Divided Disk</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDDISK</source>
+ <translation>Divided Disk</translation>
+ </message>
+ <message>
+ <source>TOP_PIPETSHAPE</source>
+ <translation>Create Pipe TShape</translation>
+ </message>
+ <message>
+ <source>MEN_PIPETSHAPE</source>
+ <translation>Pipe TShape</translation>
+ </message>
+ <message>
+ <source>STB_PIPETSHAPE</source>
+ <translation>Create new Pipe TShape object</translation>
+ </message>
+ <message>
+ <source>TOP_SMOOTHINGSURFACE</source>
+ <translation>Smoothing Surface</translation>
+ </message>
+ <message>
+ <source>MEN_SMOOTHINGSURFACE</source>
+ <translation>Smoothing Surface</translation>
+ </message>
+ <message>
+ <source>STB_SMOOTHINGSURFACE</source>
+ <translation>Smoothing Surface</translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_MAIN_PIPE</source>
+ <translation>Main pipe half length</translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_INCIDENT_PIPE</source>
+ <translation>Incident pipe half length</translation>
+ </message>
+ <message>
+ <source>CIRCULAR_QUARTER_PIPE</source>
+ <translation>Circular quarter of pipe</translation>
+ </message>
+ <message>
+ <source>THICKNESS</source>
+ <translation>Thickness</translation>
+ </message>
+ <message>
+ <source>FLANGE</source>
+ <translation>Flange</translation>
+ </message>
+ <message>
+ <source>CHAMFER_OR_FILLET</source>
+ <translation>Chamfer or fillet</translation>
+ </message>
+ <message>
+ <source>CHAMFER</source>
+ <translation>Chamfer</translation>
+ </message>
+ <message>
+ <source>FILLET</source>
+ <translation>Fillet</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_1</source>
+ <translation>Junction 1</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_2</source>
+ <translation>Junction 2</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_3</source>
+ <translation>Junction 3</translation>
+ </message>
+ <message>
+ <source>INTERNAL_FACES</source>
+ <translation>Internal faces</translation>
+ </message>
+</context>
+<context>
+ <name>AdvancedGUI_PipeTShapeDlg</name>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TITLE</source>
+ <translation>Pipe TShape Construction</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE</source>
+ <translation>PipeTShape</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_MPIPE</source>
+ <translation>Main pipe</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_R</source>
+ <translation>Radius</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_W</source>
+ <translation>Width</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_L</source>
+ <translation>Half-length</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_IPIPE</source>
+ <translation>Incident pipe</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
+ <translation>Chamfer</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
+ <translation>Height</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
+ <translation>Width</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_FILLET</source>
+ <translation>Fillet</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_HEX</source>
+ <translation>Prepare for hex mesh</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION</source>
+ <translation>Set position</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
+ <translation>Junction P1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
+ <translation>Junction P2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
+ <translation>Junction P3</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
+ <translation>New L1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
+ <translation>New L2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
+ <translation>Left thickness reduction</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
+ <translation>Right thickness reduction</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
+ <translation>Incident pipe thickness reduction</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_R</source>
+ <translation>Radius (r%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_W</source>
+ <translation>Width (w%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
+ <translation>Transition length (ltrans%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
+ <translation>Thin part length (lthin%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
+ <translation>Main parameters</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
+ <translation>Thickness reduction</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPPOS</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
+ <translation>The main pipe radius can't be equal to the left thickness reduction radius (rL)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
+ <translation>The main pipe external radius (Radius + Width) can't be equal to the left thickness reduction external radius (rL + wL)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
+ <translation>The main pipe radius can't be equal to the right thickness reduction radius (rR)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
+ <translation>The main pipe external radius (Radius + Width) can't be equal to the right thickness reduction external radius (rR + wR)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
+ <translation>The incident pipe radius can't be equal to the incident pipe thickness reduction radius (rI)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
+ <translation>The incident pipe external radius (Radius + Width) can't be equal to the incident pipe thickness reduction external radius (rI + wI)</translation>
+ </message>
+</context>
+<context>
+ <name>AdvancedGUI_SmoothingSurfaceDlg</name>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
+ <translation>Smoothing surface Construction</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE</source>
+ <translation>Smoothing surface</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
+ <translation>Result name</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG</source>
+ <translation>Arguments</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
+ <translation>Max nbr of Bezier pieces</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
+ <translation>Max BSpline surface degree</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
+ <translation>3D tolerance of initial approximation</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
+ <translation>No points selected</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>@default</name>
+ <message>
+ <source>GEOM_ADVANCED</source>
+ <translation>Objet géométrique avancé : type %1</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_201</source>
+ <translation>Tuyau en T</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_202</source>
+ <translation>Disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_203</source>
+ <translation>Cylindre prédécoupé</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK</source>
+ <translation>Disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK_TITLE</source>
+ <translation>Construction d'un disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER</source>
+ <translation>Cylinder prédécoupé</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
+ <translation>Construction d'un cylindre prédécoupé</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDCYLINDER</source>
+ <translation>Cylinder prédécoupé</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDCYLINDER</source>
+ <translation>Cylinder prédécoupé</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDCYLINDER</source>
+ <translation>Cylinder prédécoupé</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDDISK</source>
+ <translation>Disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDDISK</source>
+ <translation>Disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDDISK</source>
+ <translation>Disque prédécoupé</translation>
+ </message>
+ <message>
+ <source>TOP_PIPETSHAPE</source>
+ <translation>Créer un tuyau en T</translation>
+ </message>
+ <message>
+ <source>MEN_PIPETSHAPE</source>
+ <translation>Tuyau en T</translation>
+ </message>
+ <message>
+ <source>STB_PIPETSHAPE</source>
+ <translation>Créer un tuyau en T</translation>
+ </message>
+ <message>
+ <source>TOP_SMOOTHINGSURFACE</source>
+ <translation> Ajustement de surface</translation>
+ </message>
+ <message>
+ <source>MEN_SMOOTHINGSURFACE</source>
+ <translation> Ajustement de surface</translation>
+ </message>
+ <message>
+ <source>STB_SMOOTHINGSURFACE</source>
+ <translation> Ajustement de surface</translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_MAIN_PIPE</source>
+ <translation>Demi-longueur du tuyau principal </translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_INCIDENT_PIPE</source>
+ <translation>Demi-longueur du tuyau incident</translation>
+ </message>
+ <message>
+ <source>CIRCULAR_QUARTER_PIPE</source>
+ <translation>Un quart circulaire du tuyau</translation>
+ </message>
+ <message>
+ <source>THICKNESS</source>
+ <translation>Epaisseur</translation>
+ </message>
+ <message>
+ <source>FLANGE</source>
+ <translation>Collerette</translation>
+ </message>
+ <message>
+ <source>CHAMFER_OR_FILLET</source>
+ <translation>Chanfrein ou congé</translation>
+ </message>
+ <message>
+ <source>CHAMFER</source>
+ <translation>Chanfrein</translation>
+ </message>
+ <message>
+ <source>FILLET</source>
+ <translation>Congé</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_1</source>
+ <translation>Jonction 1</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_2</source>
+ <translation>Jonction 2</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_3</source>
+ <translation>Jonction 3</translation>
+ </message>
+ <message>
+ <source>INTERNAL_FACES</source>
+ <translation>Faces internes</translation>
+ </message>
+</context>
+<context>
+ <name>AdvancedGUI_PipeTShapeDlg</name>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TITLE</source>
+ <translation>Construction d'un tuyau en T</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE</source>
+ <translation>Tuyau en T</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_MPIPE</source>
+ <translation>Tuyau principal</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_R</source>
+ <translation>Rayon</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_W</source>
+ <translation>Largeur</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_L</source>
+ <translation>Demi-longueur</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_IPIPE</source>
+ <translation>Tuyau incident</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
+ <translation>Chanfrein</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
+ <translation>Hauteur</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
+ <translation>Largeur</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_FILLET</source>
+ <translation>Congé</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_HEX</source>
+ <translation>Préparer pour un maillage hexaédrique</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION</source>
+ <translation>Définir la position</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
+ <translation>Jonction P1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
+ <translation>Jonction P2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
+ <translation>Jonction P3</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
+ <translation>Nouvelle L1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
+ <translation>Nouvelle L2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
+ <translation>Réduction d'épaisseur à gauche</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
+ <translation>Réduction d'épaisseur à droite</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
+ <translation>Réduction d'épaisseur du tuyau incident</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_R</source>
+ <translation>Rayon (r%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_W</source>
+ <translation>Epaisseur (w%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
+ <translation>Longueur de transition (ltrans%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
+ <translation>Longueur de la partie étroite (lthin%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
+ <translation>Paramètres principaux</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
+ <translation>Réduction d'épaisseur</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPPOS</source>
+ <translation>Position</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
+ <translation>Le rayon du tuyau principal ne peut pas être égal à la réduction d'épaisseur à gauche (rL)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
+ <translation>Le rayon extérieur du tuyau principal (Rayon + épaisseur) ne peut pas être égal au rayon externe de la réduction d'épaisseur à gauche (rL + wL)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
+ <translation>Le rayon du tuyau principal ne peut pas être égal au rayon de la réduction d'épaisseur à droite (rR)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
+ <translation>Le rayon extérieur du tuyau principal (Rayon + épaisseur) ne peut pas être égal au rayon externe de la réduction d'épaisseur à droite (rL + wL)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
+ <translation>Le rayon du tuyau incident ne peut pas être égal au rayon de la réduction d'épaisseur du tuyau incident (rI)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
+ <translation>Le rayon externe du tuyau incident (Rayon + Epaisseur) ne peut pas être égal au rayon extérieur de la réduction du tuyau incident (rI + wI)</translation>
+ </message>
+</context>
+<context>
+ <name>AdvancedGUI_SmoothingSurfaceDlg</name>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
+ <translation>Ajustement de surface sur des points</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE</source>
+ <translation>Ajustement de surface</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
+ <translation>Nom du résultat</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG</source>
+ <translation>Noeuds</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
+ <translation>Nombre max de patchs Bezier</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
+ <translation>Degré max de la surface</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
+ <translation>Tolerance 3D de l'approximation initiale</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
+ <translation>Aucun point sélectionné</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>GEOM_ADVANCED</source>
+ <translation>高度な形状: タイプ %1</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_201</source>
+ <translation>T型パイプ</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_202</source>
+ <translation>カット済みディスク</translation>
+ </message>
+ <message>
+ <source>GEOM_ADVANCED_203</source>
+ <translation>カット シリンダー</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK</source>
+ <translation>Divided_Disk</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDDISK_TITLE</source>
+ <translation>分割ディスクの構築</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER</source>
+ <translation>Divided_Cylinder</translation>
+ </message>
+ <message>
+ <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
+ <translation>分割シリンダの構築</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDCYLINDER</source>
+ <translation>分割シリンダ</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDCYLINDER</source>
+ <translation>分割シリンダ</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDCYLINDER</source>
+ <translation>分割シリンダ</translation>
+ </message>
+ <message>
+ <source>MEN_DIVIDEDDISK</source>
+ <translation>分割ディスク</translation>
+ </message>
+ <message>
+ <source>TOP_DIVIDEDDISK</source>
+ <translation>分割ディスク</translation>
+ </message>
+ <message>
+ <source>STB_DIVIDEDDISK</source>
+ <translation>分割ディスク</translation>
+ </message>
+ <message>
+ <source>TOP_PIPETSHAPE</source>
+ <translation>T型パイプを作成</translation>
+ </message>
+ <message>
+ <source>MEN_PIPETSHAPE</source>
+ <translation>T型パイプを作成</translation>
+ </message>
+ <message>
+ <source>STB_PIPETSHAPE</source>
+ <translation>T型パイプを作成</translation>
+ </message>
+ <message>
+ <source>TOP_SMOOTHINGSURFACE</source>
+ <translation>表面のスムージング</translation>
+ </message>
+ <message>
+ <source>MEN_SMOOTHINGSURFACE</source>
+ <translation>表面の平滑化</translation>
+ </message>
+ <message>
+ <source>STB_SMOOTHINGSURFACE</source>
+ <translation>表面のスムージング</translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_MAIN_PIPE</source>
+ <translation>半分の長さのパイプを作成</translation>
+ </message>
+ <message>
+ <source>HALF_LENGTH_INCIDENT_PIPE</source>
+ <translation>入射管長さ半分</translation>
+ </message>
+ <message>
+ <source>CIRCULAR_QUARTER_PIPE</source>
+ <translation>パイプの1/4形状</translation>
+ </message>
+ <message>
+ <source>THICKNESS</source>
+ <translation>厚み</translation>
+ </message>
+ <message>
+ <source>FLANGE</source>
+ <translation>フランジ</translation>
+ </message>
+ <message>
+ <source>CHAMFER_OR_FILLET</source>
+ <translation>面取り 又は フィレット</translation>
+ </message>
+ <message>
+ <source>CHAMFER</source>
+ <translation>面取り</translation>
+ </message>
+ <message>
+ <source>FILLET</source>
+ <translation>フィレット</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_1</source>
+ <translation>Junction 1</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_2</source>
+ <translation>Junction 2</translation>
+ </message>
+ <message>
+ <source>JUNCTION_FACE_3</source>
+ <translation>Junction 3</translation>
+ </message>
+ <message>
+ <source>INTERNAL_FACES</source>
+ <translation>内部の顔</translation>
+ </message>
+ </context>
+ <context>
+ <name>AdvancedGUI_PipeTShapeDlg</name>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TITLE</source>
+ <translation>T型パイプの作成</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE</source>
+ <translation>PipeTShape</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_MPIPE</source>
+ <translation>メインパイプ</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_R</source>
+ <translation>半径</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_W</source>
+ <translation>幅</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_L</source>
+ <translation>半分の長さ</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_IPIPE</source>
+ <translation>付随パイプ</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
+ <translation>面取り</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
+ <translation>高さ</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
+ <translation>幅</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_FILLET</source>
+ <translation>フィレット</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_HEX</source>
+ <translation>六面体メッシュの準備</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION</source>
+ <translation>位置を設定</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
+ <translation>接続部 P1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
+ <translation>接続部 P2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
+ <translation>接続部 P3</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
+ <translation>New L1</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
+ <translation>New L2</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
+ <translation>左側肉厚変更</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
+ <translation>右側肉厚変更</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
+ <translation>付随パイプ肉厚変更</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_R</source>
+ <translation>半径 (r%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_W</source>
+ <translation>厚み (w%1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
+ <translation>拡張部長さ (ltrans %1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
+ <translation>接続部長さ (lthin %1)</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
+ <translation>メインの設定</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
+ <translation>接続部詳細設定</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_GROUPPOS</source>
+ <translation>位置による設定</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
+ <translation type="unfinished">メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
+ <translation type="unfinished">メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
+ <translation type="unfinished">メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
+ <translation type="unfinished">メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
+ <translation type="unfinished">インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
+ </message>
+ <message>
+ <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
+ <translation type="unfinished">インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
+ </message>
+ </context>
+ <context>
+ <name>AdvancedGUI_SmoothingSurfaceDlg</name>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
+ <translation>滑らかな表面の構造</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE</source>
+ <translation>表面 lissee</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
+ <translation>結果の名前</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG</source>
+ <translation>節点</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
+ <translation>ポイント</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
+ <translation>ベジェパッチの最大数</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
+ <translation>Bスプライン面の最大自由度</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
+ <translation>初期近似の3次元公差</translation>
+ </message>
+ <message>
+ <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
+ <translation>点が選択されていない</translation>
+ </message>
+ </context>
+</TS>
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <GEOMImpl_Types.hxx>
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedCylinderDlg::createOperation()
{
- //return getGeomEngine()->GetIAdvancedOperations(getStudyId());
return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
}
GEOM::GEOM_Object_var anObj;
- GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
+ GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
//@@ retrieve input values from the widgets here @@//
CORBA::Double theR = GroupParams->SpinBox_DX->value();
#include <GEOMBase_Skeleton.h>
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
class DlgRef_2Spin;
class DlgRef_3Radio;
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_DividedDiskDlg::createOperation()
{
- //return getGeomEngine()->GetIAdvancedOperations(getStudyId());
return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
}
GEOM::GEOM_Object_var anObj;
- GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
+ GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
+
CORBA::Double theRatio = 67; // About 2/3
CORBA::Double theR = 0;
#include <GEOMBase_Skeleton.h>
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
class DlgRef_1Spin;
class DlgRef_3Radio;
class DlgRef_2Sel1Spin;
#include "AdvancedGUI_PipeTShapeDlg.h"
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
#include <DlgRef.h>
#include <GeometryGUI.h>
#include <GEOMBase.h>
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_PipeTShapeDlg::createOperation()
{
- //return getGeomEngine()->GetIAdvancedOperations(getStudyId());
return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
}
// GEOM::GEOM_Object_var anObj;
GEOM::ListOfGO_var anObj;
- GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
+ GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
//@@ retrieve input values from the widgets here @@//
CORBA::Double theR1 = MainTubeGroupParams->SpinBox_DX->value();
#include "AdvancedGUI_SmoothingSurfaceDlg.h"
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(AdvancedGEOM)
+
#include <DlgRef.h>
#include <GeometryGUI.h>
#include <GEOMBase.h>
#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <GEOMImpl_Types.hxx>
//=================================================================================
GEOM::GEOM_IOperations_ptr AdvancedGUI_SmoothingSurfaceDlg::createOperation()
{
- //return getGeomEngine()->GetIAdvancedOperations(getStudyId());
return getGeomEngine()->GetPluginOperations(getStudyId(), "AdvancedEngine");
}
GEOM::GEOM_Object_var anObj;
- GEOM::GEOM_IAdvancedOperations_var anOper = GEOM::GEOM_IAdvancedOperations::_narrow(getOperation());
+ GEOM::IAdvancedOperations_var anOper = GEOM::IAdvancedOperations::_narrow(getOperation());
//@@ retrieve input values from the widgets here @@//
GEOM::ListOfGO_var points = new GEOM::ListOfGO();
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
- <context>
- <name>@default</name>
- <message>
- <source>ICON_OBJBROWSER_ADVANCED_201</source>
- <translation>tree_pipetshape.png</translation>
- </message>
- <message>
- <source>ICON_OBJBROWSER_ADVANCED_202</source>
- <translation>divided_disk.png</translation>
- </message>
- <message>
- <source>ICON_OBJBROWSER_ADVANCED_203</source>
- <translation>dividedcylinder.png</translation>
- </message>
- <message>
- <source>ICON_OBJBROWSER_ADVANCED_204</source>
- <translation>tree_smoothingsurface.png</translation>
- </message>
-
- <message>
- <source>ICON_DLG_PIPETSHAPE</source>
- <translation>pipetshape.png</translation>
- </message>
- <message>
- <source>ICO_PIPETSHAPE</source>
- <translation>pipetshape.png</translation>
- </message>
- <message>
- <source>ICO_PIPETSHAPE_IMPORT</source>
- <translation>pipetshape_import_icon.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE</source>
- <translation>dlg_pipetshape.png</translation>
- </message>
- <message>
- <source>IMG_PIPETSHAPE_SECT</source>
- <translation>pipetshape_section.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_L1</source>
- <translation>dlg_pipetshapel1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_R1</source>
- <translation>dlg_pipetshaper1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_W1</source>
- <translation>dlg_pipetshapew1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_L2</source>
- <translation>dlg_pipetshapel2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_R2</source>
- <translation>dlg_pipetshaper2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_W2</source>
- <translation>dlg_pipetshapew2.png</translation>
- </message>
-
- <message>
- <source>DLG_PIPETSHAPE_FILLET</source>
- <translation>dlg_pipetshapefillet.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_L1</source>
- <translation>dlg_pipetshapefilletl1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_R1</source>
- <translation>dlg_pipetshapefilletr1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_W1</source>
- <translation>dlg_pipetshapefilletw1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_L2</source>
- <translation>dlg_pipetshapefilletl2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_R2</source>
- <translation>dlg_pipetshapefilletr2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_W2</source>
- <translation>dlg_pipetshapefilletw2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_FILLET_RF</source>
- <translation>dlg_pipetshapefilletrf.png</translation>
- </message>
-
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER</source>
- <translation>dlg_pipetshapechamfer.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_L1</source>
- <translation>dlg_pipetshapechamferl1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_R1</source>
- <translation>dlg_pipetshapechamferr1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_W1</source>
- <translation>dlg_pipetshapechamferw1.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_L2</source>
- <translation>dlg_pipetshapechamferl2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_R2</source>
- <translation>dlg_pipetshapechamferr2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_W2</source>
- <translation>dlg_pipetshapechamferw2.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_H</source>
- <translation>dlg_pipetshapechamferh.png</translation>
- </message>
- <message>
- <source>DLG_PIPETSHAPE_CHAMFER_W</source>
- <translation>dlg_pipetshapechamferw.png</translation>
- </message>
-
-<!--
- <message>
- <source>ICON_DLG_PIPETSHAPEGROUPS</source>
- <translation>pipetshapegroups.png</translation>
- </message>
- <message>
- <source>ICO_PIPETSHAPEGROUPS</source>
- <translation>pipetshapegroups.png</translation>
- </message>
--->
-
- <message>
- <source>ICON_DLG_DIVIDEDDISK_R_RATIO</source>
- <translation>divided_disk.png</translation>
- </message>
- <message>
- <source>ICO_DIVIDEDDISK</source>
- <translation>divided_disk.png</translation>
- </message>
-
- <message>
- <source>ICON_DLG_DIVIDEDCYLINDER_R_H</source>
- <translation>dividedcylinder_r_h.png</translation>
- </message>
- <message>
- <source>ICO_DIVIDEDCYLINDER</source>
- <translation>dividedcylinder.png</translation>
- </message>
-
- <message>
- <source>ICON_DLG_SMOOTHINGSURFACE_LPOINTS</source>
- <translation>smoothingsurface_lpoints.png</translation>
- </message>
- <message>
- <source>ICO_SMOOTHINGSURFACE</source>
- <translation>smoothingsurface.png</translation>
- </message>
- <!-- @@ insert new functions before this line @@ do not remove this line @@ -->
- </context>
-</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="en_US">
-<context>
- <name>@default</name>
- <message>
- <source>GEOM_ADVANCED</source>
- <translation>Advanced shape: type %1</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_201</source>
- <translation>Pipe TShape</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_202</source>
- <translation>Divided Disk</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_203</source>
- <translation>Divided Cylinder</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK</source>
- <translation>Divided Disk</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK_TITLE</source>
- <translation>Divided Disk construction</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER</source>
- <translation>Divided Cylinder</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
- <translation>Divided Cylinder construction</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDCYLINDER</source>
- <translation>Divided Cylinder</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDCYLINDER</source>
- <translation>Divided Cylinder</translation>
- </message>
- <message>
- <source>STB_DIVIDEDCYLINDER</source>
- <translation>Divided Cylinder</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDDISK</source>
- <translation>Divided Disk</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDDISK</source>
- <translation>Divided Disk</translation>
- </message>
- <message>
- <source>STB_DIVIDEDDISK</source>
- <translation>Divided Disk</translation>
- </message>
- <message>
- <source>TOP_PIPETSHAPE</source>
- <translation>Create Pipe TShape</translation>
- </message>
- <message>
- <source>MEN_PIPETSHAPE</source>
- <translation>Pipe TShape</translation>
- </message>
- <message>
- <source>STB_PIPETSHAPE</source>
- <translation>Create new Pipe TShape object</translation>
- </message>
- <message>
- <source>TOP_SMOOTHINGSURFACE</source>
- <translation>Smoothing Surface</translation>
- </message>
- <message>
- <source>MEN_SMOOTHINGSURFACE</source>
- <translation>Smoothing Surface</translation>
- </message>
- <message>
- <source>STB_SMOOTHINGSURFACE</source>
- <translation>Smoothing Surface</translation>
- </message>
- <message>
- <source>HALF_LENGTH_MAIN_PIPE</source>
- <translation>Main pipe half length</translation>
- </message>
- <message>
- <source>HALF_LENGTH_INCIDENT_PIPE</source>
- <translation>Incident pipe half length</translation>
- </message>
- <message>
- <source>CIRCULAR_QUARTER_PIPE</source>
- <translation>Circular quarter of pipe</translation>
- </message>
- <message>
- <source>THICKNESS</source>
- <translation>Thickness</translation>
- </message>
- <message>
- <source>FLANGE</source>
- <translation>Flange</translation>
- </message>
- <message>
- <source>CHAMFER_OR_FILLET</source>
- <translation>Chamfer or fillet</translation>
- </message>
- <message>
- <source>CHAMFER</source>
- <translation>Chamfer</translation>
- </message>
- <message>
- <source>FILLET</source>
- <translation>Fillet</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_1</source>
- <translation>Junction 1</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_2</source>
- <translation>Junction 2</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_3</source>
- <translation>Junction 3</translation>
- </message>
- <message>
- <source>INTERNAL_FACES</source>
- <translation>Internal faces</translation>
- </message>
-</context>
-<context>
- <name>AdvancedGUI_PipeTShapeDlg</name>
- <message>
- <source>GEOM_PIPE_TSHAPE_TITLE</source>
- <translation>Pipe TShape Construction</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE</source>
- <translation>PipeTShape</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_MPIPE</source>
- <translation>Main pipe</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_R</source>
- <translation>Radius</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_W</source>
- <translation>Width</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_L</source>
- <translation>Half-length</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_IPIPE</source>
- <translation>Incident pipe</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
- <translation>Chamfer</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
- <translation>Height</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
- <translation>Width</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_FILLET</source>
- <translation>Fillet</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_HEX</source>
- <translation>Prepare for hex mesh</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION</source>
- <translation>Set position</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
- <translation>Junction P1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
- <translation>Junction P2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
- <translation>Junction P3</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
- <translation>New L1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
- <translation>New L2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
- <translation>Left thickness reduction</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
- <translation>Right thickness reduction</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
- <translation>Incident pipe thickness reduction</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_R</source>
- <translation>Radius (r%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_W</source>
- <translation>Width (w%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
- <translation>Transition length (ltrans%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
- <translation>Thin part length (lthin%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
- <translation>Main parameters</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
- <translation>Thickness reduction</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPPOS</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
- <translation type="unfinished">Le rayon du tuyau principale ne peut pas être égal à la réduction d'épaisseur à gauche (rL)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
- <translation type="unfinished">Le rayon extérieur du tuyau principal (Rayon + épaisseur) ne peut pas être égal au rayon externe de la réduction d'épaisseur à gauche (rL + wL)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
- <translation type="unfinished">Le rayon du tuyau principal ne peut pas être égal au rayon de la réduction d'épaisseur à droite (rR)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
- <translation type="unfinished">Le rayon extérieur du tuyau principal (Rayon + épaisseur) ne peut pas être égal au rayon externe de la réduction d'épaisseur à droite (rL + wL)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
- <translation type="unfinished">Le rayon du tuyau incident ne peut pas être égal au rayon de la réduction d'épaisseur du tuyau incident (rI)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
- <translation type="unfinished">Le rayon externe du tuyau incident (Rayon + Epaisseur) ne peut pas être égal au rayon extérieur de la réduction du tuyau incident (rI + wI)!</translation>
- </message>
-</context>
-<context>
- <name>AdvancedGUI_SmoothingSurfaceDlg</name>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
- <translation>Smoothing surface Construction</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE</source>
- <translation>Smoothing surface</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
- <translation>Result name</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG</source>
- <translation>Arguments</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
- <translation>Points</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
- <translation>Max nbr of Bezier pieces</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
- <translation>Max BSpline surface degree</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
- <translation>3D tolerance of initial approximation</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
- <translation>No points selected</translation>
- </message>
-</context>
-</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
-<context>
- <name>@default</name>
- <message>
- <source>GEOM_ADVANCED</source>
- <translation>Objet géométrique avancé : type %1</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_201</source>
- <translation>Tuyau en T</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_202</source>
- <translation>Disque prédécoupé</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_203</source>
- <translation>Cylindre prédécoupé</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK</source>
- <translation>Disque prédécoupé</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK_TITLE</source>
- <translation>Construction d'un disque prédécoupé</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER</source>
- <translation>Cylinder prédécoupé</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
- <translation>Construction d'un cylindre prédécoupé</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDCYLINDER</source>
- <translation>Cylinder prédécoupé</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDCYLINDER</source>
- <translation>Cylinder prédécoupé</translation>
- </message>
- <message>
- <source>STB_DIVIDEDCYLINDER</source>
- <translation>Cylinder prédécoupé</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDDISK</source>
- <translation>Disque prédécoupé</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDDISK</source>
- <translation>Disque prédécoupé</translation>
- </message>
- <message>
- <source>STB_DIVIDEDDISK</source>
- <translation>Disque prédécoupé</translation>
- </message>
- <message>
- <source>TOP_PIPETSHAPE</source>
- <translation>Créer un tuyau en T</translation>
- </message>
- <message>
- <source>MEN_PIPETSHAPE</source>
- <translation>Tuyau en T</translation>
- </message>
- <message>
- <source>STB_PIPETSHAPE</source>
- <translation>Créer un tuyau en T</translation>
- </message>
- <message>
- <source>TOP_SMOOTHINGSURFACE</source>
- <translation> Ajustement de surface</translation>
- </message>
- <message>
- <source>MEN_SMOOTHINGSURFACE</source>
- <translation> Ajustement de surface</translation>
- </message>
- <message>
- <source>STB_SMOOTHINGSURFACE</source>
- <translation> Ajustement de surface</translation>
- </message>
- <message>
- <source>HALF_LENGTH_MAIN_PIPE</source>
- <translation>Demi-longueur du tuyau principal </translation>
- </message>
- <message>
- <source>HALF_LENGTH_INCIDENT_PIPE</source>
- <translation>Demi-longueur du tuyau incident</translation>
- </message>
- <message>
- <source>CIRCULAR_QUARTER_PIPE</source>
- <translation>Un quart circulaire du tuyau</translation>
- </message>
- <message>
- <source>THICKNESS</source>
- <translation>Epaisseur</translation>
- </message>
- <message>
- <source>FLANGE</source>
- <translation>Collerette</translation>
- </message>
- <message>
- <source>CHAMFER_OR_FILLET</source>
- <translation>Chanfrein ou congé</translation>
- </message>
- <message>
- <source>CHAMFER</source>
- <translation>Chanfrein</translation>
- </message>
- <message>
- <source>FILLET</source>
- <translation>Congé</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_1</source>
- <translation>Jonction 1</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_2</source>
- <translation>Jonction 2</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_3</source>
- <translation>Jonction 3</translation>
- </message>
- <message>
- <source>INTERNAL_FACES</source>
- <translation>Faces internes</translation>
- </message>
-</context>
-<context>
- <name>AdvancedGUI_PipeTShapeDlg</name>
- <message>
- <source>GEOM_PIPE_TSHAPE_TITLE</source>
- <translation>Construction d'un tuyau en T</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE</source>
- <translation>Tuyau en T</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_MPIPE</source>
- <translation>Tuyau principal</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_R</source>
- <translation>Rayon</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_W</source>
- <translation>Largeur</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_L</source>
- <translation>Demi-longueur</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_IPIPE</source>
- <translation>Tuyau incident</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
- <translation>Chanfrein</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
- <translation>Hauteur</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
- <translation>Largeur</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_FILLET</source>
- <translation>Congé</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_HEX</source>
- <translation>Préparer pour un maillage hexaédrique</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION</source>
- <translation>Définir la position</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
- <translation>Jonction P1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
- <translation>Jonction P2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
- <translation>Jonction P3</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
- <translation>Nouvelle L1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
- <translation>Nouvelle L2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
- <translation>Réduction d'épaisseur à gauche</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
- <translation>Réduction d'épaisseur à droite</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
- <translation>Réduction d'épaisseur du tuyau incident</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_R</source>
- <translation>Rayon (r%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_W</source>
- <translation>Epaisseur (w%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
- <translation>Longueur de transition (ltrans%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
- <translation>Longueur de la partie étroite (lthin%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
- <translation>Paramètres principaux</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
- <translation>Réduction d'épaisseur</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPPOS</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
- <translation type="unfinished">Main pipe Radius can't be equal to Left thickness reduction Radius (rL)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
- <translation type="unfinished">Main pipe external Radius (Radius + Width) can't be equal to Left thickness reduction external Radius (rL + wL)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
- <translation type="unfinished">Main pipe Radius can't be equal to Right thickness reduction Radius (rR)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
- <translation type="unfinished">Main pipe external Radius (Radius + Width) can't be equal to Right thickness reduction external Radius (rR + wR)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
- <translation type="unfinished">Incident pipe Radius can't be equal to Incident pipe thickness reduction Radius (rI)!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
- <translation type="unfinished">Incident pipe external Radius (Rayon + Epaisseur) can't be equal to Incident pipe thickness reduction external Radius (rI + wI)!</translation>
- </message>
-</context>
-<context>
- <name>AdvancedGUI_SmoothingSurfaceDlg</name>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
- <translation>Ajustement de surface sur des points</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE</source>
- <translation>Ajustement de surface</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
- <translation>Nom du résultat</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG</source>
- <translation>Noeuds</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
- <translation>Points</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
- <translation>Nombre max de patchs Bezier</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
- <translation>Degré max de la surface</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
- <translation>Tolerance 3D de l'approximation initiale</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
- <translation>Aucun point sélectionné</translation>
- </message>
-</context>
-</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="ja" sourcelanguage="en">
- <context>
- <name>@default</name>
- <message>
- <source>GEOM_ADVANCED</source>
- <translation>高度な形状: タイプ %1</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_201</source>
- <translation>T型パイプ</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_202</source>
- <translation>カット済みディスク</translation>
- </message>
- <message>
- <source>GEOM_ADVANCED_203</source>
- <translation>カット シリンダー</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK</source>
- <translation>Divided_Disk</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDDISK_TITLE</source>
- <translation>分割ディスクの構築</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER</source>
- <translation>Divided_Cylinder</translation>
- </message>
- <message>
- <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
- <translation>分割シリンダの構築</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDCYLINDER</source>
- <translation>分割シリンダ</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDCYLINDER</source>
- <translation>分割シリンダ</translation>
- </message>
- <message>
- <source>STB_DIVIDEDCYLINDER</source>
- <translation>分割シリンダ</translation>
- </message>
- <message>
- <source>MEN_DIVIDEDDISK</source>
- <translation>分割ディスク</translation>
- </message>
- <message>
- <source>TOP_DIVIDEDDISK</source>
- <translation>分割ディスク</translation>
- </message>
- <message>
- <source>STB_DIVIDEDDISK</source>
- <translation>分割ディスク</translation>
- </message>
- <message>
- <source>TOP_PIPETSHAPE</source>
- <translation>T型パイプを作成</translation>
- </message>
- <message>
- <source>MEN_PIPETSHAPE</source>
- <translation>T型パイプを作成</translation>
- </message>
- <message>
- <source>STB_PIPETSHAPE</source>
- <translation>T型パイプを作成</translation>
- </message>
- <message>
- <source>TOP_SMOOTHINGSURFACE</source>
- <translation>表面のスムージング</translation>
- </message>
- <message>
- <source>MEN_SMOOTHINGSURFACE</source>
- <translation>表面の平滑化</translation>
- </message>
- <message>
- <source>STB_SMOOTHINGSURFACE</source>
- <translation>表面のスムージング</translation>
- </message>
- <message>
- <source>HALF_LENGTH_MAIN_PIPE</source>
- <translation>半分の長さのパイプを作成</translation>
- </message>
- <message>
- <source>HALF_LENGTH_INCIDENT_PIPE</source>
- <translation>入射管長さ半分</translation>
- </message>
- <message>
- <source>CIRCULAR_QUARTER_PIPE</source>
- <translation>パイプの1/4形状</translation>
- </message>
- <message>
- <source>THICKNESS</source>
- <translation>厚み</translation>
- </message>
- <message>
- <source>FLANGE</source>
- <translation>フランジ</translation>
- </message>
- <message>
- <source>CHAMFER_OR_FILLET</source>
- <translation>面取り 又は フィレット</translation>
- </message>
- <message>
- <source>CHAMFER</source>
- <translation>面取り</translation>
- </message>
- <message>
- <source>FILLET</source>
- <translation>フィレット</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_1</source>
- <translation>Junction 1</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_2</source>
- <translation>Junction 2</translation>
- </message>
- <message>
- <source>JUNCTION_FACE_3</source>
- <translation>Junction 3</translation>
- </message>
- <message>
- <source>INTERNAL_FACES</source>
- <translation>内部の顔</translation>
- </message>
- </context>
- <context>
- <name>AdvancedGUI_PipeTShapeDlg</name>
- <message>
- <source>GEOM_PIPE_TSHAPE_TITLE</source>
- <translation>T型パイプの作成</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE</source>
- <translation>PipeTShape</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_MPIPE</source>
- <translation>メインパイプ</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_R</source>
- <translation>半径</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_W</source>
- <translation>幅</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_L</source>
- <translation>半分の長さ</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_IPIPE</source>
- <translation>付随パイプ</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER</source>
- <translation>面取り</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_H</source>
- <translation>高さ</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_CHAMFER_W</source>
- <translation>幅</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_FILLET</source>
- <translation>フィレット</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_HEX</source>
- <translation>六面体メッシュの準備</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION</source>
- <translation>位置を設定</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P1</source>
- <translation>接続部 P1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P2</source>
- <translation>接続部 P2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_P3</source>
- <translation>接続部 P3</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
- <translation>New L1</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
- <translation>New L2</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
- <translation>左側肉厚変更</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_RIGHT_TR</source>
- <translation>右側肉厚変更</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_INCI_TR</source>
- <translation>付随パイプ肉厚変更</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_R</source>
- <translation>半径 (r%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_W</source>
- <translation>厚み (w%1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_TRANS</source>
- <translation>拡張部長さ (ltrans %1)</translation>
- </message>
- <message>
- <source>GEOM_PIPE_TSHAPE_TR_L_THIN</source>
- <translation>接続部長さ (lthin %1)</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPMAIN</source>
- <translation>メインの設定</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPREDUCT</source>
- <translation>接続部詳細設定</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_GROUPPOS</source>
- <translation>位置による設定</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
- <translation type="unfinished">メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
- <translation type="unfinished">メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
- <translation type="unfinished">メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
- <translation type="unfinished">メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
- <translation type="unfinished">インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
- </message>
- <message>
- <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
- <translation type="unfinished">インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
- </message>
- </context>
- <context>
- <name>AdvancedGUI_SmoothingSurfaceDlg</name>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_TITLE</source>
- <translation>滑らかな表面の構造</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE</source>
- <translation>表面 lissee</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_RESULT</source>
- <translation>結果の名前</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG</source>
- <translation>節点</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_POINTS</source>
- <translation>ポイント</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
- <translation>ベジェパッチの最大数</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
- <translation>Bスプライン面の最大自由度</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_ARG_D_MAX</source>
- <translation>初期近似の3次元公差</translation>
- </message>
- <message>
- <source>GEOM_SMOOTHINGSURFACE_NO_POINTS</source>
- <translation>点が選択されていない</translation>
- </message>
- </context>
-</TS>
${PROJECT_SOURCE_DIR}/src/GEOMImpl
${PROJECT_SOURCE_DIR}/src/GEOMGUI
${PROJECT_SOURCE_DIR}/src/GEOMBase
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
${PROJECT_SOURCE_DIR}/src/DlgRef
+ ${PROJECT_SOURCE_DIR}/src/AdvancedEngine
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
${PROJECT_BINARY_DIR}/src/DlgRef
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
# libraries to link to
SET(_link_LIBRARIES
GEOMBase
+ SalomeIDLAdvancedGEOM
)
# --- resources ---
# resource files / to be processed by lrelease
SET(AdvancedGUI_RESOURCES
- AdvancedGUI_images.ts
- AdvancedGUI_msg_en.ts
- AdvancedGUI_msg_fr.ts
- AdvancedGUI_msg_ja.ts
+ AdvancedGEOM_images.ts
+ AdvancedGEOM_msg_en.ts
+ AdvancedGEOM_msg_fr.ts
+ AdvancedGEOM_msg_ja.ts
)
# --- headers ---
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: BREPExport.cxx
-// Created: Wed May 19 13:10:05 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
-//
-#include "utilities.h"
-
-#include <BRepTools.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-
-#ifdef WIN32
- #if defined BREPEXPORT_EXPORTS || defined BREPExport_EXPORTS
- #define BREPEXPORT_EXPORT __declspec( dllexport )
- #else
- #define BREPEXPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define BREPEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- BREPEXPORT_EXPORT int Export (const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/)
- {
- MESSAGE("Export BREP into file " << theFileName.ToCString());
-
- if ( !BRepTools::Write( theShape, theFileName.ToCString() ) )
- return 0;
-
- return 1;
- }
-}
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKBRep}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(BREPExport_SOURCES
- BREPExport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(BREPExport ${BREPExport_SOURCES})
-TARGET_LINK_LIBRARIES(BREPExport ${_link_LIBRARIES})
-INSTALL(TARGETS BREPExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: BREPImport.cxx
-// Created: Wed May 19 14:29:52 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
-//
-#include "utilities.h"
-
-#include <BRepTools.hxx>
-#include <BRep_Builder.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TDF_Label.hxx>
-
-#ifdef WIN32
- #if defined BREPIMPORT_EXPORTS || defined BREPImport_EXPORTS
- #define BREPIMPORT_EXPORT __declspec( dllexport )
- #else
- #define BREPIMPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define BREPIMPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
-BREPIMPORT_EXPORT
- TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/,
- TCollection_AsciiString& theError,
- const TDF_Label&)
- {
- MESSAGE("Import BREP from file " << theFileName);
- TopoDS_Shape aShape;
- BRep_Builder B;
- BRepTools::Read(aShape, theFileName.ToCString(), B);
- if (aShape.IsNull()) {
- theError = "BREP Import failed";
- }
- return aShape;
- }
-}
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKBRep}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(BREPImport_SOURCES
- BREPImport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(BREPImport ${BREPImport_SOURCES})
-TARGET_LINK_LIBRARIES(BREPImport ${_link_LIBRARIES})
-INSTALL(TARGETS BREPImport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_Engine.hxx"
+#include "BREPPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ BREPPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new BREPPlugin_OperationsCreator();
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPLUGIN_ENGINE_HXX_
+#define _BREPPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined BREPPluginEngine_EXPORTS
+ #define BREPPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define BREPPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define BREPPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_ExportDriver.hxx"
+#include "BREPPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+
+// OOCT includes
+#include <BRepTools.hxx>
+#include <TopoDS_Shape.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& BREPPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("4c1fd92e-bcf3-4695-89b7-a8353038174f");
+ return aGUID;
+}
+
+//=======================================================================
+//function : BREPPlugin_ExportDriver
+//purpose :
+//=======================================================================
+BREPPlugin_ExportDriver::BREPPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer BREPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ BREPPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+
+ MESSAGE("Export BREP into file " << aFileName.ToCString());
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ if ( !BRepTools::Write( aShape, aFileName.ToCString() ) )
+ return 0;
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean BREPPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool BREPPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( BREPPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( BREPPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_ExportDriver_HXX
+#define _BREPPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( BREPPlugin_ExportDriver, GEOM_BaseDriver );
+
+class BREPPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ BREPPlugin_ExportDriver();
+ ~BREPPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( BREPPlugin_ExportDriver )
+};
+
+#endif // _BREPPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_GUI.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(BREPPlugin)
+
+//=======================================================================
+// function : BREPPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+BREPPlugin_GUI::BREPPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~BREPPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+BREPPlugin_GUI::~BREPPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool BREPPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_BREP"; break;
+ case 2:
+ cmd = "Import_BREP"; break;
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool BREPPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if ( theCommandID == "Export_BREP" )
+ {
+ result = exportBREP( parent );
+ }
+ else if ( theCommandID == "Import_BREP" )
+ {
+ result = importBREP( parent );
+ }
+ else
+ {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return result;
+}
+
+//=======================================================================
+// function : importBREP
+// purpose :
+//=======================================================================
+bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
+{
+ 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::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
+ if ( CORBA::is_nil( brepOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "BREP_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+
+ foreach( QString fileName, fileNames )
+ {
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, brepOp.in() );
+
+ 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() );
+
+ entryList.append( so->GetID() );
+ transaction.commit();
+ GEOM_Displayer( study ).Display( main.in() );
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( brepOp->GetErrorCode() ) );
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ }
+ }
+ getGeometryGUI()->updateObjBrowser( true );
+ app->browseObjects( entryList );
+
+ if ( errors.count() > 0 )
+ {
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ }
+ return fileNames.count() > 0;
+}
+
+//=======================================================================
+// function : exportBREP
+// purpose :
+//=======================================================================
+bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent )
+{
+ 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::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
+ if ( CORBA::is_nil( brepOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ QString fileName = app->getFileName( false,
+ QString( io->getName() ),
+ tr( "BREP_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, brepOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ brepOp->ExportBREP( obj, fileName.toUtf8().constData() );
+
+ if ( brepOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( brepOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new BREPPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef BREPPlugin_GUI_H
+#define BREPPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+class BREPPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ BREPPlugin_GUI( GeometryGUI* parent );
+ ~BREPPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importBREP( SUIT_Desktop* );
+ bool exportBREP( SUIT_Desktop* );
+};
+
+#endif // BREPPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_IECallBack.hxx"
+#include "BREPPlugin_IOperations.hxx"
+#include "BREPPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+BREPPlugin_IECallBack::BREPPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+BREPPlugin_IECallBack::~BREPPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool
+BREPPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ aPluginOperations->ExportBREP( theOriginal, theFileName );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+BREPPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ImportBREP( theFileName );
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_IECallBack_HXX_
+#define _BREPPlugin_IECallBack_HXX_
+
+// internal includes
+#include "BREPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class BREPPLUGINENGINE_EXPORT BREPPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ BREPPlugin_IECallBack();
+ ~BREPPlugin_IECallBack();
+
+ bool Export( int theDocId,
+ 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 );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_IExport_HXX_
+#define _BREPPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTBREP_ARG_ORIGINAL 1
+#define EXPORTBREP_ARG_FILENAME 2
+
+class BREPPlugin_IExport
+{
+public:
+ BREPPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTBREP_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTBREP_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTBREP_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTBREP_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _BREPPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_IImport_HXX_
+#define _BREPPlugin_IImport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTBREP_ARG_FILENAME 1
+
+class BREPPlugin_IImport
+{
+public:
+ BREPPlugin_IImport( Handle(GEOM_Function) theFunction)
+ : _func(theFunction) {}
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( IMPORTBREP_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( IMPORTBREP_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _BREPPlugin_IImport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_IOperations.hxx"
+#include "BREPPlugin_ExportDriver.hxx"
+#include "BREPPlugin_ImportDriver.hxx"
+#include "BREPPlugin_IExport.hxx"
+#include "BREPPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "BREPPlugin_IOperations::BREPPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+BREPPlugin_IOperations::~BREPPlugin_IOperations()
+{
+ MESSAGE( "BREPPlugin_IOperations::~BREPPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportBREP
+ * Export a shape to BREP format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ * \param theIsASCII The format of the exported file (ASCII or Binary)
+ * \param theDeflection The deflection of the shape to exported
+ */
+//=============================================================================
+void BREPPlugin_IOperations::ExportBREP( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ 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);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( BREPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != BREPPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ BREPPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportBREP(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\" )";
+
+ SetErrorCode(OK);
+}
+
+//=============================================================================
+/*!
+ * ImportBREP
+ * Import a shape from BREP format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+BREPPlugin_IOperations::ImportBREP( const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theFileName.IsEmpty() ) return NULL;
+
+ //Add a new result object
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+
+ //Add an Import function
+ Handle(GEOM_Function) aFunction =
+ anImported->AddFunction( BREPPlugin_ImportDriver::GetID(), IMPORT_SHAPE);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != BREPPlugin_ImportDriver::GetID()) return NULL;
+
+ //Set parameters
+ BREPPlugin_IImport aCI( aFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Import
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Import driver failed" );
+ return NULL;
+ }
+ aSeq->Append(anImported);
+
+ // Greate material groups.
+ // MakeMaterialGroups( anImported, aSeq );
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ pd << aSeq << " = geompy.ImportBREP(\"" << theFileName.ToCString() << "\" )";
+ SetErrorCode(OK);
+
+ return aSeq;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : BREPPlugin_IOperations.hxx
+
+#ifndef _BREPPlugin_IOperations_HXX_
+#define _BREPPlugin_IOperations_HXX_
+
+// internal includes
+#include "BREPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+
+class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ BREPPlugin_IOperations( GEOM_Engine*, int );
+ ~BREPPlugin_IOperations();
+
+ void ExportBREP( const Handle(GEOM_Object),
+ const TCollection_AsciiString& );
+
+ Handle(TColStd_HSequenceOfTransient) ImportBREP( const TCollection_AsciiString& );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_IOperations_i.hh"
+#include "BREPPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+BREPPlugin_IOperations_i::BREPPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ BREPPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "BREPPlugin_IOperations_i::BREPPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+BREPPlugin_IOperations_i::~BREPPlugin_IOperations_i()
+{
+ MESSAGE( "BREPPlugin_IOperations_i::~BREPPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportBREP
+ * Export a shape to BREP format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ */
+//=============================================================================
+void BREPPlugin_IOperations_i::ExportBREP( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ //Export the shape to the file
+ GetOperations()->ExportBREP( anOriginal, theFileName );
+}
+
+//=============================================================================
+/*!
+ * ImportBREP
+ * Import a shape from BREP format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* BREPPlugin_IOperations_i::ImportBREP( const char* theFileName )
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Import the shape from the file
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportBREP( theFileName );
+
+ if( !GetOperations()->IsDone() || aHSeq.IsNull() )
+ return aSeq._retn();
+
+ // Copy created objects.
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length( aLength );
+ for( Standard_Integer i = 1; i <= aLength; i++ )
+ aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
+
+ return aSeq._retn();
+}
+
+BREPPlugin_IOperations* BREPPlugin_IOperations_i::GetOperations()
+{
+ return (BREPPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_IOperations_i_HeaderFile
+#define _BREPPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( BREPPlugin )
+
+// internal includes
+#include "BREPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class BREPPlugin_IOperations;
+
+class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations_i :
+ public virtual POA_GEOM::IBREPOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ BREPPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ BREPPlugin_IOperations* theImpl );
+ ~BREPPlugin_IOperations_i();
+
+ void ExportBREP( GEOM::GEOM_Object_ptr, const char* );
+ GEOM::ListOfGO* ImportBREP( const char* );
+
+ BREPPlugin_IOperations* GetOperations();
+};
+
+#endif // _BREPPlugin_IOperations_i_HeaderFile
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_ImportDriver.hxx"
+#include "BREPPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+#include "GEOMImpl_Types.hxx"
+
+// OOCT includes
+#include <BRepTools.hxx>
+#include <BRep_Builder.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& BREPPlugin_ImportDriver::GetID()
+{
+ static Standard_GUID aGUID("7e1b28ec-8513-4217-b09c-7652fbe8149e");
+ return aGUID;
+}
+
+//=======================================================================
+//function : BREPPlugin_ImportDriver
+//purpose :
+//=======================================================================
+BREPPlugin_ImportDriver::BREPPlugin_ImportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer BREPPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ BREPPlugin_IImport aData( aFunction );
+
+ TCollection_AsciiString aFileName = aData.GetFileName().ToCString();
+
+ MESSAGE("Import BREP from file " << aFileName);
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ TopoDS_Shape aShape;
+ BRep_Builder B;
+ BRepTools::Read(aShape, aFileName.ToCString(), B);
+ if( aShape.IsNull() ) return 0;
+
+ aFunction->SetValue( aShape );
+
+ log.SetTouched( Label() );
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean BREPPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool BREPPlugin_ImportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction( Label() );
+
+ BREPPlugin_IImport aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "ImportBREP";
+
+ switch ( aType ) {
+ case IMPORT_SHAPE:
+ AddParam( theParams, "File name", aCI.GetFileName() );
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE( BREPPlugin_ImportDriver, GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( BREPPlugin_ImportDriver, GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _BREPPlugin_ImportDriver_HXX
+#define _BREPPlugin_ImportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( BREPPlugin_ImportDriver, GEOM_BaseDriver );
+
+class BREPPlugin_ImportDriver : public GEOM_BaseDriver
+{
+public:
+ BREPPlugin_ImportDriver();
+ ~BREPPlugin_ImportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( BREPPlugin_ImportDriver )
+};
+
+#endif // _BREPPlugin_ImportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "BREPPlugin_OperationsCreator.hxx"
+#include "BREPPlugin_IOperations_i.hh"
+#include "BREPPlugin_IOperations.hxx"
+#include "BREPPlugin_ExportDriver.hxx"
+#include "BREPPlugin_ImportDriver.hxx"
+#include "BREPPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, BREPPlugin_IOperations*> BREPPlugin_OperationsCreator::_mapOfOperations;
+
+BREPPlugin_OperationsCreator::BREPPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( BREPPlugin_ExportDriver::GetID(),
+ new BREPPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( BREPPlugin_ImportDriver::GetID(),
+ new BREPPlugin_ImportDriver() );
+ // Register callback
+ BREPPlugin_IECallBack* callback = new BREPPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "BREP", callback );
+}
+
+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 ) );
+}
+
+BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new BREPPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_BREPPlugin_OperationsCreator_HXX_
+#define _GEOM_BREPPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "BREPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class BREPPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class BREPPLUGINENGINE_EXPORT BREPPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ BREPPlugin_OperationsCreator();
+ ~BREPPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+private:
+ static BREPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, BREPPlugin_IOperations*> _mapOfOperations;
+
+ friend class BREPPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTBREP</source>
+ <translation>BREP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTBREP</source>
+ <translation>Export BREP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTBREP</source>
+ <translation>Export BREP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTBREP</source>
+ <translation>BREP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTBREP</source>
+ <translation>Import BREP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTBREP</source>
+ <translation>Import BREP</translation>
+ </message>
+</context>
+<context>
+ <name>BREPPlugin_GUI</name>
+ <message>
+ <source>BREP_FILES</source>
+ <translation>BREP files( *.brep )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export BREP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import BREP</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTBREP</source>
+ <translation>BREP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTBREP</source>
+ <translation>Exporter BREP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTBREP</source>
+ <translation>Exporter BREP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTBREP</source>
+ <translation>BREP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTBREP</source>
+ <translation>Importer BREP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTBREP</source>
+ <translation>Importer BREP</translation>
+ </message>
+</context>
+<context>
+ <name>BREPPlugin_GUI</name>
+ <message>
+ <source>BREP_FILES</source>
+ <translation>BREP Fichiers( *.brep )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter BREP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer BREP</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTBREP</source>
+ <translation type="unfinished">BREP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTBREP</source>
+ <translation type="unfinished">Export BREP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTBREP</source>
+ <translation type="unfinished">Export BREP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTBREP</source>
+ <translation type="unfinished">BREP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTBREP</source>
+ <translation type="unfinished">Import BREP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTBREP</source>
+ <translation type="unfinished">Import BREP</translation>
+ </message>
+</context>
+<context>
+ <name>BREPPlugin_GUI</name>
+ <message>
+ <source>BREP_FILES</source>
+ <translation type="unfinished">BREP files( *.brep )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export BREP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation type="unfinished">Import BREP</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKBREP}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLBREPPlugin
+ GEOMEngine
+ GEOMClient
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLBREPPlugin
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(BREPPluginEngine_HEADERS
+ BREPPlugin_IOperations_i.hh
+ BREPPlugin_Engine.hxx
+ BREPPlugin_OperationsCreator.hxx
+ BREPPlugin_IOperations.hxx
+ BREPPlugin_IExport.hxx
+ BREPPlugin_IImport.hxx
+ BREPPlugin_ImportDriver.hxx
+ BREPPlugin_ExportDriver.hxx
+ BREPPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ BREPPlugin_GUI.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(BREPPluginGUI_SOURCES
+ BREPPlugin_GUI.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(BREPPluginEngine_SOURCES
+ BREPPlugin_Engine.cxx
+ BREPPlugin_OperationsCreator.cxx
+ BREPPlugin_IOperations_i.cc
+ BREPPlugin_IOperations.cxx
+ BREPPlugin_ExportDriver.cxx
+ BREPPlugin_ImportDriver.cxx
+ BREPPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(BREPPlugin_RESOURCES
+ BREPPlugin_msg_en.ts
+ BREPPlugin_msg_fr.ts
+ BREPPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(BREPPluginEngine ${BREPPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(BREPPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS BREPPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(BREPPluginGUI ${BREPPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(BREPPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS BREPPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${BREPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${BREPPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
#include <TopoDS_Shape.hxx>
#include <ShapeBuild_ReShape.hxx>
-#include <ShapeFix_Edge.hxx>
#include <ShapeFix_Face.hxx>
#include <ShapeFix_Shell.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_Tool.hxx>
-#include <BRepAdaptor_HCompCurve.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
+#include <BRepTools_WireExplorer.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shell.hxx>
-#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
-#include <Approx_Curve3d.hxx>
-
#include <GC_MakeCircle.hxx>
+#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Curve.hxx>
#include <TColGeom2d_Array1OfBSplineCurve.hxx>
#include <TColGeom2d_HArray1OfBSplineCurve.hxx>
#include <TColGeom2d_SequenceOfBoundedCurve.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include "utilities.h"
+
+//=======================================================================
+//function : IsToMerge
+//purpose : This method return Standard_True if two consequent edges can
+// be merged. The edges can be merged if:
+// 1. They belong to same faces.
+// 2. They either both seam or both not seam on each face.
+// 3. They are based on coincident lines, or:
+// 4. They are based on coincident circles, or:
+// 5. They are based on either Bezier of BSplines.
+//=======================================================================
+static Standard_Boolean IsToMerge
+ (const TopoDS_Edge &theEdge1,
+ const TopoDS_Edge &theEdge2,
+ const TopTools_IndexedDataMapOfShapeListOfShape &theMapEdgeFaces,
+ const Standard_Real theTolerance)
+{
+ Standard_Boolean aResult = Standard_False;
+ Standard_Boolean isDegen1 = BRep_Tool::Degenerated(theEdge1);
+ Standard_Boolean isDegen2 = BRep_Tool::Degenerated(theEdge2);
+ Standard_Boolean isCompareGeom = Standard_False;
+
+ if (isDegen1 && isDegen2) {
+ // Both of edges are degenerated.
+ aResult = Standard_True;
+ } else if (!isDegen1 && !isDegen2) {
+ // Both of edges are not degenerated.
+ // Check if they belong to the same faces.
+ Standard_Boolean isSame = Standard_False;
+ Standard_Boolean has1 = theMapEdgeFaces.Contains(theEdge1);
+ Standard_Boolean has2 = theMapEdgeFaces.Contains(theEdge1);
+
+ if (has1 && has2) {
+ const TopTools_ListOfShape &aLst1 = theMapEdgeFaces.FindFromKey(theEdge1);
+ const TopTools_ListOfShape &aLst2 = theMapEdgeFaces.FindFromKey(theEdge2);
+
+ if (aLst1.Extent() == aLst2.Extent()) {
+ TopTools_ListIteratorOfListOfShape anIter1(aLst1);
+
+ isSame = Standard_True;
+
+ for (; anIter1.More(); anIter1.Next()) {
+ TopoDS_Face aFace1 = TopoDS::Face(anIter1.Value());
+ TopTools_ListIteratorOfListOfShape anIter2(aLst2);
+
+ for (; anIter2.More(); anIter2.Next()) {
+ if (aFace1.IsSame(anIter2.Value())) {
+ // Same face is detected. Break the loop.
+ // Check if edges either both seam or both not seam on this face.
+ Standard_Boolean isSeam1 = BRep_Tool::IsClosed(theEdge1, aFace1);
+ Standard_Boolean isSeam2 = BRep_Tool::IsClosed(theEdge2, aFace1);
+
+ isSame = (isSeam1 && isSeam2) || (isSeam1 == isSeam2);
+ break;
+ }
+ }
+
+ if (isSame && !anIter2.More()) {
+ // No same face is detected. Break the loop.
+ isSame = Standard_False;
+ break;
+ }
+ }
+ }
+ } else {
+ isSame = (has1 == has2); // True if the both of has are negative.
+ }
+
+ if (isSame) {
+ // Check edges geometry.
+ Standard_Real aFP1;
+ Standard_Real aFP2;
+ Standard_Real aLP1;
+ Standard_Real aLP2;
+ Handle(Geom_Curve) aC3d1 = BRep_Tool::Curve(theEdge1, aFP1, aLP1);
+ Handle(Geom_Curve) aC3d2 = BRep_Tool::Curve(theEdge2, aFP2, aLP2);
+
+ if (aC3d1.IsNull() == Standard_False &&
+ aC3d2.IsNull() == Standard_False) {
+ // Get the basis curves.
+ while(aC3d1->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
+ Handle(Geom_TrimmedCurve) aTc =
+ Handle(Geom_TrimmedCurve)::DownCast(aC3d1);
+ aC3d1 = aTc->BasisCurve();
+ }
+
+ while(aC3d2->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
+ Handle(Geom_TrimmedCurve) aTc =
+ Handle(Geom_TrimmedCurve)::DownCast(aC3d2);
+ aC3d2 = aTc->BasisCurve();
+ }
+
+ if(aC3d1->IsKind(STANDARD_TYPE(Geom_Line)) &&
+ aC3d2->IsKind(STANDARD_TYPE(Geom_Line))) {
+ // Two curves are lines.
+ Handle(Geom_Line) aL1 = Handle(Geom_Line)::DownCast(aC3d1);
+ Handle(Geom_Line) aL2 = Handle(Geom_Line)::DownCast(aC3d2);
+ gp_Dir aDir1 = aL1->Position().Direction();
+ gp_Dir aDir2 = aL2->Position().Direction();
+
+ if(aDir1.IsParallel(aDir2, theTolerance)) {
+ // Two coincident lines.
+ aResult = Standard_True;
+ }
+ } else if(aC3d1->IsKind(STANDARD_TYPE(Geom_Circle)) &&
+ aC3d2->IsKind(STANDARD_TYPE(Geom_Circle))) {
+ // Two curves are circles.
+ Handle(Geom_Circle) aC1 = Handle(Geom_Circle)::DownCast(aC3d1);
+ Handle(Geom_Circle) aC2 = Handle(Geom_Circle)::DownCast(aC3d2);
+ gp_Pnt aP01 = aC1->Location();
+ gp_Pnt aP02 = aC2->Location();
+
+ if (aP01.Distance(aP02) <= Precision::Confusion()) {
+ // Two coincident circles.
+ aResult = Standard_True;
+ }
+ } else if (aC3d1->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) ||
+ aC3d1->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
+ if (aC3d2->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) ||
+ aC3d2->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
+ // Both of the curves are either bezier or BSplines.
+ aResult = Standard_True;
+ }
+ }
+ }
+ }
+ }
+
+ return aResult;
+}
+
//=======================================================================
//function : BlockFix_UnionEdges()
//purpose : Constructor
return ResEdge;
}
-//=======================================================================
-//function : IsFixed
-//purpose : Returns true if this vertex should be kept in the result.
-//=======================================================================
-static Standard_Boolean IsFixed
- (const TopoDS_Vertex &theVtx,
- const TopoDS_Face &theFace,
- const TopTools_IndexedDataMapOfShapeListOfShape &theMapVtxEdgeOnFace)
-{
- Standard_Boolean aResult = Standard_False;
-
- if (theMapVtxEdgeOnFace.Contains(theVtx)) {
- const TopTools_ListOfShape& aList = theMapVtxEdgeOnFace.FindFromKey(theVtx);
- TopTools_ListIteratorOfListOfShape anIter(aList);
- Standard_Boolean isFirst = Standard_True;
- Standard_Boolean isSeam = Standard_False;
-
- for ( ; anIter.More(); anIter.Next()) {
- TopoDS_Edge anEdge = TopoDS::Edge(anIter.Value());
-
- if (isFirst) {
- // This is the first treated edge.
- isFirst = Standard_False;
- isSeam = BRep_Tool::IsClosed(anEdge, theFace);
- } else if (BRep_Tool::IsClosed(anEdge, theFace)) {
- // Seam edge.
- if (!isSeam) {
- // The previous one was not seam.
- aResult = Standard_True;
- break;
- }
- } else if (isSeam) {
- // This is not a seam edge however the previous one was seam.
- aResult = Standard_True;
- break;
- }
- }
- }
-
- return aResult;
-}
-
//=======================================================================
//function : MergeEdges
//purpose : auxilary
//=======================================================================
static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
- const TopoDS_Face& theFace1,
- const TopoDS_Face& theFace2,
const Standard_Real Tol,
TopoDS_Edge& anEdge)
{
return Standard_False;
}
- // Check if there are vertices that should be kept in the result.
- const Standard_Boolean isClosed = VF.IsSame(VL);
- TopTools_IndexedDataMapOfShapeListOfShape theMapVtxEdge1;
- TopTools_IndexedDataMapOfShapeListOfShape theMapVtxEdge2;
- Standard_Integer jSplit = -1;
-
- TopExp::MapShapesAndAncestors(theFace1, TopAbs_VERTEX, TopAbs_EDGE, theMapVtxEdge1);
- TopExp::MapShapesAndAncestors(theFace2, TopAbs_VERTEX, TopAbs_EDGE, theMapVtxEdge2);
-
- // Check if intermediate vertices should be in the result.
- for(j = 1; j < aChain.Length(); j++) {
- TopoDS_Edge anEdge = TopoDS::Edge(aChain.Value(j));
- TopoDS_Vertex aVtx = sae.LastVertex(anEdge);
-
- if (IsFixed(aVtx, theFace1, theMapVtxEdge1) ||
- IsFixed(aVtx, theFace2, theMapVtxEdge2)) {
- // This vertex should be kept.
- if (jSplit > 0) {
- // There is already split vertex detected.
- // It means that these edges can't be merged.
- MESSAGE ("Two edges on closed contour can't be merged.");
- return Standard_False;
- } else if (isClosed) {
- // This is a closed contour.
- // It is possible to merge it starting from the next edge.
- jSplit = j;
- } else {
- // The contour is not closed, this vertex sould be kept.
- // It means that these edges can't be merged.
- MESSAGE ("Two edges on not closed contour can't be merged.");
- return Standard_False;
- }
- }
- }
-
- if (jSplit > 0) {
- // This is closed contour. Check the last (it is first as well) vertex,
- // as it becomes intermediate after reordering.
- TopoDS_Edge anEdge = TopoDS::Edge(aChain.Last());
- TopoDS_Vertex aVtx = sae.LastVertex(anEdge);
-
- if (IsFixed(aVtx, theFace1, theMapVtxEdge1) ||
- IsFixed(aVtx, theFace2, theMapVtxEdge2)) {
- // This vertex should be kept. So we can't merge this contour.
- MESSAGE ("Two edges on closed contour can't be merged.");
- return Standard_False;
- }
-
- // Reorder edges in the sequence to have jSplit-th edge last.
- for(j = 1; j <= jSplit; j++) {
- aChain.Append(aChain.First());
- aChain.Remove(1);
- }
- }
-
// union edges in chain
// first step: union lines and circles
TopLoc_Location Loc;
B.Add (E,V1); B.Add (E,V2);
B.UpdateVertex(V1, 0., E, 0.);
B.UpdateVertex(V2, dist, E, 0.);
- //ShapeFix_Edge sfe;
- //sfe.FixAddPCurve(E,aFace,Standard_False);
- //sfe.FixSameParameter(E);
aChain.Remove(j);
aChain.SetValue(j,E);
j--;
if(NeedUnion) {
MESSAGE ("can not make analitical union => make approximation");
TopoDS_Edge E = GlueEdgesWithPCurves(aChain, VF, VL);
- /*
- TopoDS_Wire W;
- B.MakeWire(W);
- for(j=1; j<=aChain.Length(); j++) {
- TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
- B.Add(W,edge);
- }
- Handle(BRepAdaptor_HCompCurve) Adapt = new BRepAdaptor_HCompCurve(W);
- Approx_Curve3d Conv(Adapt,Tol,GeomAbs_C1,9,1000);
- Handle(Geom_BSplineCurve) bc = Conv.Curve();
- TopoDS_Edge E;
- B.MakeEdge (E,bc,Precision::Confusion());
- B.Add (E,VF);
- B.Add (E,VL);
- */
aChain.SetValue(1,E);
}
else {
//function : Perform
//purpose :
//=======================================================================
-TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape,
- const Standard_Real Tol)
+TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& theShape,
+ const Standard_Real theTol)
{
- myContext = new ShapeBuild_ReShape;
- myTolerance = Tol;
- TopoDS_Shape aResult = myContext->Apply(Shape);
-
- // processing each solid
- TopAbs_ShapeEnum aType = TopAbs_SOLID;
- TopExp_Explorer exps (Shape, aType);
- if (!exps.More()) {
- aType = TopAbs_SHELL;
- exps.Init(Shape, aType);
- }
- for (; exps.More(); exps.Next()) {
- //TopoDS_Solid aSolid = TopoDS::Solid(exps.Current());
- TopoDS_Shape aSolid = exps.Current();
-
- TopTools_IndexedMapOfShape ChangedFaces;
-
- // creating map of edge faces
- TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
- TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
-
- Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
- TopoDS_Shape aRes = aSolid;
- aRes = aContext->Apply(aSolid);
-
- // processing each face
- TopExp_Explorer exp;
- for (exp.Init(aRes, TopAbs_FACE); exp.More(); exp.Next()) {
- TopoDS_Face aFace =
- TopoDS::Face(aContext->Apply(exp.Current().Oriented(TopAbs_FORWARD)));
- TopTools_IndexedDataMapOfShapeListOfShape aMapFacesEdges;
-
- for (TopExp_Explorer expe(aFace,TopAbs_EDGE); expe.More(); expe.Next()) {
- TopoDS_Edge edge = TopoDS::Edge(expe.Current());
- if (!aMapEdgeFaces.Contains(edge)) continue;
- const TopTools_ListOfShape& aList = aMapEdgeFaces.FindFromKey(edge);
- TopTools_ListIteratorOfListOfShape anIter(aList);
- for ( ; anIter.More(); anIter.Next()) {
- TopoDS_Face face = TopoDS::Face(anIter.Value());
- TopoDS_Face face1 = TopoDS::Face(aContext->Apply(anIter.Value()));
- if (face1.IsSame(aFace)) continue;
- if (aMapFacesEdges.Contains(face)) {
- aMapFacesEdges.ChangeFromKey(face).Append(edge);
- }
- else {
- TopTools_ListOfShape ListEdges;
- ListEdges.Append(edge);
- aMapFacesEdges.Add(face,ListEdges);
- }
+ // Fill Map of edges as keys and list of faces as items.
+ TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
+ Standard_Boolean isModified = Standard_False;
+
+ TopExp::MapShapesAndAncestors
+ (theShape, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
+
+ // processing each face
+ Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
+ TopTools_MapOfShape aProcessed;
+ TopTools_MapOfShape aModifiedFaces;
+ TopExp_Explorer anExpF(theShape, TopAbs_FACE);
+
+ for (; anExpF.More(); anExpF.Next()) {
+ // Processing of each wire of the face
+ TopoDS_Face aFace = TopoDS::Face(anExpF.Current());
+
+ if (!aProcessed.Add(aFace)) {
+ continue;
+ }
+
+ TopExp_Explorer anExpW(aFace, TopAbs_WIRE);
+
+ for (; anExpW.More(); anExpW.Next()) {
+ // Get the ordered list of edges in the wire.
+ TopoDS_Wire aWire = TopoDS::Wire(anExpW.Current());
+ BRepTools_WireExplorer aWExp(aWire, aFace);
+ TopTools_ListOfShape aChainEdges;
+ Standard_Integer aNbEdges = 0;
+
+ for (; aWExp.More(); aWExp.Next(), aNbEdges++) {
+ aChainEdges.Append(aWExp.Current());
+ }
+
+ if (aNbEdges < 2) {
+ // Nothing to merge.
+ continue;
+ }
+
+ // Fill the list of flags that neighbour edges can be merged.
+ TColStd_ListOfInteger aChainCanMerged;
+ TopoDS_Edge anEdge1 = TopoDS::Edge(aChainEdges.Last());
+ TopoDS_Edge anEdge2;
+ Standard_Boolean isToMerge;
+ TopTools_ListIteratorOfListOfShape anIter(aChainEdges);
+ Standard_Boolean isFirstMerge = Standard_False;
+ Standard_Boolean isFirst = Standard_True;
+ Standard_Boolean isReorder = Standard_False;
+
+ // The first element is the flag between last and first edges.
+ for (; anIter.More(); anIter.Next()) {
+ anEdge2 = TopoDS::Edge(anIter.Value());
+
+ if (aProcessed.Contains(anEdge1) || aProcessed.Contains(anEdge2)) {
+ // No need to merge already processed edges.
+ isToMerge = Standard_False;
+ } else {
+ isToMerge = IsToMerge(anEdge1, anEdge2, aMapEdgeFaces, theTol);
+ }
+
+ aChainCanMerged.Append(isToMerge);
+ anEdge1 = anEdge2;
+
+ if (isFirst) {
+ isFirstMerge = isToMerge;
+ isFirst = Standard_False;
+ } else if (isFirstMerge && !isToMerge) {
+ isReorder = Standard_True;
+ }
+ }
+
+ // Fill the map of processed shape by the edges.
+ for (anIter.Initialize(aChainEdges); anIter.More(); anIter.Next()) {
+ aProcessed.Add(anIter.Value());
+ }
+
+ // Reorder edges in the chain.
+ if (isReorder) {
+ // Find the first edge that can't be merged.
+ while (aChainCanMerged.First()) {
+ TopoDS_Shape aTmpShape = aChainEdges.First();
+
+ isToMerge = aChainCanMerged.First();
+ aChainCanMerged.RemoveFirst();
+ aChainCanMerged.Append(isToMerge);
+ aChainEdges.RemoveFirst();
+ aChainEdges.Append(aTmpShape);
}
}
- for (Standard_Integer i=1; i<=aMapFacesEdges.Extent(); i++) {
- const TopTools_ListOfShape& ListEdges = aMapFacesEdges.FindFromIndex(i);
- TopTools_SequenceOfShape SeqEdges;
- TopTools_ListIteratorOfListOfShape anIter(ListEdges);
- for ( ; anIter.More(); anIter.Next()) {
- SeqEdges.Append(anIter.Value());
+ // Merge parts of chain to be merged.
+ TColStd_ListIteratorOfListOfInteger aFlagIter(aChainCanMerged);
+ anIter.Initialize(aChainEdges);
+
+ while (anIter.More()) {
+ TopTools_SequenceOfShape aSeqEdges;
+
+ aSeqEdges.Append(anIter.Value());
+ aFlagIter.Next();
+ anIter.Next();
+
+ for (; anIter.More(); anIter.Next(), aFlagIter.Next()) {
+ if (aFlagIter.Value()) {
+ // Continue the chain.
+ aSeqEdges.Append(anIter.Value());
+ } else {
+ // Stop the chain.
+ break;
+ }
}
- if (SeqEdges.Length()==1) continue;
-
- TopoDS_Face aFace2 =
- TopoDS::Face(aContext->Apply(aMapFacesEdges.FindKey(i)));
- TopoDS_Edge E;
- if ( MergeEdges(SeqEdges,aFace,aFace2,Tol,E) ) {
- // now we have only one edge - aChain.Value(1)
- // we have to replace old ListEdges with this new edge
- aContext->Replace(SeqEdges(1),E);
- for (Standard_Integer j=2; j<=SeqEdges.Length(); j++) {
- aContext->Remove(SeqEdges(j));
+
+ const Standard_Integer aNbEdges = aSeqEdges.Length();
+
+ if (aNbEdges > 1) {
+ // There are several edges to be merged.
+ TopoDS_Edge aMergedEdge;
+
+ if (MergeEdges(aSeqEdges, theTol, aMergedEdge)) {
+ isModified = Standard_True;
+ // now we have only one edge - aMergedEdge.
+ // we have to replace old ListEdges with this new edge
+ const TopoDS_Shape &anEdge = aSeqEdges.Value(1);
+
+ aContext->Replace(anEdge, aMergedEdge);
+
+ for (Standard_Integer j = 2; j <= aNbEdges; j++) {
+ aContext->Remove(aSeqEdges(j));
+ }
+
+ // Fix affected faces.
+ if (aMapEdgeFaces.Contains(anEdge)) {
+ const TopTools_ListOfShape &aList =
+ aMapEdgeFaces.FindFromKey(anEdge);
+ TopTools_ListIteratorOfListOfShape anIter(aList);
+
+ for (; anIter.More(); anIter.Next()) {
+ aModifiedFaces.Add(anIter.Value());
+ }
+ }
}
- TopoDS_Face tmpF = TopoDS::Face(exp.Current());
- if ( !ChangedFaces.Contains(tmpF) )
- ChangedFaces.Add(tmpF);
- tmpF = TopoDS::Face(aMapFacesEdges.FindKey(i));
- if ( !ChangedFaces.Contains(tmpF) )
- ChangedFaces.Add(tmpF);
}
}
+ }
+ }
- } // end processing each face
-
- // fix changed faces and replace them in the local context
- for (Standard_Integer i=1; i<=ChangedFaces.Extent(); i++) {
- TopoDS_Face aFace = TopoDS::Face(aContext->Apply(ChangedFaces.FindKey(i)));
- Handle(ShapeFix_Face) sff = new ShapeFix_Face(aFace);
- sff->SetContext(myContext);
- sff->SetPrecision(myTolerance);
- sff->SetMinTolerance(myTolerance);
- sff->SetMaxTolerance(Max(1.,myTolerance*1000.));
- sff->Perform();
- aContext->Replace(aFace,sff->Face());
+ if (isModified) {
+ // Fix modified faces.
+ TopTools_MapIteratorOfMapOfShape aModifIt(aModifiedFaces);
+
+ for (; aModifIt.More(); aModifIt.Next()) {
+ TopoDS_Face aModifiedFace =
+ TopoDS::Face(aContext->Apply(aModifIt.Key()));
+ Handle(ShapeFix_Face) aSff = new ShapeFix_Face(aModifiedFace);
+
+ aSff->SetContext(aContext);
+ aSff->SetPrecision(theTol);
+ aSff->SetMinTolerance(theTol);
+ aSff->SetMaxTolerance(Max(1., theTol*1000.));
+ aSff->Perform();
+ aContext->Replace(aModifiedFace, aSff->Face());
}
- if (ChangedFaces.Extent() > 0) {
- // fix changed shell and replace it in the local context
- TopoDS_Shape aRes1 = aContext->Apply(aRes);
- TopExp_Explorer expsh;
- for (expsh.Init(aRes1, TopAbs_SHELL); expsh.More(); expsh.Next()) {
- TopoDS_Shell aShell = TopoDS::Shell(expsh.Current());
- Handle(ShapeFix_Shell) sfsh = new ShapeFix_Shell;
- sfsh->FixFaceOrientation(aShell);
- aContext->Replace(aShell,sfsh->Shell());
- }
- TopoDS_Shape aRes2 = aContext->Apply(aRes1);
- // put new solid into global context
- myContext->Replace(aSolid,aRes2);
+ // Check if the result shape contains shells.
+ // If yes, fix the faces orientation in the shell.
+ TopoDS_Shape aModifShape = aContext->Apply(theShape);
+ TopExp_Explorer anExpSh(aModifShape, TopAbs_SHELL);
+
+ for (; anExpSh.More(); anExpSh.Next()) {
+ TopoDS_Shell aShell = TopoDS::Shell(anExpSh.Current());
+ Handle(ShapeFix_Shell) aSfsh = new ShapeFix_Shell;
+
+ aSfsh->FixFaceOrientation(aShell);
+ aContext->Replace(aShell, aSfsh->Shell());
}
+ }
- } // end processing each solid
+ const TopoDS_Shape aResult = aContext->Apply(theShape);
- aResult = myContext->Apply(Shape);
return aResult;
}
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_Edge.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <IntPatch_ImpImpIntersection.hxx>
-#else
-#include <IntPatch_TheIIIntOfIntersection.hxx>
-#endif
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
//=======================================================================
TopoDS_Shape BlockFix_UnionFaces::Perform(const TopoDS_Shape& Shape)
{
- Handle(ShapeBuild_ReShape) myContext = new ShapeBuild_ReShape;
- TopoDS_Shape aResShape = myContext->Apply(Shape);
-
// Fill Map of faces as keys and list of solids or shells as items.
TopTools_IndexedDataMapOfShapeListOfShape aMapFaceSoOrSh;
(Shape, TopAbs_FACE, aType, aMapFaceSoOrSh);
// processing each solid
+ Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
+ TopTools_MapOfShape aProcessed;
TopExp_Explorer exps;
for (exps.Init(Shape, aType); exps.More(); exps.Next()) {
TopoDS_Shape aSoOrSh = exps.Current();
TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
TopExp::MapShapesAndAncestors(aSoOrSh, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
- // map of processed shapes
- TopTools_MapOfShape aProcessed;
-
- Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
-
Standard_Integer NbModif = 0;
Standard_Boolean hasFailed = Standard_False;
Standard_Real tol = Min(Max(Precision::Confusion(), myTolerance/10.), 0.1);
for (exp.Init(aSoOrSh, TopAbs_FACE); exp.More() && doUnion; exp.Next()) {
TopoDS_Face aFace = TopoDS::Face(exp.Current().Oriented(TopAbs_FORWARD));
- if (aProcessed.Contains(aFace))
+ if (aProcessed.Contains(aFace)) {
continue;
+ }
Standard_Integer dummy;
TopTools_SequenceOfShape edges;
TopLoc_Location aBaseLocation;
Handle(Geom_Surface) aBaseSurface = BRep_Tool::Surface(aFace,aBaseLocation);
aBaseSurface = ClearRts(aBaseSurface);
+ aBaseSurface = Handle(Geom_Surface)::DownCast(aBaseSurface->Copy());
// find adjacent faces to union
Standard_Integer i;
// sorting any type of edges
aWire = TopoDS::Wire(aContext->Apply(aWire));
- TopoDS_Face tmpF = TopoDS::Face(aContext->Apply(faces(1).Oriented(TopAbs_FORWARD)));
- Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire(aWire,tmpF,Precision::Confusion());
+ Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire(aWire,aResult,Precision::Confusion());
sfw->FixReorder();
Standard_Boolean isDegRemoved = Standard_False;
if(!sfw->StatusReorder ( ShapeExtend_FAIL )) {
Standard_Real f,l;
//smh protection on NULL pcurve
Handle(Geom2d_Curve) c2d;
- if(!sae.PCurve(sbwd->Edge(j),tmpF,c2d,f,l)) {
+ if(!sae.PCurve(sbwd->Edge(j),aResult,c2d,f,l)) {
aLastEdge--;
continue;
}
gp_XY aVec = anEnd-aStart;
Handle(Geom2d_Line) aLine = new Geom2d_Line(aStart,gp_Dir2d(anEnd-aStart));
- B.UpdateEdge(E,aLine,tmpF,0.);
- B.Range(E,tmpF,0.,aVec.Modulus());
+ B.UpdateEdge(E,aLine,aResult,0.);
+ B.Range(E,aResult,0.,aVec.Modulus());
Handle(Geom_Curve) C3d;
B.UpdateEdge(E,C3d,0.);
B.Degenerated(E,Standard_True);
// ptv add fix same parameter
sfe.FixSameParameter(E, myTolerance);
}
-
- myContext->Replace(aSoOrSh, aResult);
}
- //else
- {
- for (exp.Init(aSoOrSh, TopAbs_FACE); exp.More(); exp.Next()) {
- TopoDS_Face aFace = TopoDS::Face(exp.Current().Oriented(TopAbs_FORWARD));
- Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
- sfw->SetContext(myContext);
- sfw->SetPrecision(myTolerance);
- sfw->SetMinTolerance(myTolerance);
- sfw->SetMaxTolerance(Max(1.,myTolerance*1000.));
- sfw->SetFace(aFace);
- for (TopoDS_Iterator iter (aFace,Standard_False); iter.More(); iter.Next()) {
- TopoDS_Wire wire = TopoDS::Wire(iter.Value());
- sfw->Load(wire);
- sfw->FixReorder();
- sfw->FixShifted();
- }
+
+ for (exp.Init(aSoOrSh, TopAbs_FACE); exp.More(); exp.Next()) {
+ TopoDS_Face aFace = TopoDS::Face(exp.Current().Oriented(TopAbs_FORWARD));
+ Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
+ sfw->SetContext(aContext);
+ sfw->SetPrecision(myTolerance);
+ sfw->SetMinTolerance(myTolerance);
+ sfw->SetMaxTolerance(Max(1.,myTolerance*1000.));
+ sfw->SetFace(aFace);
+ for (TopoDS_Iterator iter (aFace,Standard_False); iter.More(); iter.Next()) {
+ TopoDS_Wire wire = TopoDS::Wire(iter.Value());
+ sfw->Load(wire);
+ sfw->FixReorder();
+ sfw->FixShifted();
}
}
} // end processing each solid
- aResShape = myContext->Apply(Shape);
+ const TopoDS_Shape aResShape = aContext->Apply(Shape);
+
return aResShape;
}
Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
IntPatch_ImpImpIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec);
-#else
- IntPatch_TheIIIntOfIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec);
-#endif
+
if (!anIIInt.IsDone() || anIIInt.IsEmpty())
return false;
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <OCCViewer_ViewModel.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
//=================================================================================
// class : BlocksGUI_ExplodeDlg()
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
// VSR 22/08/2012: issue 0021787: remove "Preview" button from BOP and Partition operations
// Comment next line to enable preview in BOP dialog box
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
# Common packages
##
SET(SUBDIRS_COMMON
- ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM BREPExport
- BREPImport IGESExport IGESImport STEPExport STEPImport STLExport STLImport
- ShHealOper GEOMUtils XAO XAO_Swig GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
- AdvancedEngine OCC2VTK VTKExport
+ ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig
+ GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
+ AdvancedEngine OCC2VTK
+ STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin
)
-##
-# Curve creator
-##
-IF(SALOME_GEOM_BUILD_CC)
- SET(SUBDIRS_CC
- CurveCreator
- )
-ENDIF()
-
##
# OPENCV
##
IF(SALOME_BUILD_GUI)
SET(SUBDIRS_GUI
OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
- GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
- EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
- RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI ImportExportGUI
+ GEOMBase DependencyTree GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
+ CurveCreator EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
+ RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI
GEOM_SWIG_WITHIHM
)
ENDIF()
# header files / to be processed by moc
SET(_moc_HEADERS
CurveCreator_NewSectionDlg.h
- CurveCreator_NewPointDlg.h
+ CurveCreator_TableView.h
CurveCreator_TreeView.h
-# CurveCreator_UndoOptsDlg.h
CurveCreator_Widget.h
)
ENDIF(SALOME_BUILD_GUI)
SET(_other_HEADERS
CurveCreator.hxx
CurveCreator_Curve.hxx
- CurveCreator_CurveEditor.hxx
CurveCreator_Diff.hxx
+ CurveCreator_Displayer.hxx
CurveCreator_ICurve.hxx
- CurveCreator_Listener.hxx
CurveCreator_Macro.hxx
CurveCreator_Operation.hxx
+ CurveCreator_PosPoint.hxx
CurveCreator_Section.hxx
+ CurveCreator_UtilsICurve.hxx
+ CurveCreator_Utils.hxx
)
# header files / to install
# sources / static
SET(_other_SOURCES
CurveCreator_Curve.cxx
- CurveCreator_CurveEditor.cxx
CurveCreator_Diff.cxx
- CurveCreator_ICurve.cxx
+ CurveCreator_Displayer.cxx
CurveCreator_Operation.cxx
+ CurveCreator_Utils.cxx
+ CurveCreator_UtilsICurve.cxx
)
IF(SALOME_BUILD_GUI)
LIST(APPEND _other_SOURCES
- CurveCreator_NewPointDlg.cxx
CurveCreator_NewSectionDlg.cxx
+ CurveCreator_TableView.cxx
CurveCreator_TreeView.cxx
-# CurveCreator_UndoOptsDlg.cxx
CurveCreator_Widget.cxx
)
ENDIF(SALOME_BUILD_GUI)
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#define _CurveCreator_HeaderFile
#include <deque>
+#include <map>
+#include <list>
+
+struct CurveCreator_Section;
+struct CurveCreator_PosPoint;
namespace CurveCreator
{
-
- //! Dimension of the curve
- enum Dimension
- {
- Dim2d = 2,
- Dim3d = 3
- };
-
- //! Type of the section
- enum Type
- {
- Polyline,
- BSpline
- };
-
//! Points coordinates
typedef float TypeCoord;
+ /** List of coordinates in format depends on section dimension:
+ * 2D: [x1, y1, x2, y2, x3, y3, ..]
+ * 3D: [x1, y1, z1, x2, y2, z2, x3, y3, z3, ..]
+ */
typedef std::deque<TypeCoord> Coordinates;
+ //! List of sections
+ typedef std::deque<CurveCreator_Section *> Sections;
+
+ // List of positioned points (points with coordinates)
+ typedef std::list<CurveCreator_PosPoint*> PosPointsList;
+ //! Map of sections with positioned points
+ typedef std::map<int,PosPointsList> SectionsMap;
};
#endif
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Author: Sergey KHROMOV
#include "CurveCreator_Curve.hxx"
+
+#include "CurveCreator.hxx"
+#include "CurveCreator_PosPoint.hxx"
#include "CurveCreator_Section.hxx"
-#include "CurveCreator_Listener.hxx"
+#include "CurveCreator_Displayer.hxx"
+#include "CurveCreator_Utils.hxx"
+
+#include <AIS_Shape.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <Geom_CartesianPoint.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Lin.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Wire.hxx>
#include <stdio.h>
// function: Constructor
// purpose:
//=======================================================================
-CurveCreator_Curve::CurveCreator_Curve
- (const CurveCreator::Dimension theDimension)
-: CurveCreator_ICurve(theDimension)
+CurveCreator_Curve::CurveCreator_Curve( const CurveCreator::Dimension theDimension )
+: myIsLocked (false),
+ myDimension (theDimension),
+ myDisplayer (NULL),
+ myAISShape (NULL),
+ myNbUndos (0),
+ myNbRedos (0),
+ myUndoDepth (-1),
+ myOpLevel(0),
+ mySkipSorting(false)
+{
+}
+
+//=======================================================================
+// function: Destructor
+// purpose:
+//=======================================================================
+CurveCreator_Curve::~CurveCreator_Curve()
+{
+ // Delete all allocated data.
+ clear();
+}
+
+//=======================================================================
+// function: getDimension
+// purpose:
+//=======================================================================
+CurveCreator::Dimension CurveCreator_Curve::getDimension() const
+{
+ return myDimension;
+}
+
+//=======================================================================
+// function: getUniqSectionName
+// purpose: return unique section name
+//=======================================================================
+std::string CurveCreator_Curve::getUniqSectionName() const
+{
+ CurveCreator_Section* aSection;
+ for( int i = 0 ; i < 1000000 ; i++ ){
+ char aBuffer[255];
+ sprintf( aBuffer, "Section_%d", i+1 );
+ std::string aName(aBuffer);
+ int j;
+ for( j = 0 ; j < mySections.size() ; j++ ){
+ aSection = getSection( j );
+ if ( aSection && aSection->myName == aName )
+ break;
+ }
+ if( j == mySections.size() )
+ return aName;
+ }
+ return "";
+}
+
+//=======================================================================
+// function: setDisplayer
+// purpose: set curve changes Displayer
+//=======================================================================
+void CurveCreator_Curve::setDisplayer( CurveCreator_Displayer* theDisplayer )
+{
+ myDisplayer = theDisplayer;
+}
+
+//=======================================================================
+// function: getDisplayer
+// purpose: get curve changes Displayer
+//=======================================================================
+CurveCreator_Displayer* CurveCreator_Curve::getDisplayer()
+{
+ return myDisplayer;
+}
+
+//=======================================================================
+// function: removeDisplayer
+// purpose: remove the attached Displayer
+//=======================================================================
+void CurveCreator_Curve::removeDisplayer()
{
+ myDisplayer = NULL;
}
//=======================================================================
-// function: addPoints
+// function: addDiff
// purpose:
//=======================================================================
-void CurveCreator_Curve::addPoints
- (const CurveCreator::Coordinates &thePoints, const int theISection)
+bool CurveCreator_Curve::addEmptyDiff()
+{
+ bool isEnabled = false;
+
+ if (myUndoDepth != 0) {
+ // Forget all Redos after the current one.
+ if (myNbRedos > 0) {
+ myNbRedos = 0;
+ myListDiffs.erase(myCurrenPos, myListDiffs.end());
+ }
+
+ if (myUndoDepth == -1 || myNbUndos < myUndoDepth) {
+ // Increase the number of undos.
+ myNbUndos++;
+ } else {
+ // If there are too many differences, remove the first one.
+ myListDiffs.pop_front();
+ }
+
+ // Add new difference.
+ myListDiffs.push_back(CurveCreator_Diff());
+ myCurrenPos = myListDiffs.end();
+ isEnabled = true;
+ }
+
+ return isEnabled;
+}
+
+void CurveCreator_Curve::startOperation()
+{
+ myOpLevel++;
+}
+
+void CurveCreator_Curve::finishOperation()
+{
+ myOpLevel--;
+}
+
+//=======================================================================
+// function: toICoord
+// purpose:
+//=======================================================================
+int CurveCreator_Curve::toICoord(const int theIPnt) const
+{
+ return theIPnt * myDimension;
+}
+
+//=======================================================================
+// function: setUndoDepth
+// purpose:
+//=======================================================================
+void CurveCreator_Curve::setUndoDepth(const int theDepth)
+{
+ if (theDepth == 0) {
+ // Reset all undo/redo data.
+ myNbUndos = 0;
+ myNbRedos = 0;
+ myListDiffs.clear();
+ myCurrenPos = myListDiffs.end();
+ myUndoDepth = 0;
+ } else if (theDepth == -1) {
+ // There is nothing to do as the depth become unlimited.
+ myUndoDepth = -1;
+ } else if (theDepth > 0) {
+ // The new "real" depth is set.
+ if (theDepth < myNbRedos) {
+ // The new depth is less then number of redos. Remove the latest redos.
+ int aShift = (myNbRedos - theDepth);
+ ListDiff::iterator aFromPos = myListDiffs.end();
+
+ while (aShift--) {
+ aFromPos--;
+ }
+
+ myListDiffs.erase(aFromPos, myListDiffs.end());
+ myNbRedos = theDepth;
+ }
+
+ if (theDepth < myNbUndos + myNbRedos) {
+ // The new depth is less then the total number of differences.
+ // Remove the first undos.
+ int aShift = (myNbUndos + myNbRedos - theDepth);
+ ListDiff::iterator aToPos = myListDiffs.begin();
+
+ while (aShift--) {
+ aToPos++;
+ }
+
+ myListDiffs.erase(myListDiffs.begin(), aToPos);
+ myNbUndos = theDepth - myNbRedos;
+ }
+
+ myUndoDepth = theDepth;
+ }
+}
+
+//=======================================================================
+// function: getUndoDepth
+// purpose:
+//=======================================================================
+int CurveCreator_Curve::getUndoDepth() const
+{
+ return myUndoDepth;
+}
+
+void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double& theX, double& theY, double& theZ ) const
+{
+ CurveCreator::Coordinates aCoords = getPoint( theISection, theIPoint );
+ theX = aCoords[0];
+ theY = aCoords[1];
+ theZ = 0.;
+ if( getDimension() == CurveCreator::Dim3d ){
+ theZ = aCoords[2];
+ }
+}
+
+void CurveCreator_Curve::redisplayCurve()
+{
+ if( myDisplayer ) {
+ myDisplayer->eraseAll( false );
+ myAISShape = NULL;
+
+ myDisplayer->display( getAISObject( true ), true );
+ }
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::moveSectionInternal(const int theISection,
+ const int theNewIndex)
+{
+ bool res = false;
+ int aMovedSectionId = theISection >= 0 ? theISection : mySections.size()-1;
+
+ if (aMovedSectionId != theNewIndex) {
+ CurveCreator_Section* aSection = getSection( aMovedSectionId );
+
+ // Remove section
+ CurveCreator::Sections::iterator anIter = mySections.begin() + aMovedSectionId;
+
+ mySections.erase(anIter);
+
+ // Insert section.
+ anIter = mySections.begin() + theNewIndex;
+ mySections.insert(anIter, aSection);
+ res = true;
+ }
+ return res;
+}
+
+//=======================================================================
+// function: moveSection
+// purpose:
+//=======================================================================
+bool CurveCreator_Curve::moveSection(const int theISection,
+ const int theNewIndex)
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::MoveSection,
+ theISection, theNewIndex);
+ }
+
+ // Update the curve.
+ res = moveSectionInternal(theISection, theNewIndex);
+ finishOperation();
+ return res;
+}
+
+/************ Implementation of INTERFACE methods ************/
+
+/***********************************************/
+/*** Undo/Redo methods ***/
+/***********************************************/
+
+//! Get number of available undo operations
+int CurveCreator_Curve::getNbUndo() const
+{
+ return myNbUndos;
+}
+
+//! Undo previous operation
+bool CurveCreator_Curve::undo()
+{
+ bool res = false;
+ if (myNbUndos > 0) {
+ myNbUndos--;
+ myNbRedos++;
+ myCurrenPos--;
+ myCurrenPos->applyUndo(this);
+ res = true;
+ }
+ return res;
+}
+
+//! Get number of available redo operations
+int CurveCreator_Curve::getNbRedo() const
+{
+ return myNbRedos;
+}
+
+//! Redo last previously "undone" operation
+bool CurveCreator_Curve::redo()
+{
+ bool res = false;
+ if (myNbRedos > 0) {
+ myCurrenPos->applyRedo(this);
+ myCurrenPos++;
+ myNbRedos--;
+ myNbUndos++;
+ res = true;
+ }
+ return res;
+}
+
+/***********************************************/
+/*** Section methods ***/
+/***********************************************/
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::clearInternal()
+{
+ // erase curve from the viewer
+ if( myDisplayer ) {
+ myDisplayer->eraseAll( true );
+ myAISShape = NULL;
+ }
+ // Delete all allocated data.
+ int i = 0;
+ const int aNbSections = getNbSections();
+
+ CurveCreator_Section* aSection;
+ for (; i < aNbSections; i++) {
+ aSection = getSection( i );
+ if ( aSection )
+ delete aSection;
+ }
+
+ mySections.clear();
+
+ return true;
+}
+
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+bool CurveCreator_Curve::clear()
+{
+ bool res = false;
+ startOperation();
+ // Set the difference.
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this);
+ }
+ res = clearInternal();
+ finishOperation();
+ return res;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
+{
+ bool res = false;
+ if ( theSections.empty() )
+ return res;
+
+ int anISectionMain = theSections.front();
+ CurveCreator_Section* aSectionMain = getSection( anISectionMain );
+
+ std::list <int> aSectionsToJoin = theSections;
+ aSectionsToJoin.erase( aSectionsToJoin.begin() ); // skip the main section
+ // it is important to sort and reverse the section ids in order to correctly remove them
+ aSectionsToJoin.sort();
+ aSectionsToJoin.reverse();
+
+ std::list<int>::const_iterator anIt = aSectionsToJoin.begin(), aLast = aSectionsToJoin.end();
+ CurveCreator_Section* aSection;
+ for (; anIt != aLast; anIt++) {
+ aSection = getSection( *anIt );
+ aSectionMain->myPoints.insert(aSectionMain->myPoints.end(), aSection->myPoints.begin(),
+ aSection->myPoints.end());
+ res = removeSectionInternal(*anIt);
+ if ( !res )
+ break;
+ }
+
+ redisplayCurve();
+ return res;
+}
+
+bool CurveCreator_Curve::join( const std::list<int>& theSections )
+{
+ bool res = false;
+
+ if ( !theSections.empty() )
+ {
+ startOperation();
+ if (addEmptyDiff())
+ myListDiffs.back().init(this, CurveCreator_Operation::Join, theSections);
+
+ res = joinInternal( theSections );
+
+ finishOperation();
+ }
+ return res;
+}
+
+//! Get number of sections
+int CurveCreator_Curve::getNbSections() const
+{
+ return mySections.size();
+}
+
+//! For internal use only! Undo/Redo are not used here.
+int CurveCreator_Curve::addSectionInternal
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed, const CurveCreator::Coordinates &thePoints)
+{
+ CurveCreator_Section *aSection = new CurveCreator_Section;
+
+ std::string aName = theName;
+ if( aName.empty() ){
+ aName = getUniqSectionName();
+ }
+ aSection->myName = aName;
+ aSection->myType = theType;
+ aSection->myIsClosed = theIsClosed;
+ aSection->myPoints = thePoints;
+ mySections.push_back(aSection);
+ redisplayCurve();
+ return mySections.size()-1;
+}
+
+//=======================================================================
+// function: addSection
+// purpose: adds an empty section
+//=======================================================================
+int CurveCreator_Curve::addSection
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed)
+{
+ int resISection = -1;
+ // Set the difference.
+ startOperation();
+ CurveCreator::Coordinates aCoords; //empty list
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
+ theName, aCoords, theType, theIsClosed);
+ }
+
+ resISection = addSectionInternal(theName, theType, theIsClosed, aCoords);
+
+ finishOperation();
+ return resISection;
+}
+//=======================================================================
+// function: addSection
+// purpose: adds a section with the given points
+//=======================================================================
+int CurveCreator_Curve::addSection
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed, const CurveCreator::Coordinates &thePoints)
+{
+ int resISection = -1;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
+ theName, thePoints, theType, theIsClosed);
+ }
+
+ resISection = addSectionInternal(theName, theType, theIsClosed, thePoints);
+
+ finishOperation();
+ return resISection;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::removeSectionInternal( const int theISection )
+{
+ if (theISection == -1) {
+ delete mySections.back();
+ mySections.pop_back();
+ } else {
+ CurveCreator::Sections::iterator anIterRm = mySections.begin() + theISection;
+
+ delete *anIterRm;
+ mySections.erase(anIterRm);
+ }
+ redisplayCurve();
+ return true;
+}
+
+//! Removes the given sections.
+bool CurveCreator_Curve::removeSection( const int theISection )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff())
+ myListDiffs.back().init(this, CurveCreator_Operation::RemoveSection, theISection);
+
+ res = removeSectionInternal( theISection );
+
+ finishOperation();
+ return res;
+}
+
+/**
+ * Get number of points in specified section or (the total number of points
+ * in Curve if theISection is equal to -1).
+ */
+int CurveCreator_Curve::getNbPoints( const int theISection ) const
+{
+ int aNbCoords = 0;
+
+ CurveCreator_Section* aSection;
+ if (theISection == -1) {
+ int i = 0;
+ const int aNbSections = getNbSections();
+
+ for (; i < aNbSections; i++) {
+ aSection = getSection( i );
+ if ( aSection )
+ aNbCoords += aSection->myPoints.size();
+ }
+ } else {
+ aSection = getSection( theISection );
+ if ( aSection )
+ aNbCoords = aSection->myPoints.size();
+ }
+
+ return aNbCoords/myDimension;
+}
+
+void CurveCreator_Curve::setSkipSorting( const bool theIsToSkip )
+{
+ mySkipSorting = theIsToSkip;
+}
+
+bool CurveCreator_Curve::canPointsBeSorted()
+{
+ return false;
+}
+
+/**
+ * Saves points coordinates difference.
+ * \param theOldCoords the old points coordinates
+ */
+void CurveCreator_Curve::saveCoordDiff( const SectionToPointCoordsList &theOldCoords )
+{
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, theOldCoords);
+ }
+ finishOperation();
+}
+
+//! Get "closed" flag of the specified section
+bool CurveCreator_Curve::isClosed( const int theISection ) const
+{
+ CurveCreator_Section* aSection = getSection( theISection );
+ return aSection ? aSection->myIsClosed : false;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setClosedInternal( const int theISection,
+ const bool theIsClosed )
+{
+ CurveCreator_Section* aSection = 0;
+ if (theISection == -1) {
+ int aSize = mySections.size();
+ int i;
+
+ for (i = 0; i < aSize; i++) {
+ aSection = getSection( i );
+ if( aSection ) {
+ aSection->myIsClosed = theIsClosed;
+ redisplayCurve();
+ }
+ }
+ } else {
+ aSection = getSection( theISection );
+ if ( aSection ) {
+ aSection->myIsClosed = theIsClosed;
+ redisplayCurve();
+ }
+ }
+ return true;
+}
+
+/**
+ * Set "closed" flag of the specified section (all sections if
+ * \a theISection is -1).
+ */
+bool CurveCreator_Curve::setClosed( const int theISection,
+ const bool theIsClosed )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetClosed,
+ theIsClosed, theISection);
+ }
+ res = setClosedInternal( theISection, theIsClosed );
+ finishOperation();
+ return res;
+}
+
+//! Returns specified section name
+std::string CurveCreator_Curve::getSectionName( const int theISection ) const
+{
+ CurveCreator_Section* aSection = getSection( theISection );
+ return aSection ? aSection->myName : "";
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setSectionNameInternal( const int theISection,
+ const std::string& theName )
+{
+ bool res = false;
+ CurveCreator_Section* aSection = getSection( theISection );
+ if( aSection ) {
+ aSection->myName = theName;
+ res = true;
+ }
+ return res;
+}
+
+/** Set name of the specified section */
+bool CurveCreator_Curve::setSectionName( const int theISection,
+ const std::string& theName )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::RenameSection,
+ theName, theISection);
+ }
+ res = setSectionNameInternal( theISection, theName );
+ finishOperation();
+ return res;
+}
+
+//! Get type of the specified section
+CurveCreator::SectionType CurveCreator_Curve::getSectionType
+ ( const int theISection ) const
+{
+ CurveCreator_Section* aSection = getSection( theISection );
+ return aSection ? aSection->myType : CurveCreator::Polyline;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setSectionTypeInternal( const int theISection,
+ const CurveCreator::SectionType theType )
+{
+ CurveCreator_Section* aSection;
+ if (theISection == -1) {
+ int i = 0;
+ const int aNbSections = getNbSections();
+
+ for (; i < aNbSections; i++) {
+ aSection = getSection( i );
+ if ( aSection )
+ aSection->myType = theType;
+ }
+ redisplayCurve();
+ } else {
+ aSection = getSection( theISection );
+ if ( aSection && aSection->myType != theType ){
+ aSection->myType = theType;
+ redisplayCurve();
+ }
+ }
+ return true;
+}
+
+/**
+ * Set type of the specified section (or all sections
+ * if \a theISection is -1).
+ */
+bool CurveCreator_Curve::setSectionType( const int theISection,
+ const CurveCreator::SectionType theType )
+{
+ bool res = false;
+ startOperation();
+ // Set the difference.
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetType,
+ theType, theISection);
+ }
+
+ res = setSectionTypeInternal( theISection, theType );
+
+ finishOperation();
+ return res;
+}
+
+
+/***********************************************/
+/*** Point methods ***/
+/***********************************************/
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap )
+{
+ bool res = false;
+ CurveCreator::SectionsMap::const_iterator anIt = theSectionsMap.begin();
+ CurveCreator_Section *aSection = 0;
+ for ( ; anIt != theSectionsMap.end(); anIt++ ) {
+ int anISection = anIt->first;
+ aSection = getSection( anISection );
+ if( aSection ) {
+ CurveCreator::PosPointsList aSectionPoints = anIt->second;
+ CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
+ for( ; aPntIt != aSectionPoints.end(); aPntIt++ ){
+ int anIPnt = (*aPntIt)->myID;
+ CurveCreator::Coordinates aCoords = (*aPntIt)->myCoords;
+ CurveCreator::Coordinates::iterator anIterPosition;
+ if(anIPnt == -1)
+ anIterPosition = aSection->myPoints.end();
+ else
+ anIterPosition = aSection->myPoints.begin() + toICoord(anIPnt);
+ CurveCreator::Coordinates::const_iterator aFirstPosition =
+ aCoords.begin();
+ aSection->myPoints.insert(anIterPosition,
+ aCoords.begin(), aCoords.end());
+ }
+ res = true;
+ }
+ }
+ if(res)
+ redisplayCurve();
+ return res;
+}
+
+/**
+ * Add one point to the specified section starting from the given theIPnt index
+ * (or at the end of points if \a theIPnt is -1).
+ */
+bool CurveCreator_Curve::addPoints( const CurveCreator::Coordinates& theCoords,
+ const int theISection,
+ const int theIPnt )
+{
+ bool res = false;
+ CurveCreator::Coordinates aCoords = theCoords;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ CurveCreator_ICurve::SectionToPointCoordsList aList;
+ aList.push_back(std::make_pair(std::make_pair(theISection, theIPnt), theCoords));
+ myListDiffs.back().init(this, CurveCreator_Operation::InsertPoints,
+ aList);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPoints;
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( theIPnt, theCoords );
+ aPoints.push_back( aPosPoint );
+ aSectionsMap[theISection] = aPoints;
+
+ res = addPointsInternal( aSectionsMap );
+
+ finishOperation();
+ return res;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setPointInternal( const CurveCreator::SectionsMap &theSectionsMap )
+{
+ bool res = false;
+ // Update the curve.
+ CurveCreator::SectionsMap::const_iterator anIt = theSectionsMap.begin();
+ CurveCreator_Section *aSection = 0;
+ for ( ; anIt != theSectionsMap.end(); anIt++ ) {
+ int anISection = anIt->first;
+ aSection = getSection( anISection );
+ if( aSection ) {
+ CurveCreator::PosPointsList aSectionPoints = anIt->second;
+ CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
+ for( ; aPntIt != aSectionPoints.end(); aPntIt++ ){
+ int anIPnt = (*aPntIt)->myID;
+ CurveCreator::Coordinates aCoords = (*aPntIt)->myCoords;
+ for ( int i = 0; i < myDimension; i++)
+ aSection->myPoints.at(toICoord(anIPnt) + i) = aCoords[i];
+ }
+ res = true;
+ }
+ }
+ if(res)
+ redisplayCurve();
+
+ return res;
+}
+
+//! Set coordinates of specified point
+bool CurveCreator_Curve::setPoint( const int theISection,
+ const int theIPnt,
+ const CurveCreator::Coordinates& theNewCoords )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ CurveCreator_ICurve::SectionToPointCoordsList aList;
+ aList.push_back(std::make_pair(std::make_pair(theISection, theIPnt), theNewCoords));
+ myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
+ aList);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPoints;
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( theIPnt, theNewCoords );
+ aPoints.push_back( aPosPoint );
+ aSectionsMap[theISection] = aPoints;
+
+ int aSize1 = getNbPoints( theISection );
+ res = setPointInternal( aSectionsMap );
+ int aSize2 = getNbPoints( theISection );
+
+ finishOperation();
+
+ return res;
+}
+
+//! Set coordinates of specified points from different sections
+bool CurveCreator_Curve::setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
+ const bool theIsToSaveDiff )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (theIsToSaveDiff && addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
+ theSectionToPntCoords);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPosPoints;
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt =
+ theSectionToPntCoords.begin(), aLast = theSectionToPntCoords.end();
+ int aSectionId, aPointId;
+ for ( ; anIt != aLast; anIt++ ) {
+ aPosPoints.clear();
+ aSectionId = anIt->first.first;
+ aPointId = anIt->first.second;
+ CurveCreator::Coordinates aNewCoords = anIt->second;
+ CurveCreator_PosPoint* aPosPoint =
+ new CurveCreator_PosPoint( aPointId, aNewCoords );
+ if( aSectionsMap.find(aSectionId) != aSectionsMap.end() )
+ aPosPoints = aSectionsMap[aSectionId];
+ aPosPoints.push_back( aPosPoint );
+ aSectionsMap[aSectionId] = aPosPoints;
+
+ }
+ res = setPointInternal( aSectionsMap );
+ finishOperation();
+
+ return res;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::removePointsInternal( const SectionToPointList &thePoints )
+{
+ bool aRes = false;
+ std::map<int, std::list<int> > aConvPoints;
+ convert( thePoints, aConvPoints );
+ std::map<int, std::list<int> >::const_iterator anIt = aConvPoints.begin(),
+ aLast = aConvPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ aRes = removeSectionPoints(aSectionId, anIt->second);
+ }
+ if( aRes)
+ redisplayCurve();
+
+ return aRes;
+}
+
+//! Remove point with given id
+bool CurveCreator_Curve::removePoint( const int theISection, const int theIPnt )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ SectionToPointList aListOfSectionsToPoints;
+ aListOfSectionsToPoints.push_back(std::make_pair(theISection, theIPnt));
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::RemovePoints,
+ aListOfSectionsToPoints);
+ }
+ res = removePointsInternal( aListOfSectionsToPoints );
+ finishOperation();
+ return res;
+}
+
+//! Remove several points from different sections with given ids
+bool CurveCreator_Curve::removeSeveralPoints( const SectionToPointList &theSectionToPntIDs)
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::RemovePoints,
+ theSectionToPntIDs);
+ }
+ res = removePointsInternal( theSectionToPntIDs );
+ finishOperation();
+ return res;
+}
+
+ //=======================================================================
+// function: getCoordinates
+// purpose:
+//=======================================================================
+CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
+ const int theIPnt) const
+{
+ CurveCreator_Section* aSection = getSection( theISection );
+ CurveCreator::Coordinates::const_iterator
+ anIter = aSection->myPoints.begin() + toICoord(theIPnt);
+ CurveCreator::Coordinates aResult(anIter, anIter + myDimension);
+
+ return aResult;
+}
+
+//=======================================================================
+// function: getPoints
+// purpose:
+//=======================================================================
+CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection ) const
+{
+ CurveCreator_Section* aSection = getSection( theISection );
+ return aSection ? aSection->myPoints : CurveCreator::Coordinates();
+}
+
+void CurveCreator_Curve::constructAISObject()
+{
+ TopoDS_Shape aShape;
+ CurveCreator_Utils::constructShape( this, aShape );
+
+ myAISShape = new AIS_Shape( aShape );
+}
+
+CurveCreator_Section* CurveCreator_Curve::getSection( const int theSectionId ) const
+{
+ CurveCreator_Section *aSection = 0;
+ if ( theSectionId >= 0 && theSectionId < mySections.size() )
+ aSection = mySections.at( theSectionId );
+
+ return aSection;
+}
+
+Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
+{
+ if ( !myAISShape && theNeedToBuild ) {
+ CurveCreator_Curve* aCurve = (CurveCreator_Curve*)this;
+ aCurve->constructAISObject();
+ }
+ return myAISShape;
+}
+
+bool CurveCreator_Curve::removeSectionPoints( const int theSectionId,
+ const std::list<int>& thePointIds )
+{
+ bool aRes = false;
+
+ CurveCreator_Section* aSection = getSection( theSectionId );
+ if ( !aSection )
+ return aRes;
+
+ std::list<int> aSectionPoints = thePointIds;
+ aSectionPoints.sort();
+ std::list<int>::const_reverse_iterator aPntIt = aSectionPoints.rbegin();
+ for ( ; aPntIt != aSectionPoints.rend(); aPntIt++ ) {
+ int aPntIndx = *aPntIt;
+ CurveCreator::Coordinates::iterator aFirstPosition;
+ if ( aPntIndx == -1 )
+ aFirstPosition = aSection->myPoints.end() - getDimension();
+ else
+ aFirstPosition = aSection->myPoints.begin() + toICoord( aPntIndx );
+ aSection->myPoints.erase( aFirstPosition, aFirstPosition + getDimension() );
+ aRes = true;
+ }
+ return aRes;
+}
+
+void CurveCreator_Curve::convert( const SectionToPointList& thePoints,
+ std::map< int, std::list<int> >& theConvPoints )
{
- CurveCreator_Section *aSection =
- (theISection == -1 ? mySections.back() : mySections.at(theISection));
+ theConvPoints.clear();
- aSection->myPoints.insert(aSection->myPoints.end(),
- thePoints.begin(), thePoints.end());
- if( myListener )
- myListener->pointInserted( theISection, -1 );
+ SectionToPointList::const_iterator anIt = thePoints.begin(), aLast = thePoints.end();
+ std::list<int> aPoints;
+ int aSectionId, aPointId;
+ for ( ; anIt != aLast; anIt++ ) {
+ aSectionId = anIt->first;
+ aPointId = anIt->second;
+ aPoints.clear();
+ if ( theConvPoints.find( aSectionId ) != theConvPoints.end() )
+ aPoints = theConvPoints[aSectionId];
+ aPoints.push_back( aPointId );
+ theConvPoints[aSectionId] = aPoints;
+ }
}
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#ifndef _CurveCreator_Curve_HeaderFile
#define _CurveCreator_Curve_HeaderFile
-#include "CurveCreator.hxx"
#include "CurveCreator_ICurve.hxx"
+
#include "CurveCreator_Macro.hxx"
-#include "CurveCreator_Operation.hxx"
+#include "CurveCreator.hxx"
+#include "CurveCreator_Diff.hxx"
-class CurveCreator_Section;
-class CurveCreator_Listener;
+#include <list>
+#include <map>
+
+struct CurveCreator_Section;
+class CurveCreator_Displayer;
+class AIS_Shape;
+class Handle_AIS_InteractiveObject;
/**
* The CurveCreator_Curve object is represented as one or more sets of
* connected points; thus CurveCreator_Curve object can contain several
* not connected curves (polylines or b-splines), each such curve has two
- * only ends � start and end points � in other words non-manifold curves
+ * only ends "start and end points" in other words non-manifold curves
* are not supported.
*/
class CURVECREATOR_EXPORT CurveCreator_Curve : public CurveCreator_ICurve
{
+protected:
+ typedef std::list<CurveCreator_Diff> ListDiff;
+
public:
//! Constructor of the curve.
/** The dimension is explicitly specified in the constructor
*/
CurveCreator_Curve(const CurveCreator::Dimension theDimension);
- /** Add points to the specified section (or last section
+ //! Destructor.
+ virtual ~CurveCreator_Curve();
+
+ //! Get the dimension.
+ virtual CurveCreator::Dimension getDimension() const;
+
+ //! Return unique section name
+ virtual std::string getUniqSectionName() const;
+
+ //! Set curve creator Displayer object
+ virtual void setDisplayer( CurveCreator_Displayer* theDisplayer );
+
+ //! Return curve creator Displayer object
+ CurveCreator_Displayer* getDisplayer();
+
+ //! Remove curve creator Displayer object
+ virtual void removeDisplayer();
+
+ /** Set depth of undo operations (unlimited if \a theDepth is -1
+ * or disabled if \a theDepth is 0)
+ */
+ virtual void setUndoDepth(const int theDepth = -1);
+
+ //! Get depth of undo operations.
+ virtual int getUndoDepth() const;
+
+ virtual void startOperation();
+ virtual void finishOperation();
+
+ /**
+ * This method converts the point index to the index in
+ * an array of coordinates.
+ */
+ virtual int toICoord(const int theIPnt) const;
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool moveSectionInternal(const int theISection,
+ const int theNewIndex);
+ //! Move section to new position in list
+ virtual bool moveSection(const int theISection,
+ const int theNewIndex);
+
+protected:
+ /** This method updates all undo/redo information required to be updated
+ * after curve modification operation. It returns false if undo/redo
+ * is disabled and true otherwise.
+ */
+ virtual bool addEmptyDiff();
+
+public: // TODO: remove public
+ void getCoordinates( int theISection, int theIPoint, double& theX, double& theY, double& theZ ) const;
+protected: // TODO: remove public
+ void redisplayCurve();
+
+public:
+ /************ Implementation of INTERFACE methods ************/
+
+ /***********************************************/
+ /*** Undo/Redo methods ***/
+ /***********************************************/
+
+ //! Get number of available undo operations
+ virtual int getNbUndo() const;
+
+ //! Undo previous operation
+ virtual bool undo();
+
+ //! Get number of available redo operations
+ virtual int getNbRedo() const;
+
+ //! Redo last previously "undone" operation
+ virtual bool redo();
+
+
+ /***********************************************/
+ /*** Section methods ***/
+ /***********************************************/
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool clearInternal();
+ //! Clear the polyline (remove all sections)
+ virtual bool clear();
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool joinInternal( const std::list<int>& theSections );
+
+ //! Join list of sections to one section (join all if the list is empty)
+ // The first section in the list is a leader, another sections are joined to it
+ virtual bool join( const std::list<int>& theSections );
+
+ //! Get number of sections
+ virtual int getNbSections() const;
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual int addSectionInternal( const std::string &theName,
+ const CurveCreator::SectionType theType,
+ const bool theIsClosed,
+ const CurveCreator::Coordinates &thePoints);
+ //! Add a new section.
+ virtual int addSection( const std::string &theName,
+ const CurveCreator::SectionType theType,
+ const bool theIsClosed );
+ //! Add a new section.
+ virtual int addSection( const std::string &theName,
+ const CurveCreator::SectionType theType,
+ const bool theIsClosed,
+ const CurveCreator::Coordinates &thePoints);
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool removeSectionInternal( const int theISection );
+ //! Removes the given sections.
+ virtual bool removeSection( const int theISection );
+
+ //! Get "closed" flag of the specified section
+ virtual bool isClosed( const int theISection ) const;
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool setClosedInternal( const int theISection,
+ const bool theIsClosed );
+ /**
+ * Set "closed" flag of the specified section (all sections if
+ * \a theISection is -1).
+ */
+ virtual bool setClosed( const int theISection,
+ const bool theIsClosed );
+
+ //! Returns specifyed section name
+ virtual std::string getSectionName( const int theISection ) const;
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool setSectionNameInternal( const int theISection,
+ const std::string& theName );
+ /** Set name of the specified section */
+ virtual bool setSectionName( const int theISection,
+ const std::string& theName );
+
+ //! Get type of the specified section
+ virtual CurveCreator::SectionType getSectionType( const int theISection ) const;
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool setSectionTypeInternal( const int theISection,
+ const CurveCreator::SectionType theType );
+ /**
+ * Set type of the specified section (or all sections
* if \a theISection is -1).
*/
- virtual void addPoints
- (const CurveCreator::Coordinates &thePoints, const int theISection = -1);
+ virtual bool setSectionType( const int theISection,
+ const CurveCreator::SectionType theType );
+
+
+ /***********************************************/
+ /*** Point methods ***/
+ /***********************************************/
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap );
+ /**
+ * Add one point to the specified section starting from the given theIPnt index
+ * (or at the end of points if \a theIPnt is -1).
+ */
+ virtual bool addPoints( const CurveCreator::Coordinates &theCoords,
+ const int theISection,
+ const int theIPnt = -1 );
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool setPointInternal( const CurveCreator::SectionsMap &theSectionsMap );
+ //! Set coordinates of specified point
+ virtual bool setPoint( const int theISection,
+ const int theIPnt,
+ const CurveCreator::Coordinates& theNewCoords );
+
+ //! Set coordinates of specified points from different sections
+ virtual bool setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
+ const bool theIsToSaveDiff = true );
+
+ //! For internal use only! Undo/Redo are not used here.
+ virtual bool removePointsInternal( const SectionToPointList &thePoints );
+ /** Remove point with given id */
+ virtual bool removePoint( const int theISection, const int theIPnt = -1 );
+
+ //! Remove several points from different sections with given ids
+ virtual bool removeSeveralPoints( const SectionToPointList &theSectionToPntIDs);
+
+ //! Get coordinates of specified point
+ virtual CurveCreator::Coordinates getPoint( const int theISection,
+ const int theIPnt ) const;
+
+ /**
+ * Get points of a section (the total points in Curve if theISection is equal to -1)..
+ */
+ virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const;
+
+
+ /**
+ * Get number of points in specified section or (the total number of points
+ * in Curve if theISection is equal to -1).
+ */
+ virtual int getNbPoints( const int theISection ) const;
+
+ /**
+ * Set skip sorting flag. If the flag is true - points sorting will be skipped.
+ */
+ virtual void setSkipSorting( const bool theIsToSkip );
+
+ /**
+ * Indicates whether the points can be sorted.
+ */
+ virtual bool canPointsBeSorted();
+
+ /**
+ * Saves points coordinates difference.
+ * \param theOldCoords the old points coordinates
+ */
+ virtual void saveCoordDiff( const SectionToPointCoordsList &theOldCoords );
+
+ /***********************************************/
+ /*** Presentation methods ***/
+ /***********************************************/
+ /**
+ * Get the curve AIS object
+ */
+ virtual Handle_AIS_InteractiveObject getAISObject( const bool theNeedToBuild = false ) const;
+
+protected:
+ /**
+ * Removes the points from the section. It sortes the points and remove them
+ * in the decreasing order
+ * \param theSectionId a section index
+ * \param thePointIds a list of section points
+ */
+ bool removeSectionPoints( const int theSectionId,
+ const std::list<int>& thePointIds );
+ /**
+ * Converts the list of pairs of section to point into map of a section to list of points
+ * \param thePoints an source list
+ * \param theConvPoints a converted map
+ */
+ void convert( const SectionToPointList &thePoints,
+ std::map<int, std::list<int> > &theConvPoints );
+
+protected:
+ virtual void constructAISObject();
+ /**
+ * Returns the section by the section index or NULL if the index is out of the section
+ * list range
+ * \param theSectionId the section index
+ */
+ CurveCreator_Section* getSection( const int theSectionId ) const;
+
+protected:
+ bool mySkipSorting;
+
+public:
+ bool myIsLocked;
+ CurveCreator::Sections mySections; //!< curve data
+ CurveCreator::Dimension myDimension; //!< curve dimension
+ CurveCreator_Displayer* myDisplayer; //!< curve displayer
- friend class CurveCreator_CurveEditor;
- friend class CurveCreator_Operation;
+private:
+ int myNbUndos;
+ int myNbRedos;
+ ListDiff::iterator myCurrenPos;
+ ListDiff myListDiffs;
+ int myUndoDepth;
+ int myOpLevel;
+ AIS_Shape* myAISShape; //!< AIS shape
};
#endif
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: CurveCreator_CurveEditor.cxx
-// Author: Sergey KHROMOV
-
-#include "CurveCreator_CurveEditor.hxx"
-
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-CurveCreator_CurveEditor::CurveCreator_CurveEditor
- (CurveCreator_Curve* thePCurve)
- : myNbUndos (0),
- myNbRedos (0),
- myPCurve (thePCurve),
- myUndoDepth (-1),
- myOpLevel(0)
-{
- if (myPCurve != NULL) {
- if (myPCurve->isLocked()) {
- // This curve is locked by another editor. Invalid case.
- myPCurve = NULL;
- } else {
- // Lock the curve.
- myPCurve->myIsLocked = true;
- myCurrenPos = myListDiffs.end();
- }
- }
-}
-
-//=======================================================================
-// function: Destructor
-// purpose:
-//=======================================================================
-CurveCreator_CurveEditor::~CurveCreator_CurveEditor()
-{
- if (myPCurve != NULL) {
- // Unlock the curve.
- myPCurve->myIsLocked = false;
- }
-}
-
-//=======================================================================
-// function: getCurve
-// purpose:
-//=======================================================================
-CurveCreator_Curve *CurveCreator_CurveEditor::getCurve() const
-{
- return myPCurve;
-}
-
-//=======================================================================
-// function: isAttached
-// purpose:
-//=======================================================================
-bool CurveCreator_CurveEditor::isAttached() const
-{
- return (myPCurve != NULL);
-}
-
-//=======================================================================
-// function: undo
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::undo()
-{
- if (myNbUndos > 0) {
- myNbUndos--;
- myNbRedos++;
- myCurrenPos--;
- myCurrenPos->applyUndo(myPCurve);
- }
-}
-
-//=======================================================================
-// function: redo
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::redo()
-{
- if (myNbRedos > 0) {
- myCurrenPos->applyRedo(myPCurve);
- myCurrenPos++;
- myNbRedos--;
- myNbUndos++;
- }
-}
-
-//=======================================================================
-// function: getNbUndo
-// purpose:
-//=======================================================================
-int CurveCreator_CurveEditor::getNbUndo() const
-{
- return myNbUndos;
-}
-
-//=======================================================================
-// function: getNbRedo
-// purpose:
-//=======================================================================
-int CurveCreator_CurveEditor::getNbRedo() const
-{
- return myNbRedos;
-}
-
-//=======================================================================
-// function: setUndoDepth
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::setUndoDepth(const int theDepth)
-{
- if (theDepth == 0) {
- // Reset all undo/redo data.
- myNbUndos = 0;
- myNbRedos = 0;
- myListDiffs.clear();
- myCurrenPos = myListDiffs.end();
- myUndoDepth = 0;
- } else if (theDepth == -1) {
- // There is nothing to do as the depth become unlimited.
- myUndoDepth = -1;
- } else if (theDepth > 0) {
- // The new "real" depth is set.
- if (theDepth < myNbRedos) {
- // The new depth is less then number of redos. Remove the latest redos.
- int aShift = (myNbRedos - theDepth);
- ListDiff::iterator aFromPos = myListDiffs.end();
-
- while (aShift--) {
- aFromPos--;
- }
-
- myListDiffs.erase(aFromPos, myListDiffs.end());
- myNbRedos = theDepth;
- }
-
- if (theDepth < myNbUndos + myNbRedos) {
- // The new depth is less then the total number of differences.
- // Remove the first undos.
- int aShift = (myNbUndos + myNbRedos - theDepth);
- ListDiff::iterator aToPos = myListDiffs.begin();
-
- while (aShift--) {
- aToPos++;
- }
-
- myListDiffs.erase(myListDiffs.begin(), aToPos);
- myNbUndos = theDepth - myNbRedos;
- }
-
- myUndoDepth = theDepth;
- }
-}
-
-//=======================================================================
-// function: getUndoDepth
-// purpose:
-//=======================================================================
-int CurveCreator_CurveEditor::getUndoDepth() const
-{
- return myUndoDepth;
-}
-
-//=======================================================================
-// function: setType
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::setType(const CurveCreator::Type theType,
- const int theISection)
-{
- if (myPCurve != NULL) {
- startOperation();
- // Set the difference.
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::SetType,
- theType, theISection);
- }
-
- // Update the curve.
- myPCurve->setType(theType, theISection);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: addPoints
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::addPoints
- (const CurveCreator::Coordinates &thePoints,
- const int theISection)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::AddPoints,
- thePoints, theISection);
- }
-
- // Update the curve.
- myPCurve->addPoints(thePoints, theISection);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: addSection
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::addSection
- (const std::string& theName, const CurveCreator::Type theType,
- const bool theIsClosed,
- const CurveCreator::Coordinates &thePoints)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::AddSection,
- theName, thePoints, theType, theIsClosed);
- }
-
- // Update the curve.
- myPCurve->addSection(theName, theType, theIsClosed, thePoints);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: removeSection
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::removeSection(const int theISection)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::RemoveSection,
- theISection);
- }
-
- // Update the curve.
- myPCurve->removeSection(theISection);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: insertPoints
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::insertPoints
- (const CurveCreator::Coordinates &thePoints,
- const int theISection,
- const int theIPnt)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::InsertPoints,
- thePoints, theISection, theIPnt);
- }
-
- // Update the curve.
- myPCurve->insertPoints(thePoints, theISection, theIPnt);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: movePoints
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::movePoint(const int theISection,
- const int theOrigIPnt,
- const int theNewIPnt )
-{
- startOperation();
- myPCurve->movePoint(theISection, theOrigIPnt, theNewIPnt);
- finishOperation();
-}
-
-//=======================================================================
-// function: removePoints
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::removePoints
- (const int theISection,
- const int theIPnt,
- const int theNbPoints)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::RemovePoints,
- theISection, theIPnt, theNbPoints);
- }
-
- // Update the curve.
- myPCurve->removePoints(theISection, theIPnt, theNbPoints);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: clear
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::clear()
-{
- if (myPCurve != NULL) {
- startOperation();
- // Set the difference.
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::Clear);
- }
-
- // Update the curve.
- myPCurve->clear();
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: setCoordinates
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::setCoordinates
- (const CurveCreator::Coordinates &theCoords,
- const int theISection,
- const int theIPnt)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::SetCoordinates,
- theCoords, theISection, theIPnt);
- }
-
- // Update the curve.
- myPCurve->setCoordinates(theCoords, theISection, theIPnt);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: setClosed
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::setClosed(const bool theIsClosed,
- const int theISection)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::SetClosed,
- theIsClosed, theISection);
- }
-
- // Update the curve.
- myPCurve->setClosed(theIsClosed, theISection);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: setName
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::setName(const std::string& theName,
- const int theISection)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::RenameSection,
- theName, theISection);
- }
- myPCurve->setName( theName, theISection );
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: moveSection
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::moveSection(const int theISection,
- const int theNewIndex)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::MoveSection,
- theISection, theNewIndex);
- }
-
- // Update the curve.
- myPCurve->moveSection(theISection, theNewIndex);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: join
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::join(const int theISectionTo,
- const int theISectionFrom)
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::Join,
- theISectionTo, theISectionFrom);
- }
-
- // Update the curve.
- myPCurve->join(theISectionTo, theISectionFrom);
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: join
-// purpose:
-//=======================================================================
-void CurveCreator_CurveEditor::join()
-{
- if (myPCurve != NULL) {
- // Set the difference.
- startOperation();
- if (addEmptyDiff()) {
- myListDiffs.back().init(myPCurve, CurveCreator_Operation::Join);
- }
-
- // Update the curve.
- myPCurve->join();
- finishOperation();
- }
-}
-
-//=======================================================================
-// function: addDiff
-// purpose:
-//=======================================================================
-bool CurveCreator_CurveEditor::addEmptyDiff()
-{
- bool isEnabled = false;
-
- if (myUndoDepth != 0) {
- // Forget all Redos after the current one.
- if (myNbRedos > 0) {
- myNbRedos = 0;
- myListDiffs.erase(myCurrenPos, myListDiffs.end());
- }
-
- if (myUndoDepth == -1 || myNbUndos < myUndoDepth) {
- // Increase the number of undos.
- myNbUndos++;
- } else {
- // If there are too many differences, remove the first one.
- myListDiffs.pop_front();
- }
-
- // Add new difference.
- myListDiffs.push_back(CurveCreator_Diff());
- myCurrenPos = myListDiffs.end();
- isEnabled = true;
- }
-
- return isEnabled;
-}
-
-void CurveCreator_CurveEditor::startOperation()
-{
- myOpLevel++;
-}
-
-void CurveCreator_CurveEditor::finishOperation()
-{
- myOpLevel--;
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: CurveCreator_CurveEditor.hxx
-// Author: Sergey KHROMOV
-
-#ifndef _CurveCreator_CurveEditor_HeaderFile
-#define _CurveCreator_CurveEditor_HeaderFile
-
-#include "CurveCreator_Diff.hxx"
-#include "CurveCreator_Curve.hxx"
-
-#include <list>
-
-/**
- * The CurveCreator_CurveEditor is designed to manage of
- * editing operations of CurveCreator_Curve class.
- */
-class CURVECREATOR_EXPORT CurveCreator_CurveEditor
-{
-
-private:
-
- typedef std::list<CurveCreator_Diff> ListDiff;
-
-public:
-
- //! Constuctor, initialized by the curve object
- CurveCreator_CurveEditor(CurveCreator_Curve* thePCurve);
-
- //! Destructor, detaches from the Curve
- ~CurveCreator_CurveEditor();
-
- //! Returns the curve.
- CurveCreator_Curve *getCurve() const;
-
- //! This method returns true if this editor is attached to a valid curve.
- bool isAttached() const;
-
- //! Undo previous operation
- void undo();
-
- //! Redo last previously �undoed� operation
- void redo();
-
- //! Get number of available undo operations
- int getNbUndo() const;
-
- //! Get number of available redo operations
- int getNbRedo() const;
-
- //! Set depth of undo operations (unlimited if \a theDepth is -1
- // or disabled if \a theDepth is 0)
- void setUndoDepth(const int theDepth = -1);
-
- //! Get depth of undo operations.
- int getUndoDepth() const;
-
- /** Set type of the specified section (or all sections
- * if \a theISection is -1).
- */
- void setType(const CurveCreator::Type theType, const int theISection = -1);
-
- /** Set section closed (or all sections
- * if \a theISection is -1).
- */
- void setClosed(const bool theIsClosed, const int theISection);
-
- /** Set section name (if theISection is invalid it is ignored).
- */
- void setName(const std::string& theName, const int theISection);
-
- /** Add points to the specified section (or last section
- * if \a theISection is -1).
- */
- void addPoints(const CurveCreator::Coordinates &thePoints,
- const int theISection = -1);
-
- //! Add a new section.
- void addSection(const std::string &theName, const CurveCreator::Type theType,
- const bool theIsClosed,
- const CurveCreator::Coordinates &thePoints);
-
- //! Removes the section. If theISection equals -1, removes the last section.
- void removeSection(const int theISection = -1);
-
- /** Insert points in the given position (add to the end of list
- * if \a theIPnt parameter is -1) of the specified section
- * (or last section if \a theISection parameter is -1).
- */
- void insertPoints(const CurveCreator::Coordinates &thePoints,
- const int theISection = -1,
- const int theIPnt = -1);
-
- /** Remove \a nbPoints points from given \a theISection,
- * starting from given \a theIPnt (of all points up to the end of
- * section if \a theNbPoints is -1).
- */
- void removePoints(const int theISection,
- const int theIPnt,
- const int theNbPoints = -1);
-
- /** Mobe point in \a theISection from given position \a theOrigIPnt
- * to new position \a theNewIPnt.
- */
- void movePoint(const int theISection,
- const int theOrigIPnt,
- const int theNewIPnt );
-
- //! Remove all sections.
- void clear();
-
- //! Set coordinates of specified point
- void setCoordinates(const CurveCreator::Coordinates &theCoords,
- const int theISection,
- const int theIPnt);
-
- /** Move specified \a theISection to the specified position
- * in the sections list.
- */
- void moveSection(const int theISection, const int theNewIndex);
-
- //! Join two sections to one section
- void join(const int theISectionTo, const int theISectionFrom);
-
- //! Join all sections to the single curve
- void join();
-
- void startOperation();
- void finishOperation();
-private:
-
- /** This method updates all undo/redo information required to be updated
- * after curve modification operation. It returns false if undo/redo
- * is disabled and true otherwise.
- */
- bool addEmptyDiff();
-
-private:
-
- int myNbUndos;
- int myNbRedos;
- ListDiff::iterator myCurrenPos;
- ListDiff myListDiffs;
- CurveCreator_Curve* myPCurve;
- int myUndoDepth;
- int myOpLevel;
-};
-
-#endif
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// function: init
// purpose:
//=======================================================================
-bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
- const CurveCreator_Operation::Type theType)
+bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve)
{
+ CurveCreator_Operation::Type aType = CurveCreator_Operation::Clear;
bool isOK = false;
if (theCurve != NULL) {
// Set redo.
myPRedo = new CurveCreator_Operation;
- if (myPRedo->init(theType)) {
+ if (myPRedo->init(aType)) {
isOK = true;
const int aNbSections = theCurve->getNbSections();
- if (theType == CurveCreator_Operation::Clear) {
- // Construct undo for Clear command.
- if (aNbSections > 0) {
- setNbUndos(aNbSections);
+ // Construct undo for Clear command.
+ if (aNbSections > 0) {
+ setNbUndos(aNbSections);
- for (int i = 0; i < aNbSections && isOK; i++) {
- // Add AddSection command.
- isOK = addSectionToUndo(theCurve, i, myPUndo[i]);
- }
- }
- } else { // theType == CurveCreator_Operation::Join
- // Construct undo for Join command.
- if (aNbSections > 1) {
- // Add the RemovePoints command to remove points of
- // the second section fron the first one.
- const int aNbPoints = theCurve->getNbPoints(0);
-
- setNbUndos(aNbSections);
- isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
- 0, aNbPoints, -1);
-
- for (int i = 1; i < aNbSections && isOK; i++) {
- // Add AddSection command.
- isOK = addSectionToUndo(theCurve, i, myPUndo[i]);
- }
+ for (int i = 0; i < aNbSections && isOK; i++) {
+ // Add AddSection command.
+ isOK = addSectionToUndo(theCurve, i, myPUndo[i]);
}
}
}
setNbUndos(1);
isOK = myPUndo[0].init(theType, theIntParam2, theIntParam1);
break;
- case CurveCreator_Operation::Join:
- {
- // If the last section is removed, one AddSection command is
- // enough. If not last section is removed, two commands are
- // requred: AddSection and MoveSection.
- const int aLastIndex = theCurve->getNbSections() - 1;
- const int aNbPoints = theCurve->getNbPoints(theIntParam1);
-
- if (theIntParam2 == aLastIndex) {
- setNbUndos(2);
- } else {
- setNbUndos(3);
- }
-
- isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
- theIntParam1, aNbPoints, -1);
-
- if (isOK) {
- isOK = addSectionToUndo(theCurve, theIntParam2, myPUndo[1]);
-
- if (isOK && theIntParam2 != aLastIndex) {
- isOK = myPUndo[2].init(CurveCreator_Operation::MoveSection,
- aLastIndex, theIntParam2);
- }
- }
- }
- break;
default:
break;
}
//=======================================================================
bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const int theIntParam1,
- const int theIntParam2,
- const int theIntParam3)
+ const std::list<int>& theParams)
{
bool isOK = false;
- if (theCurve != NULL) {
+ if (theCurve != NULL || theParams.empty()) {
clear();
// Set redo.
myPRedo = new CurveCreator_Operation;
- if (myPRedo->init(theType, theIntParam1, theIntParam2, theIntParam3)) {
- // Construct undo for RemovePoints command.
- const CurveCreator::Dimension aDim = theCurve->getDimension();
- const CurveCreator::Coordinates &aPoints =
- theCurve->getPoints(theIntParam1);
- CurveCreator::Coordinates::const_iterator anIterBegin =
- aPoints.begin() + (aDim*theIntParam2);
- CurveCreator::Coordinates::const_iterator anIterEnd;
-
- if (theIntParam3 == -1) {
- anIterEnd = aPoints.end();
- } else {
- anIterEnd = anIterBegin + (aDim*theIntParam3);
- }
-
- CurveCreator::Coordinates aPointsToAdd;
-
- setNbUndos(1);
- aPointsToAdd.insert(aPointsToAdd.end(), anIterBegin, anIterEnd);
- isOK = myPUndo[0].init(CurveCreator_Operation::InsertPoints,
- aPointsToAdd, theIntParam1, theIntParam2);
- }
-
- if (!isOK) {
- clear();
- }
- }
-
- return isOK;
-}
-
-//=======================================================================
-// function: init
-// purpose:
-//=======================================================================
-bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
- const CurveCreator_Operation::Type theType,
- const CurveCreator::Coordinates &theCoords,
- const int theIntParam)
-{
- bool isOK = false;
-
- if (theCurve != NULL) {
- clear();
-
- // Set redo.
- myPRedo = new CurveCreator_Operation;
+ if (myPRedo->init(theType, theParams)) {
+ // Construct undo for different commands.
+ switch (theType) {
+ case CurveCreator_Operation::Join:
+ {
+ int aSectionMain = theParams.front();
+ const int aNbPointsMain = theCurve->getNbPoints(aSectionMain);
+
+ std::list<int> aSectionsToJoin = theParams;
+ aSectionsToJoin.erase( aSectionsToJoin.begin() );
+ // it is important to sort the section indices in order to correct perform undo
+ // for the move sections to the previous positions
+ aSectionsToJoin.sort();
+ // 1rst undo for remove points from the main and n-1 undoes to contain joined sections
+ int aSectionsToJoinNb = aSectionsToJoin.size();
+ int aNbUndos = 2*aSectionsToJoinNb + 1;
+ setNbUndos( aNbUndos );
+
+ // Add joined sections to undo
+ std::list<int>::const_iterator anIt = aSectionsToJoin.begin(),
+ aLast = aSectionsToJoin.end();
+ anIt = aSectionsToJoin.begin();
+ int aLastSectionId = -1;
+ for (int i = 0; anIt != aLast && i < aSectionsToJoinNb; anIt++, i++) {
+ int anISection = *anIt;
+ isOK = addSectionToUndo( theCurve, anISection, myPUndo[i*2] );
+ if (isOK) {
+ isOK = myPUndo[i*2+1].init(CurveCreator_Operation::MoveSection,
+ aLastSectionId, anISection);
+ if (!isOK)
+ break;
+ }
+ }
+ // Construct undo for RemovePoints command.
+ if (isOK) {
+ int aNbPointsInJoined = 0;
+ anIt = aSectionsToJoin.begin();
+ for ( ; anIt != aLast; anIt++ )
+ aNbPointsInJoined += theCurve->getNbPoints( *anIt );
- if (myPRedo->init(theType, theCoords, theIntParam)) {
- // Construct undo for AddPoints command.
- const int aSectionInd = getSectionIndex(theCurve, theIntParam);
- const CurveCreator::Dimension aDim = theCurve->getDimension();
- const CurveCreator::Coordinates &aPoints =
- theCurve->getPoints(aSectionInd);
- const int aNbPoints = (aPoints.size()/aDim);
+ int aJoinedSize = aNbPointsMain + aNbPointsInJoined;
+ CurveCreator_ICurve::SectionToPointList aSectionToPointList;
+ for (int anIPoint = aNbPointsMain; anIPoint < aJoinedSize; anIPoint++)
+ aSectionToPointList.push_back(std::make_pair(aSectionMain, anIPoint));
- setNbUndos(1);
- isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
- aSectionInd, aNbPoints, -1);
+ isOK = myPUndo[aNbUndos-1].init(CurveCreator_Operation::RemovePoints, aSectionToPointList);
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
if (!isOK) {
return isOK;
}
-//=======================================================================
-// function: init
-// purpose:
-//=======================================================================
bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const CurveCreator::Coordinates &theCoords,
- const int theIntParam1,
- const int theIntParam2)
+ const std::string &theName,
+ const int theIntParam1 )
+{
+ bool isOK = false;
+ myPRedo = new CurveCreator_Operation;
+
+ if (myPRedo->init(theType, theName, theIntParam1 )) {
+ // Construct undo for different commands.
+ switch (theType) {
+ case CurveCreator_Operation::RenameSection:
+ setNbUndos(1);
+ isOK = myPUndo[0].init(CurveCreator_Operation::RenameSection,
+ theCurve->getSectionName(theIntParam1), theIntParam1);
+ break;
+ }
+ }
+ if( !isOK ){
+ clear();
+ }
+ return isOK;
+}
+
+bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
+ const CurveCreator_Operation::Type theType,
+ const CurveCreator_ICurve::SectionToPointList &theParamList1)
{
bool isOK = false;
// Set redo.
myPRedo = new CurveCreator_Operation;
- if (myPRedo->init(theType, theCoords, theIntParam1, theIntParam2)) {
+ if (myPRedo->init(theType, theParamList1)) {
// Construct undo for different commands.
switch (theType) {
- case CurveCreator_Operation::InsertPoints:
+ case CurveCreator_Operation::RemovePoints:
{
+ // Construct undo for RemovePoints command.
+ CurveCreator_ICurve::SectionToPointCoordsList aSectionToPointCoords;
+ CurveCreator::Coordinates aPointsToAdd;
const CurveCreator::Dimension aDim = theCurve->getDimension();
- const int aNbPoints = (theCoords.size()/aDim);
- const int aSectionInd = getSectionIndex(theCurve, theIntParam1);
- int aPointInd;
-
- if (theIntParam2 == -1) {
- aPointInd = theCurve->getNbPoints(aSectionInd);
- } else {
- aPointInd = theIntParam2;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = theParamList1.begin(), aLast = theParamList1.end();
+ std::list<int> aPoints;
+ int aSectionId, aPointId;
+ for ( ; anIt != aLast; anIt++ ) {
+ aPointsToAdd.clear();
+ aSectionId = anIt->first;
+ aPointId = anIt->second;
+ const CurveCreator::Coordinates &aPoints =
+ theCurve->getPoints(aSectionId);
+ CurveCreator::Coordinates::const_iterator anIterBegin =
+ aPoints.begin() + (aDim*aPointId);
+ CurveCreator::Coordinates::const_iterator anIterEnd =
+ anIterBegin + aDim;
+ aPointsToAdd.insert(aPointsToAdd.end(), anIterBegin, anIterEnd);
+ aSectionToPointCoords.push_back(std::make_pair(*anIt, aPointsToAdd));
}
+ setNbUndos(1);
+ isOK = myPUndo[0].init(CurveCreator_Operation::InsertPoints,
+ aSectionToPointCoords);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!isOK) {
+ clear();
+ }
+ }
+ return isOK;
+}
+
+bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
+ const CurveCreator_Operation::Type theType,
+ const CurveCreator_ICurve::SectionToPointCoordsList &theParamList1)
+{
+ bool isOK = false;
+
+ if (theCurve != NULL) {
+ clear();
+
+ // Set redo.
+ myPRedo = new CurveCreator_Operation;
+
+ if (myPRedo->init(theType, theParamList1)) {
+ // Construct undo for different commands.
+ switch (theType) {
+ case CurveCreator_Operation::InsertPoints:
+ {
+ // Construct undo for RemovePoints command.
+ CurveCreator_ICurve::SectionToPointList aSectionToPointList;
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt = theParamList1.begin(), aLast = theParamList1.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ aSectionToPointList.push_back(anIt->first);
+ }
setNbUndos(1);
isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
- aSectionInd, aPointInd, aNbPoints);
+ aSectionToPointList);
}
break;
case CurveCreator_Operation::SetCoordinates:
{
- const CurveCreator::Coordinates anOldCoords =
- theCurve->getCoordinates(theIntParam1, theIntParam2);
+ // Construct undo for SetCoordinates command.
+ CurveCreator_ICurve::SectionToPointCoordsList aSectionToPointOldCoords;
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt = theParamList1.begin(), aLast = theParamList1.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ CurveCreator::Coordinates anOldCoords = theCurve->getPoint(anIt->first.first, anIt->first.second);
+ aSectionToPointOldCoords.push_back(std::make_pair(anIt->first, anOldCoords));
+ }
setNbUndos(1);
isOK = myPUndo[0].init(CurveCreator_Operation::SetCoordinates,
- anOldCoords, theIntParam1, theIntParam2);
+ aSectionToPointOldCoords);
}
break;
default:
}
bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
- const CurveCreator_Operation::Type theType,
- const std::string &theName,
- const int theIntParam1 )
+ const CurveCreator_ICurve::SectionToPointCoordsList &theOldParamList)
{
bool isOK = false;
- myPRedo = new CurveCreator_Operation;
- if (myPRedo->init(theType, theName, theIntParam1 )) {
- // Construct undo for different commands.
- switch (theType) {
- case CurveCreator_Operation::RenameSection:
- setNbUndos(1);
- isOK = myPUndo[0].init(CurveCreator_Operation::RenameSection,
- theCurve->getSectionName(theIntParam1), theIntParam1);
- break;
- }
- }
- if( !isOK ){
+ if (theCurve != NULL && theOldParamList.size() > 0) {
clear();
+
+ // Set redo.
+ myPRedo = new CurveCreator_Operation;
+
+ // Construct redo for SetCoordinates command.
+ CurveCreator_ICurve::SectionToPointCoordsList aSectionToPointActualCoords;
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt =
+ theOldParamList.begin(), aLast = theOldParamList.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ CurveCreator::Coordinates anActualCoords = theCurve->getPoint(anIt->first.first, anIt->first.second);
+ aSectionToPointActualCoords.push_back(std::make_pair(anIt->first, anActualCoords));
+ }
+
+ if (myPRedo->init(CurveCreator_Operation::SetCoordinates, aSectionToPointActualCoords)) {
+ // Undo for SetCoordinates command.
+ setNbUndos(1);
+ isOK = myPUndo[0].init(CurveCreator_Operation::SetCoordinates,
+ theOldParamList);
+ }
+
+ if (!isOK) {
+ clear();
+ }
}
+
return isOK;
}
const int theIndex,
CurveCreator_Operation &theOperation) const
{
+ const std::string aName = theCurve->getSectionName(theIndex);
const CurveCreator::Coordinates &aPnts = theCurve->getPoints(theIndex);
- const CurveCreator::Type aType = theCurve->getType(theIndex);
+ const CurveCreator::SectionType aType = theCurve->getSectionType(theIndex);
const bool isClosed = theCurve->isClosed(theIndex);
bool isOK = theOperation.init(CurveCreator_Operation::AddSection,
- aPnts, aType, isClosed);
+ aName, aPnts, aType, isClosed);
return isOK;
}
// Get sections to be modified.
for (i = 0; i < aNbSections; i++) {
if (isSetType) {
- aValue = theCurve->getType(i);
+ aValue = theCurve->getSectionType(i);
} else {
aValue = theCurve->isClosed(i);
}
// There is only particular section modified.
// Check if there is a real modification required.
if (isSetType) {
- aValue = theCurve->getType(theIntParam2);
+ aValue = theCurve->getSectionType(theIntParam2);
} else {
aValue = theCurve->isClosed(theIntParam2);
}
std::list<int>::iterator anIter = aListOfInd.begin();
if (isSetType) {
- aValue = theCurve->getType(*anIter);
+ aValue = theCurve->getSectionType(*anIter);
} else {
aValue = theCurve->isClosed(*anIter);
}
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
* parameters. It is applicable to the following operations:
* <UL>
* <LI>Clear</LI>
- * <LI>Join (without arguments)</LI>
* </UL>
*/
- bool init(const CurveCreator_Curve *theCurve,
- const CurveCreator_Operation::Type theType);
+ bool init(const CurveCreator_Curve *theCurve);
/**
* This method initializes the difference with an operation with one integer
* <LI>SetType</LI>
* <LI>SetClosed</LI>
* <LI>MoveSection</LI>
- * <LI>Join (with 2 int arguments)</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const int theIntParam1,
const int theIntParam2);
- /**
- * This method initializes the difference with an operation with three
- * integer parameters. It is applicable to the following operations:
+ /**
+ * This method initializes the difference with an operation with two integer
+ * parameters. It is applicable to the following operations:
* <UL>
- * <LI>RemovePoints</LI>
+ * <LI>Join (with a list of int arguments)</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const int theIntParam1,
- const int theIntParam2,
- const int theIntParam3);
+ const std::list<int>& theParams);
/**
* This method initializes the difference with an operation with one
- * CurveCreator::Coordinates parameter and one integer parameter.
+ * Name, one CurveCreator::Coordinates parameter and two integer parameters.
* It is applicable to the following operations:
* <UL>
- * <LI>AddPoints</LI>
+ * <LI>AddSection</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
+ const std::string& theName,
const CurveCreator::Coordinates &theCoords,
- const int theIntParam);
+ const int theIntParam1,
+ const int theIntParam2);
/**
* This method initializes the difference with an operation with one
- * CurveCreator::Coordinates parameter and two integer parameters.
+ * string and one integer parameters.
* It is applicable to the following operations:
* <UL>
- * <LI>InsertPoints</LI>
- * <LI>SetCoordinates</LI>
+ * <LI>RenameSection</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const CurveCreator::Coordinates &theCoords,
- const int theIntParam1,
- const int theIntParam2);
+ const std::string &theName,
+ const int theIntParam1 );
/**
- * This method initializes the difference with an operation with one
- * Name, one CurveCreator::Coordinates parameter and two integer parameters.
+ * This method initializes the difference with an operation with
+ * list of pairs of integer parameters.
* It is applicable to the following operations:
* <UL>
- * <LI>AddSection</LI>
+ * <LI>RemovePoints</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const std::string& theName,
- const CurveCreator::Coordinates &theCoords,
- const int theIntParam1,
- const int theIntParam2);
+ const CurveCreator_ICurve::SectionToPointList &theParamList);
/**
- * This method initializes the difference with an operation with one
- * string and one integer parameters.
+ * This method initializes the difference with an operation with
+ * list of pairs of integer parameters with point coordinates.
* It is applicable to the following operations:
* <UL>
- * <LI>RenameSection</LI>
+ * <LI>RemovePoints</LI>
* </UL>
*/
bool init(const CurveCreator_Curve *theCurve,
const CurveCreator_Operation::Type theType,
- const std::string &theName,
- const int theIntParam1 );
+ const CurveCreator_ICurve::SectionToPointCoordsList &theParamList);
+
+ /**
+ * This method initializes the difference with an operation with
+ * list of pairs of integer parameters with point coordinates.
+ * \param theCurve the modified curve
+ * \param theOldParamList the old parameters (to be saved for undo)
+ */
+ bool init(const CurveCreator_Curve *theCurve,
+ const CurveCreator_ICurve::SectionToPointCoordsList &theOldParamList);
/**
* This method applies undo operation to theCurve.
--- /dev/null
+#include "CurveCreator_Displayer.hxx"
+
+CurveCreator_Displayer::CurveCreator_Displayer( Handle_AIS_InteractiveContext theContext,
+ const int theZLayer ) :
+ myContext( theContext ), myZLayer( theZLayer )
+{
+ myObjects.clear();
+}
+
+CurveCreator_Displayer::~CurveCreator_Displayer(void)
+{
+ eraseAll( true );
+ for( int i = 0 ; i < myObjects.size() ; i++ ){
+ myObjects[i].Nullify();
+ }
+ myObjects.clear();
+}
+
+void CurveCreator_Displayer::display( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
+{
+ if ( theObject.IsNull() )
+ return;
+
+ myObjects.push_back( theObject );
+ myContext->Display( theObject, Standard_False );
+
+ if ( myZLayer >= 0 )
+ myContext->SetZLayer( theObject, myZLayer );
+
+ if( isUpdate )
+ myContext->UpdateCurrentViewer();
+}
+
+void CurveCreator_Displayer::eraseAll( bool isUpdate )
+{
+ if(myObjects.empty())
+ return;
+ for( int i = 0 ; i < myObjects.size() ; i++ ){
+ myContext->Erase(myObjects[i], Standard_False);
+ }
+ myObjects.clear();
+ if( isUpdate )
+ myContext->UpdateCurrentViewer();
+}
+
+Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
+{
+ if( isHL ){
+ return Quantity_Color( 1., 0., 0., Quantity_TOC_RGB );
+ }
+ return Quantity_Color( 0., 1., 0., Quantity_TOC_RGB );
+}
+
+/*void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
+{
+ return;
+ //TODO:
+ Quantity_Color aColor = getActiveColor( isHL );
+ for( int i = 0 ; i < theObjects.size() ; i++ ){
+ theObjects[i]->SetColor(aColor);
+ myContext->Display(theObjects[i], Standard_False);
+ }
+ myContext->UpdateCurrentViewer();
+}*/
--- /dev/null
+#ifndef CURVECREATOR_DISPLAYER_H
+#define CURVECREATOR_DISPLAYER_H
+
+#include "CurveCreator_Macro.hxx"
+
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_InteractiveContext.hxx>
+
+#include <vector>
+
+class CURVECREATOR_EXPORT CurveCreator_Displayer
+{
+typedef std::vector<Handle_AIS_InteractiveObject> AISObjectsList;
+
+public:
+ CurveCreator_Displayer( Handle_AIS_InteractiveContext theContext,
+ const int theZLayer = -1 );
+ ~CurveCreator_Displayer(void);
+
+ void display( const Handle_AIS_InteractiveObject& theObject, bool isUpdate );
+ void eraseAll( bool isUpdate );
+ //void highlight( const AISObjectsList& theObjects, bool isHL );
+
+protected:
+ Quantity_Color getActiveColor( bool isHL );
+
+private:
+ Handle_AIS_InteractiveContext myContext;
+ AISObjectsList myObjects;
+ int myZLayer;
+};
+
+#endif
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: CurveCreator_ICurve.cxx
-// Author: Sergey KHROMOV
-
-#include "CurveCreator_ICurve.hxx"
-#include "CurveCreator_Section.hxx"
-#include "CurveCreator_Listener.hxx"
-
-#include <stdio.h>
-
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-CurveCreator_ICurve::CurveCreator_ICurve
- (const CurveCreator::Dimension theDimension)
-: myIsLocked (false),
- myDimension (theDimension),
- myListener(NULL)
-{
-}
-
-//=======================================================================
-// function: Destructor
-// purpose:
-//=======================================================================
-CurveCreator_ICurve::~CurveCreator_ICurve()
-{
- // Delete all allocated data.
- clear();
-}
-
-//=======================================================================
-// function: isLocked
-// purpose:
-//=======================================================================
-bool CurveCreator_ICurve::isLocked() const
-{
- return myIsLocked;
-}
-
-//=======================================================================
-// function: getDimension
-// purpose:
-//=======================================================================
-CurveCreator::Dimension CurveCreator_ICurve::getDimension() const
-{
- return myDimension;
-}
-
-//=======================================================================
-// function: getNbPoints
-// purpose:
-//=======================================================================
-int CurveCreator_ICurve::getNbPoints(const int theISection) const
-{
- int aNbCoords = 0;
-
- if (theISection == -1) {
- int i = 0;
- const int aNbSections = getNbSections();
-
- for (; i < aNbSections; i++) {
- aNbCoords += mySections[i]->myPoints.size();
- }
- } else {
- aNbCoords = mySections.at(theISection)->myPoints.size();
- }
-
- return aNbCoords/myDimension;
-}
-
-//=======================================================================
-// function: getNbSections
-// purpose:
-//=======================================================================
-int CurveCreator_ICurve::getNbSections() const
-{
- return mySections.size();
-}
-
-//=======================================================================
-// function: getCoordinates
-// purpose:
-//=======================================================================
-CurveCreator::Coordinates CurveCreator_ICurve::getCoordinates
- (const int theISection, const int theIPnt) const
-{
- CurveCreator_Section *aSection = mySections.at(theISection);
- CurveCreator::Coordinates::const_iterator
- anIter = aSection->myPoints.begin() + toICoord(theIPnt);
- CurveCreator::Coordinates aResult(anIter, anIter + myDimension);
-
- return aResult;
-}
-
-//=======================================================================
-// function: getType
-// purpose:
-//=======================================================================
-CurveCreator::Type CurveCreator_ICurve::getType(const int theISection) const
-{
- return mySections.at(theISection)->myType;
-}
-
-//=======================================================================
-// function: getPoints
-// purpose:
-//=======================================================================
-const CurveCreator::Coordinates &CurveCreator_ICurve::getPoints
- (const int theISection) const
-{
- return mySections.at(theISection)->myPoints;
-}
-
-//=======================================================================
-// function: isClosed
-// purpose:
-//=======================================================================
-bool CurveCreator_ICurve::isClosed(const int theISection) const
-{
- return mySections.at(theISection)->myIsClosed;
-}
-
-std::string CurveCreator_ICurve::getSectionName(const int theISection) const
-{
- return mySections.at(theISection)->myName;
-}
-
-//=======================================================================
-// function: setType
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::setType
- (const CurveCreator::Type theType, const int theISection)
-{
- if (theISection == -1) {
- int i = 0;
- const int aNbSections = getNbSections();
-
- for (; i < aNbSections; i++) {
- mySections[i]->myType = theType;
- }
- if( myListener )
- myListener->curveChanged();
- } else {
- if( mySections.at(theISection)->myType != theType ){
- mySections.at(theISection)->myType = theType;
- if( myListener )
- myListener->sectionTypeChanged(theISection);
- }
- }
-}
-
-//=======================================================================
-// function: addSection
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::addSection
- (const std::string& theName,
- const CurveCreator::Type theType,
- const bool theIsClosed,
- const CurveCreator::Coordinates &thePoints)
-{
- CurveCreator_Section *aSection = new CurveCreator_Section;
-
- std::string aName = theName;
- if( aName.empty() ){
- aName = getUnicSectionName();
- }
- aSection->myName = aName;
- aSection->myType = theType;
- aSection->myIsClosed = theIsClosed;
- aSection->myPoints = thePoints;
- mySections.push_back(aSection);
- if( myListener )
- myListener->sectionAdded( -1 );
-}
-
-//=======================================================================
-// function: removeSection
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::removeSection(const int theISection)
-{
- if (theISection == -1) {
- delete mySections.back();
- mySections.pop_back();
- } else {
- Sections::iterator anIterRm = mySections.begin() + theISection;
-
- delete *anIterRm;
- mySections.erase(anIterRm);
- }
- if( myListener )
- myListener->sectionRemoved(theISection);
-}
-
-//=======================================================================
-// function: insertPoints
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::insertPoints
- (const CurveCreator::Coordinates &thePoints,
- const int theISection,
- const int theIPnt)
-{
- if (theIPnt == -1) {
- // Add points to the end of section points.
- addPoints(thePoints, theISection);
- } else {
- CurveCreator_Section *aSection =
- (theISection == -1 ? mySections.back() : mySections.at(theISection));
-
- aSection->myPoints.insert(aSection->myPoints.begin() + toICoord(theIPnt),
- thePoints.begin(), thePoints.end());
- if( myListener )
- myListener->pointInserted( theISection, theIPnt );
- }
-}
-
-void CurveCreator_ICurve::movePoint(const int theISection, const int theIPointFrom, const int theNewIndex)
-{
- CurveCreator::Coordinates aCoords = getCoordinates(theISection, theIPointFrom );
- insertPoints(aCoords, theISection, theNewIndex+1);
- int aRemPntIndx = theIPointFrom;
- if( theNewIndex < theIPointFrom )
- aRemPntIndx++;
- removePoints(theISection, aRemPntIndx, 1 );
-}
-
-//=======================================================================
-// function: removePoints
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::removePoints(const int theISection,
- const int theIPnt,
- const int theNbPoints)
-{
- CurveCreator_Section *aSection = mySections.at(theISection);
- CurveCreator::Coordinates::iterator anIterBegin =
- aSection->myPoints.begin() + toICoord(theIPnt);
- CurveCreator::Coordinates::iterator anIterEnd =
- (theNbPoints == -1 ?
- aSection->myPoints.end() : anIterBegin + toICoord(theNbPoints));
-
- aSection->myPoints.erase(anIterBegin, anIterEnd);
- if( myListener )
- myListener->pointRemoved(theISection, theIPnt, theNbPoints );
-}
-
-//=======================================================================
-// function: clear
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::clear()
-{
- // Delete all allocated data.
- int i = 0;
- const int aNbSections = getNbSections();
-
- for (; i < aNbSections; i++) {
- delete mySections[i];
- }
-
- mySections.clear();
- if( myListener )
- myListener->curveChanged();
-}
-
-//=======================================================================
-// function: setCoordinates
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::setCoordinates
- (const CurveCreator::Coordinates &theCoords,
- const int theISection,
- const int theIPnt)
-{
- if (theCoords.size() == myDimension) {
- CurveCreator_Section *aSection = mySections.at(theISection);
- int i;
-
- for (i = 0; i < myDimension; i++) {
- aSection->myPoints.at(toICoord(theIPnt) + i) = theCoords[i];
- }
-
- if( myListener )
- myListener->pointChanged( theISection, theIPnt );
- }
-}
-
-//=======================================================================
-// function: setClosed
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::setClosed(const bool theIsClosed,
- const int theISection)
-{
- if (theISection == -1) {
- int aSize = mySections.size();
- int i;
-
- for (i = 0; i < aSize; i++) {
- mySections[i]->myIsClosed = theIsClosed;
- if( myListener ){
- myListener->sectionClosed( theISection, theIsClosed );
- }
- }
- } else {
- mySections.at(theISection)->myIsClosed = theIsClosed;
- if( myListener ){
- myListener->sectionClosed( theISection, theIsClosed );
- }
- }
-}
-
-/** Set name of the specified section.
- */
-void CurveCreator_ICurve::setName( const std::string& theName, const int theISection )
-{
- if( ( theISection >= 0 ) && ( theISection < mySections.size() )){
- mySections.at(theISection)->myName = theName;
- }
-}
-
-//=======================================================================
-// function: moveSection
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::moveSection(const int theISection,
- const int theNewIndex)
-{
- if (theISection != theNewIndex) {
- CurveCreator_Section *aSection = mySections.at(theISection);
-
- // Remove section
- Sections::iterator anIter = mySections.begin() + theISection;
-
- mySections.erase(anIter);
-
- // Insert section.
- anIter = mySections.begin() + theNewIndex;
- mySections.insert(anIter, aSection);
- }
-}
-
-//=======================================================================
-// function: join
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::join(const int theISectionTo,
- const int theISectionFrom)
-{
- if (theISectionTo != theISectionFrom) {
- CurveCreator_Section *aSection1 = mySections.at(theISectionTo);
- CurveCreator_Section *aSection2 = mySections.at(theISectionFrom);
-
- aSection1->myPoints.insert(aSection1->myPoints.end(),
- aSection2->myPoints.begin(), aSection2->myPoints.end());
-
- removeSection(theISectionFrom);
- if( myListener )
- myListener->curveChanged();
- }
-}
-
-//=======================================================================
-// function: join
-// purpose:
-//=======================================================================
-void CurveCreator_ICurve::join()
-{
- const int aSize = mySections.size();
-
- if (aSize > 1) {
- CurveCreator_Section *aSection1 = mySections[0];
- int i;
-
- for (i = 1; i < aSize; i++) {
- CurveCreator_Section *aSection2 = mySections[i];
-
- aSection1->myPoints.insert(aSection1->myPoints.end(),
- aSection2->myPoints.begin(), aSection2->myPoints.end());
- delete aSection2;
- }
-
- // Just erace section pointers as they were deleted before.
- mySections.erase(mySections.begin() + 1, mySections.end());
- if( myListener )
- myListener->curveChanged();
- }
-}
-
-//=======================================================================
-// function: toICoord
-// purpose:
-//=======================================================================
-int CurveCreator_ICurve::toICoord(const int theIPnt) const
-{
- return theIPnt*myDimension;
-}
-
-//=======================================================================
-// function: getUnicSectionName
-// purpose: return unic section name
-//=======================================================================
-std::string CurveCreator_ICurve::getUnicSectionName()
-{
- for( int i = 0 ; i < 1000000 ; i++ ){
- char aBuffer[255];
- sprintf( aBuffer, "Section_%d", i+1 );
- std::string aName(aBuffer);
- int j;
- for( j = 0 ; j < mySections.size() ; j++ ){
- if( mySections[j]->myName == aName )
- break;
- }
- if( j == mySections.size() )
- return aName;
- }
- return "";
-}
-
-//=======================================================================
-// function: setListener
-// purpose: set curve changes listener
-//=======================================================================
-void CurveCreator_ICurve::setListener( CurveCreator_Listener* theListener )
-{
- myListener = theListener;
-}
-
-//=======================================================================
-// function: setListener
-// purpose: set curve changes listener
-//=======================================================================
-void CurveCreator_ICurve::removeListener()
-{
- myListener = NULL;
-}
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: CurveCreator_Curve.hxx
-// Author: Sergey KHROMOV
+// File: CurveCreator_ICurve.hxx
+// Author: Alexander KOVALEV and Alexander SOLOVYOV
#ifndef _CurveCreator_ICurve_HeaderFile
#define _CurveCreator_ICurve_HeaderFile
-#include "CurveCreator.hxx"
#include "CurveCreator_Macro.hxx"
-#include "CurveCreator_Operation.hxx"
+#include <deque>
+#include <vector>
+#include <string>
+#include <list>
-class CurveCreator_Section;
-class CurveCreator_Listener;
+class Handle_AIS_InteractiveObject;
+
+namespace CurveCreator
+{
+ //! Type of the section
+ enum SectionType
+ {
+ Polyline,
+ Spline,
+ };
+
+ //! Dimension of the curve
+ enum Dimension
+ {
+ Dim2d = 2,
+ Dim3d = 3
+ };
+
+};
/**
* The CurveCreator_ICurve object is represented as one or more sets of
* connected points; thus CurveCreator_ICurve object can contain several
* not connected curves (polylines or b-splines), each such curve has two
- * only ends � start and end points � in other words non-manifold curves
+ * only ends "start and end points" in other words non-manifold curves
* are not supported.
*/
class CURVECREATOR_EXPORT CurveCreator_ICurve
{
+public:
+ typedef std::pair<int,int> SectionToPoint;
+ typedef std::deque<SectionToPoint> SectionToPointList;
- //! List of curves
- typedef std::deque<CurveCreator_Section *> Sections;
+ typedef std::deque< std::pair< SectionToPoint,std::deque< float > > > SectionToPointCoordsList;
public:
- //! Constructor of the curve.
- /** The dimension is explicitly specified in the constructor
- * and cannot be changed later.
- */
- CurveCreator_ICurve(const CurveCreator::Dimension theDimension);
+ /***********************************************/
+ /*** Undo/Redo methods ***/
+ /***********************************************/
- //! Destructor.
- virtual ~CurveCreator_ICurve();
+ //! Get number of available undo operations
+ virtual int getNbUndo() const = 0;
- //! Returns true if this curve is locked by a curve editor.
- virtual bool isLocked() const;
+ //! Undo previous operation
+ virtual bool undo() = 0;
- //! Get the dimension.
- virtual CurveCreator::Dimension getDimension() const;
+ //! Get number of available redo operations
+ virtual int getNbRedo() const = 0;
- //! Get number of sections.
- virtual int getNbSections() const;
+ //! Redo last previously "undone" operation
+ virtual bool redo() = 0;
- /** Get number of points in specified section or (the total number of points
- * in Curve if theISection is equal to -1).
- */
- virtual int getNbPoints(const int theISection = -1) const;
- //! Get coordinates of specified point
- virtual CurveCreator::Coordinates getCoordinates
- (const int theISection, const int theIPnt) const;
+ /***********************************************/
+ /*** Section methods ***/
+ /***********************************************/
- //! Get points of a section.
- virtual const CurveCreator::Coordinates &getPoints(const int theISection) const;
+ //! Clear the polyline (remove all sections)
+ virtual bool clear() = 0;
- //! Get type of the specified section
- virtual CurveCreator::Type getType(const int theISection) const;
+ //! Join list of sections to one section (join all if the list is empty)
+ // The first section in the list is a leader, another sections are joined to it
+ virtual bool join( const std::list<int>& theSections ) = 0;
- //! Get �closed� flag of the specified section
- virtual bool isClosed(const int theISection) const;
+ //! Get number of sections
+ virtual int getNbSections() const = 0;
- //! Returns specifyed section name
- virtual std::string getSectionName(const int theISection) const;
+ //! Add a new section.
+ virtual int addSection( const std::string& theName,
+ const CurveCreator::SectionType theType,
+ const bool theIsClosed ) = 0;
- /**
- * Return unic section name
- */
- virtual std::string getUnicSectionName();
+ //! Removes the given sections.
+ virtual bool removeSection( const int theISection ) = 0;
- /**
- * Set curve creator listener object
- */
- virtual void setListener( CurveCreator_Listener* myWatcher );
+ //! Get "closed" flag of the specified section
+ virtual bool isClosed( const int theISection ) const = 0;
/**
- * Remove curve creator listener object
+ * Set "closed" flag of the specified section (all sections if
+ * \a theISection is -1).
*/
- virtual void removeListener();
+ virtual bool setClosed( const int theISection,
+ const bool theIsClosed ) = 0;
-protected:
+ //! Returns specifyed section name
+ virtual std::string getSectionName( const int theISection ) const = 0;
- /** Set type of the specified section (or all sections
- * if \a theISection is -1).
- */
- virtual void setType(const CurveCreator::Type theType, const int theISection = -1);
+ /** Set name of the specified section */
+ virtual bool setSectionName( const int theISection,
+ const std::string& theName ) = 0;
- /** Add points to the specified section (or last section
+ //! Get type of the specified section
+ virtual CurveCreator::SectionType getSectionType( const int theISection ) const = 0;
+
+ /**
+ * Set type of the specified section (or all sections
* if \a theISection is -1).
*/
- virtual void addPoints
- (const CurveCreator::Coordinates &thePoints, const int theISection = -1) = 0;
-
- //! Add a new section.
- virtual void addSection (const std::string &theName, const CurveCreator::Type theType,
- const bool theIsClosed,
- const CurveCreator::Coordinates &thePoints);
+ virtual bool setSectionType( const int theISection,
+ const CurveCreator::SectionType theType ) = 0;
- //! Removes the section. If theISection equals -1, removes the last section.
- virtual void removeSection(const int theISection = -1);
- /** Insert points in the given position (add to the end of list
- * if \a theIPnt parameter is -1) of the specified section
- * (or last section if \a theISection parameter is -1).
- */
- virtual void insertPoints(const CurveCreator::Coordinates &thePoints,
- const int theISection = -1,
- const int theIPnt = -1);
+ /***********************************************/
+ /*** Point methods ***/
+ /***********************************************/
- /** Remove \a nbPoints points from given \a theISection,
- * starting from given \a theIPnt (of all points up to the end of
- * section if \a theNbPoints is -1).
- */
- virtual void removePoints(const int theISection,
- const int theIPnt,
- const int theNbPoints = -1);
+ //! Get the dimension.
+ virtual CurveCreator::Dimension getDimension() const = 0;
- /** Move specified point within section to new position
+ /**
+ * Insert one or several points to the specified section starting from the given theIPnt index
+ * (or add these at the end of section points if \a theIPnt is -1).
*/
- virtual void movePoint(const int theISection,
- const int theIPointFrom,
- const int theNewIndex);
-
- //! Remove all sections.
- virtual void clear();
+ virtual bool addPoints( const std::deque<float>& theCoords,
+ const int theISection,
+ const int theIPnt = -1 ) = 0;
//! Set coordinates of specified point
- virtual void setCoordinates(const CurveCreator::Coordinates &theCoords,
- const int theISection,
- const int theIPnt);
+ virtual bool setPoint( const int theISection,
+ const int theIPnt,
+ const std::deque<float>& theNewCoords ) = 0;
+
+ //! Set coordinates of specified points from different sections
+ virtual bool setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
+ const bool theIsToSaveDiff = true ) = 0;
+
+ //! Remove point with given id
+ virtual bool removePoint( const int theISection, const int theIPnt = -1 ) = 0;
+ //! Remove several points from different sections
+ virtual bool removeSeveralPoints( const SectionToPointList &theSectionToPntIDs) = 0;
- /** Set �closed� flag of the specified section (all sections if
- * \a theISection is -1).
- */
- virtual void setClosed(const bool theIsClosed, const int theISection = -1);
+ //! Get coordinates of specified point
+ virtual std::deque<float> getPoint( const int theISection,
+ const int theIPnt ) const = 0;
- /** Set name of the specified section.
+ /**
+ * Get points of a section (the total points in Curve if theISection is equal to -1)..
*/
- virtual void setName( const std::string& theName, const int theISection );
+ virtual std::deque<float> getPoints( const int theISection = -1 ) const = 0;
- /** Move specified \a theISection to the specified position
- * in the sections list.
+ /**
+ * Get number of points in specified section or (the total number of points
+ * in Curve if theISection is equal to -1).
*/
- virtual void moveSection(const int theISection, const int theNewIndex);
+ virtual int getNbPoints( const int theISection ) const = 0;
- //! Join two sections to one section
- virtual void join(const int theISectionTo, const int theISectionFrom);
+ /**
+ * Set skip sorting flag. If the flag is true - points sorting will be skipped.
+ */
+ virtual void setSkipSorting( const bool ) = 0;
- //! Join all sections to the single curve
- virtual void join();
+ /**
+ * Indicates whether the points can be sorted.
+ */
+ virtual bool canPointsBeSorted() = 0;
/**
- * This method converts the point index to the index in
- * an array of coordinates.
+ * Saves points coordinates difference.
+ * \param theOldCoords the old points coordinates
*/
- virtual int toICoord(const int theIPnt) const;
+ virtual void saveCoordDiff( const SectionToPointCoordsList &theOldCoords ) = 0;
-public:
+ /***********************************************/
+ /*** Presentation methods ***/
+ /***********************************************/
- bool myIsLocked;
- Sections mySections; //!< curve data
- CurveCreator::Dimension myDimension; //!< curve dimension
- CurveCreator_Listener* myListener; //!< listener
+ virtual Handle_AIS_InteractiveObject getAISObject( const bool theNeedToBuild = false ) const = 0;
+
+protected:
+ virtual void constructAISObject() = 0;
};
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef CURVE_CREATOR_LISTENER_HXX
-#define CURVE_CREATOR_LISTENER_HXX
-
-class CurveCreator_Listener
-{
-public:
- CurveCreator_Listener(void){};
- virtual ~CurveCreator_Listener(void){};
-
- virtual void pointChanged( int theSection, int thePoint ){}
- virtual void pointRemoved( int theSection, int theFirstPoint, int thePointCnt ){}
- virtual void pointInserted( int theSection, int theIndx ){}
-
- virtual void sectionClosed( int theSection, bool isClosed ){}
- virtual void sectionAdded( int theSection ){}
- virtual void sectionRemoved( int theSection ){}
- virtual void sectionTypeChanged( int theSection ){}
-
- virtual void curveChanged(){}
-};
-
-#endif
\ No newline at end of file
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "CurveCreator_NewPointDlg.h"
-
-#include <QGridLayout>
-#include <QVBoxLayout>
-#include <QLabel>
-#include <QDoubleSpinBox>
-#include <QDialogButtonBox>
-#include <QDoubleValidator>
-#include <QRegExpValidator>
-#include <QAbstractButton>
-#include <QPushButton>
-#include <QLocale>
-
-CurveCreator_NewPointDlg::CurveCreator_NewPointDlg(CurveCreator::Dimension theDim, QWidget *parent) :
- QWidget(parent), myX(NULL), myY(NULL), myZ(NULL), myIsEdit(false), myDim(theDim),
- myIsInstantSketchingEnabled(false)
-{
- QString aTitle = QString(tr("ADD_NEW_POINT"));
- setWindowTitle(aTitle);
-
- QFrame* aFrame = new QFrame( this );
- QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
-
- QFrame* aCoordFrame = new QFrame( aFrame );
- QGridLayout* aCoordLayout = new QGridLayout( aCoordFrame );
-
- QLabel* aLbl = new QLabel( tr("X_COORD"), this);
- myX = new QDoubleSpinBox(this);
- aCoordLayout->addWidget(aLbl, 0, 0);
- aCoordLayout->addWidget(myX, 0, 1 );
-
- aLbl = new QLabel( tr("Y_COORD"), this);
- myY = new QDoubleSpinBox(this);
- aCoordLayout->addWidget(aLbl, 1, 0 );
- aCoordLayout->addWidget(myY, 1, 1 );
-
- myZLabel = new QLabel( tr("Z_COORD"), this);
- myZ = new QDoubleSpinBox(this);
- aCoordLayout->addWidget(myZLabel, 2,0 );
- aCoordLayout->addWidget(myZ, 2,1 );
-
- if( theDim != CurveCreator::Dim3d ){
- myZ->hide();
- myZLabel->hide();
- }
-
- myBtnFrame = new QFrame( aFrame );
- QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
-
- myAddBtn = new QPushButton( tr( "ADD_BTN" ), myBtnFrame );
- myCancelBtn = new QPushButton( tr( "CANCEL" ), myBtnFrame );
-
- connect( myCancelBtn, SIGNAL( clicked() ), this, SIGNAL( cancelPoint() ) );
-
- aBtnsLayout->addWidget( myAddBtn );
- aBtnsLayout->addStretch( 1 );
- aBtnsLayout->addWidget( myCancelBtn );
-
- aLayout->addWidget( aCoordFrame, 0 );
- aLayout->addWidget( myBtnFrame, 1 );
-
- clear();
- updateTitle();
-}
-
-void CurveCreator_NewPointDlg::setSectionName( const QString& theName )
-{
- mySectionName = theName;
- updateTitle();
-}
-
-void CurveCreator_NewPointDlg::setEditMode( bool isEdit )
-{
- myIsEdit = isEdit;
- if( myIsEdit ){
- myAddBtn->setText(tr("OK"));
- myAddBtn->disconnect( SIGNAL( clicked() ) );
- connect( myAddBtn, SIGNAL( clicked() ), this, SIGNAL( modifyPoint() ) );
- }
- else{
- myAddBtn->setText(tr("ADD_BTN"));
- myAddBtn->disconnect( SIGNAL( clicked() ) );
- connect( myAddBtn, SIGNAL( clicked() ), this, SIGNAL( addPoint() ) );
- }
- updateTitle();
-}
-
-void CurveCreator_NewPointDlg::updateTitle()
-{
- QString aTitle;
- if( !myIsEdit ){
- if( mySectionName.isEmpty() ){
- aTitle = tr("ADD_NEW_POINT");
- }
- else{
- aTitle = QString(tr("ADD_NEW_POINT_TO_%1")).arg(mySectionName);
- }
- }
- else{
- aTitle = tr("SET_POINT_COORDINATES");
- }
- setWindowTitle(aTitle);
-}
-
-CurveCreator::Coordinates CurveCreator_NewPointDlg::getCoordinates() const
-{
- CurveCreator::Coordinates aCoords;
- double anX = myX->value();
- aCoords.push_back(anX);
- double anY = myY->value();
- aCoords.push_back(anY);
- if( myDim == CurveCreator::Dim3d ){
- double aZ = myZ->value();
- aCoords.push_back(aZ);
- }
- return aCoords;
-}
-
-void CurveCreator_NewPointDlg::clear()
-{
- initSpinBox(myX);
- initSpinBox(myY);
- initSpinBox(myZ);
-}
-
-void CurveCreator_NewPointDlg::setDimension(CurveCreator::Dimension theDim)
-{
- if( theDim == CurveCreator::Dim2d ){
- myZ->hide();
- myZLabel->hide();
- }
- else{
- myZ->show();
- myZLabel->show();
- }
-}
-
-void CurveCreator_NewPointDlg::setCoordinates( const CurveCreator::Coordinates& theCoords )
-{
- double anX = theCoords[0];
- myX->setValue(anX);
- double anY = theCoords[1];
- myY->setValue(anY);
- if( theCoords.size() == 3 ){
- double aZ = theCoords[2];
- myZ->setValue(aZ);
- }
- if( isInstantSketchingEnabled() )
- emit addPoint();
-}
-
-bool CurveCreator_NewPointDlg::isInstantSketchingEnabled() const
-{
- return myIsInstantSketchingEnabled;
-}
-
-void CurveCreator_NewPointDlg::setInstantSketchingEnabled( const bool theState )
-{
- myIsInstantSketchingEnabled = theState;
-}
-
-//=======================================================================
-// function: initSpinBox
-// purpose:
-//=======================================================================
-void CurveCreator_NewPointDlg::initSpinBox(QDoubleSpinBox *theSpinBox)
-{
- const double aCoordMin = -1.e+15;
- const double aCoordMax = 1.e+15;
- const double aStep = 10;
- const int aPrecision = 6;
-
- theSpinBox->setDecimals( qAbs( aPrecision ) );
- theSpinBox->setRange(aCoordMin, aCoordMax);
- theSpinBox->setSingleStep(aStep);
- theSpinBox->setValue(0.0);
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef CURVECREATOR_NEWPOINTDLG_H
-#define CURVECREATOR_NEWPOINTDLG_H
-
-#include "CurveCreator.hxx"
-
-#include <QDockWidget>
-
-class QDoubleSpinBox;
-class QDialogButtonBox;
-class QAbstractButton;
-class QPushButton;
-class QLabel;
-class QFrame;
-
-class CurveCreator_NewPointDlg : public QWidget
-{
- Q_OBJECT
-public:
- explicit CurveCreator_NewPointDlg(CurveCreator::Dimension theDim, QWidget *parent = 0);
- CurveCreator::Coordinates getCoordinates() const;
- void clear();
- void setSectionName( const QString& theName );
- void setEditMode( bool isEdit );
- void setCoordinates( const CurveCreator::Coordinates& theCoords );
- void setDimension(CurveCreator::Dimension theDim);
- bool isInstantSketchingEnabled() const;
- void setInstantSketchingEnabled( const bool theState );
-signals:
- void addPoint();
- void modifyPoint();
- void cancelPoint();
-public slots:
-protected slots:
-protected:
- void updateTitle();
- void initSpinBox(QDoubleSpinBox *theSpinBox);
-private:
- QFrame* myBtnFrame;
- CurveCreator::Dimension myDim;
- QDoubleSpinBox* myX;
- QDoubleSpinBox* myY;
- QDoubleSpinBox* myZ;
- QLabel* myZLabel;
- QPushButton* myAddBtn;
- QPushButton* myCancelBtn;
- bool myIsEdit;
- QString mySectionName;
- bool myIsInstantSketchingEnabled;
-};
-
-#endif // CURVECREATOR_NEWPOINTDLG_H
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include "CurveCreator_NewSectionDlg.h"
-#include "CurveCreator_Curve.hxx"
+//#include "CurveCreator_Curve.hxx"
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <QDialogButtonBox>
#include <QPushButton>
-CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent ) :
- QWidget(parent)
+CurveCreator_NewSectionDlg::CurveCreator_NewSectionDlg( QWidget *parent, bool enableClosed ) :
+ QWidget(parent), myIsEnableClosed( enableClosed )
{
+ QVBoxLayout* aMainLayout = new QVBoxLayout( this );
+ aMainLayout->setMargin( 0 );
+
QFrame* aFrame = new QFrame( this );
+ aMainLayout->addWidget( aFrame );
+
QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
+ aLayout->setMargin( 0 );
QFrame* aCoordFrame = new QFrame( aFrame );
QGridLayout* aCoordLayout = new QGridLayout( aCoordFrame );
- QLabel* aLbl = new QLabel(tr("NAME"), this);
+ QLabel* aLbl = new QLabel(tr("SECTION_NAME"), this);
myName = new QLineEdit(this);
aCoordLayout->addWidget(aLbl, 0, 0);
aCoordLayout->addWidget(myName, 0 , 1);
- aLbl = new QLabel(tr("LINE_TYPE"));
+ aLbl = new QLabel(tr("SECTION_LINE_TYPE"));
myLineType = new QComboBox(this);
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
// QPixmap aPolylinePixmap = QPixmap(tr(":images/ICON_POLYLINE"));
// QPixmap aSplinePixmap = QPixmap(tr(":images/ICON_SPLINE"));
- myLineType->addItem(aPolylinePixmap, tr("POLYLINE_TYPE"));
- myLineType->addItem(aSplinePixmap, tr("SPLINE_TYPE"));
+ myLineType->addItem(aPolylinePixmap, tr("SECTION_POLYLINE_TYPE"));
+ myLineType->addItem(aSplinePixmap, tr("SECTION_SPLINE_TYPE"));
myLineType->setCurrentIndex(0);
aCoordLayout->addWidget(aLbl, 1, 0);
aCoordLayout->addWidget(myLineType, 1 , 1);
- aLbl = new QLabel(tr("LINE_CLOSED"));
+ aLbl = new QLabel(tr("SECTION_LINE_CLOSED"));
myIsClosed = new QCheckBox(this);
aCoordLayout->addWidget(aLbl, 2, 0);
aCoordLayout->addWidget(myIsClosed, 2, 1);
+ if ( !myIsEnableClosed ) {
+ aLbl->hide();
+ myIsClosed->hide();
+ }
myBtnFrame = new QFrame( aFrame );
QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
- myAddBtn = new QPushButton( tr( "ADD_BTN" ), myBtnFrame );
- myCancelBtn = new QPushButton( tr( "CANCEL" ), myBtnFrame );
+ myAddBtn = new QPushButton( tr( "SECTION_ADD_BTN" ), myBtnFrame );
+ myCancelBtn = new QPushButton( tr( "SECTION_CANCEL_BTN" ), myBtnFrame );
connect( myAddBtn, SIGNAL( clicked() ), this, SIGNAL( addSection() ) );
connect( myCancelBtn, SIGNAL( clicked() ), this, SIGNAL( cancelSection() ) );
aLayout->addWidget( myBtnFrame, 1 );
}
-void CurveCreator_NewSectionDlg::setSectionParameters( const QString& theName, bool isClosed, CurveCreator::Type theType )
+void CurveCreator_NewSectionDlg::setSectionParameters( const QString& theName, bool isClosed, CurveCreator::SectionType theType )
{
myName->setText(theName);
myIsClosed->setChecked(isClosed);
{
myIsEdit = isEdit;
if( myIsEdit ){
- myAddBtn->setText(tr("OK"));
+ myAddBtn->setText(tr("SECTION_OK_BTN"));
myAddBtn->disconnect( SIGNAL( clicked() ) );
connect( myAddBtn, SIGNAL( clicked() ), this, SIGNAL( modifySection() ) );
}
else{
- myAddBtn->setText(tr("ADD_BTN"));
+ myAddBtn->setText(tr("SECTION_ADD_BTN"));
myAddBtn->disconnect( SIGNAL( clicked() ) );
connect( myAddBtn, SIGNAL( clicked() ), this, SIGNAL( addSection() ) );
}
return myIsClosed->isChecked();
}
-CurveCreator::Type CurveCreator_NewSectionDlg::getSectionType() const
+CurveCreator::SectionType CurveCreator_NewSectionDlg::getSectionType() const
{
if( myLineType->currentIndex() == 0 )
return CurveCreator::Polyline;
else
- return CurveCreator::BSpline;
+ return CurveCreator::Spline;
}
void CurveCreator_NewSectionDlg::updateTitle()
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#define CURVECREATOR_NEWSECTION_H
#include "CurveCreator.hxx"
+#include "CurveCreator_ICurve.hxx"
#include <QDockWidget>
-class CurveCreator_Curve;
+//class CurveCreator_Curve;
class QLineEdit;
class QComboBox;
{
Q_OBJECT
public:
- explicit CurveCreator_NewSectionDlg(QWidget *parent = 0);
+ explicit CurveCreator_NewSectionDlg(QWidget *parent = 0, bool enableClosed = true );
QString getName() const;
bool isClosed() const;
- CurveCreator::Type getSectionType() const;
+ CurveCreator::SectionType getSectionType() const;
- void setSectionParameters( const QString& theName, bool isClosed, CurveCreator::Type theType );
+ void setSectionParameters( const QString& theName, bool isClosed, CurveCreator::SectionType theType );
void setSectionName(const QString& theName );
void clear();
void setEditMode( bool isEdit );
+ bool isEnableClosed() const { return myIsEnableClosed; }
signals:
void addSection();
QComboBox* myLineType;
QCheckBox* myIsClosed;
bool myIsEdit;
+ bool myIsEnableClosed;
QPushButton* myAddBtn;
QPushButton* myCancelBtn;
};
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "CurveCreator_Operation.hxx"
#include "CurveCreator_Curve.hxx"
+#include "CurveCreator.hxx"
#include <string>
#include <stdlib.h>
clear();
}
+bool compId(CurveCreator_PosPoint* p1, CurveCreator_PosPoint* p2)
+{
+ return p1->myID < p2->myID;
+}
+
//=======================================================================
// function: Constructor
// purpose:
{
bool isOK = false;
- if (theType == CurveCreator_Operation::Clear ||
- theType == CurveCreator_Operation::Join) {
+ if (theType == CurveCreator_Operation::Clear) {
clear();
myType = theType;
isOK = true;
// function: Constructor
// purpose:
//=======================================================================
-bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
- const int theIntParam1,
- const int theIntParam2,
- const int theIntParam3)
+bool CurveCreator_Operation::init(const Type theType, const std::list<int> theParamList)
{
bool isOK = false;
- if (theType == CurveCreator_Operation::RemovePoints) {
- int *pData = (int *)allocate(3*sizeof(int));
-
- pData[0] = theIntParam1;
- pData[1] = theIntParam2;
- pData[2] = theIntParam3;
- myType = theType;
- isOK = true;
- }
-
- return isOK;
-}
-
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
- const CurveCreator::Coordinates &theCoords,
- const int theIntParam)
-{
- bool isOK = false;
+ if (theType == CurveCreator_Operation::Join)
+ {
+ const int aNbPoints = theParamList.size();
- if (theType == CurveCreator_Operation::AddPoints) {
- const int aNbCoords = theCoords.size();
const size_t aSize =
- 2*sizeof(theIntParam) + aNbCoords*sizeof(CurveCreator::TypeCoord);
- int *pIntData = (int *)allocate(aSize);
-
- *pIntData++ = theIntParam;
- *pIntData++ = aNbCoords;
+ sizeof(aNbPoints) +
+ aNbPoints * (sizeof(int));
- CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
- int i = 0;
+ int *pIntData = (int *)allocate(aSize);
- for (; i < aNbCoords; i++) {
- *pRealData++ = theCoords[i];
- }
+ *pIntData++ = aNbPoints;
+ std::list<int>::const_iterator anIt = theParamList.begin(), aLast = theParamList.end();
+ for ( ; anIt != aLast; anIt++ )
+ *pIntData++ = *anIt;
- myType = theType;
+ myType = theType;
isOK = true;
}
-
return isOK;
}
//=======================================================================
bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
const CurveCreator::Coordinates &theCoords,
- const int theIntParam1,
- const int theIntParam2)
+ const int theIntParam)
{
bool isOK = false;
- if (theType == CurveCreator_Operation::AddSection ||
- theType == CurveCreator_Operation::InsertPoints ||
- theType == CurveCreator_Operation::SetCoordinates) {
+ if (theType == CurveCreator_Operation::AddPoints) {
const int aNbCoords = theCoords.size();
const size_t aSize =
- 3*sizeof(theIntParam1) + aNbCoords*sizeof(CurveCreator::TypeCoord);
+ 2*sizeof(theIntParam) + aNbCoords*sizeof(CurveCreator::TypeCoord);
int *pIntData = (int *)allocate(aSize);
- *pIntData++ = theIntParam1;
- *pIntData++ = theIntParam2;
+ *pIntData++ = theIntParam;
*pIntData++ = aNbCoords;
CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
pIntData = (int*)aStrPtr;
*pIntData++ = aNbCoords;
- CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)aStrPtr;
+ CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
int i = 0;
for (; i < aNbCoords; i++) {
return false;
}
+bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
+ const CurveCreator_ICurve::SectionToPointCoordsList &theParamList1)
+{
+ bool isOK = false;
+
+ if (theType == CurveCreator_Operation::InsertPoints ||
+ theType == CurveCreator_Operation::SetCoordinates ) {
+
+ const int aNbPoints = theParamList1.size();
+
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt =
+ theParamList1.begin();
+ const int aNbCoords = anIt->second.size();
+
+ const size_t aSize =
+ sizeof(aNbPoints) + sizeof(aNbCoords) +
+ aNbPoints * (3*sizeof(int) + aNbCoords*sizeof(CurveCreator::TypeCoord));
+ int *pIntData = (int *)allocate(aSize);
+
+ *pIntData++ = aNbPoints;
+ *pIntData++ = aNbCoords;
+ int aSectionId, aPointId;
+ for ( ; anIt != theParamList1.end(); anIt++ ) {
+ aSectionId = anIt->first.first;
+ aPointId = anIt->first.second;
+
+ *pIntData++ = aSectionId;
+ *pIntData++ = aPointId;
+ *pIntData++ = aNbCoords;
+
+ const CurveCreator::Coordinates &aCoords = anIt->second;
+ CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
+ for (int i = 0; i < aNbCoords; i++) {
+ *pRealData++ = aCoords[i];
+ }
+ pIntData = (int *)pRealData;
+ }
+
+ myType = theType;
+ isOK = true;
+ }
+
+ return isOK;
+}
+
+bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
+ const CurveCreator_ICurve::SectionToPointList &theParamList1)
+{
+ bool isOK = false;
+
+ if (theType == CurveCreator_Operation::RemovePoints) {
+ const int aNbPoints = theParamList1.size();
+
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt =
+ theParamList1.begin();
+
+ const size_t aSize =
+ sizeof(aNbPoints) +
+ aNbPoints * (2*sizeof(int));
+ int *pIntData = (int *)allocate(aSize);
+
+ *pIntData++ = aNbPoints;
+ int aSectionId, aPointId;
+ for ( ; anIt != theParamList1.end(); anIt++ ) {
+ aSectionId = anIt->first;
+ aPointId = anIt->second;
+
+ *pIntData++ = aSectionId;
+ *pIntData++ = aPointId;
+ }
+
+ myType = theType;
+ isOK = true;
+ }
+
+ return isOK;
+}
+
//=======================================================================
// function: apply
// purpose:
switch (myType) {
case CurveCreator_Operation::AddPoints:
+ case CurveCreator_Operation::InsertPoints:
+ case CurveCreator_Operation::SetCoordinates:
{
+ int aSectionId, aPointId;
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPoints;
CurveCreator::Coordinates aCoords;
- getCoords(&pInt[1], aCoords);
- theCurve->addPoints(aCoords, pInt[0]);
+ int nbPoints = pInt[0];
+ int nbCoords = pInt[1];
+ int nbParams = 3+nbCoords;
+ for (int i = 0; i < nbPoints*nbParams; i=i+nbParams) {
+ aCoords.clear();
+ aPoints.clear();
+ getCoords(&pInt[4+i], aCoords);
+ aSectionId = pInt[2+i];
+ aPointId = pInt[3+i];
+ if ( aSectionsMap.find( aSectionId ) != aSectionsMap.end() )
+ aPoints = aSectionsMap[aSectionId];
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( aPointId, aCoords );
+ aPoints.push_back( aPosPoint );
+ aPoints.sort(compId);
+ aSectionsMap[aSectionId] = aPoints;
+ }
+ switch (myType) {
+ case CurveCreator_Operation::AddPoints:
+ case CurveCreator_Operation::InsertPoints:
+ theCurve->addPointsInternal( aSectionsMap );
+ break;
+ case CurveCreator_Operation::SetCoordinates:
+ theCurve->setPointInternal( aSectionsMap );
+ break;
+ }
}
break;
case CurveCreator_Operation::RemovePoints:
- theCurve->removePoints(pInt[0], pInt[1], pInt[2]);
- break;
- case CurveCreator_Operation::InsertPoints:
{
- CurveCreator::Coordinates aCoords;
-
- getCoords(&pInt[2], aCoords);
- theCurve->insertPoints(aCoords, pInt[0], pInt[1]);
+ CurveCreator_ICurve::SectionToPointList aListOfSectionsToPoints;
+ int nbPoints = pInt[0];
+ for (int i = 1; i < nbPoints*2; i=i+2) {
+ aListOfSectionsToPoints.push_back(std::make_pair(pInt[i], pInt[i+1]));
+ }
+ theCurve->removePointsInternal(aListOfSectionsToPoints);
}
break;
case CurveCreator_Operation::SetType:
{
- const CurveCreator::Type aType = (CurveCreator::Type) pInt[0];
+ const CurveCreator::SectionType aType = (CurveCreator::SectionType) pInt[0];
- theCurve->setType(aType, pInt[1]);
+ theCurve->setSectionTypeInternal( pInt[1], aType );
}
break;
case CurveCreator_Operation::Clear:
- theCurve->clear();
- break;
- case CurveCreator_Operation::SetCoordinates:
- {
- CurveCreator::Coordinates aCoords;
-
- getCoords(&pInt[2], aCoords);
- theCurve->setCoordinates(aCoords, pInt[0], pInt[1]);
- }
+ theCurve->clearInternal();
break;
case CurveCreator_Operation::SetClosed:
- theCurve->setClosed((pInt[0] != 0), pInt[1]);
+ theCurve->setClosedInternal(pInt[1], (pInt[0] != 0));
break;
case CurveCreator_Operation::MoveSection:
- theCurve->moveSection(pInt[0], pInt[1]);
+ theCurve->moveSectionInternal(pInt[0], pInt[1]);
break;
case CurveCreator_Operation::Join:
- if (myPData == NULL) {
- theCurve->join();
- } else {
- theCurve->join(pInt[0], pInt[1]);
+ if (myPData != NULL)
+ {
+ std::list<int> aListOfSections;
+ int nbSections = pInt[0];
+ for (int i = 1; i < nbSections+1; i++) {
+ aListOfSections.push_back(pInt[i]);
+ }
+ theCurve->joinInternal(aListOfSections);
}
break;
case CurveCreator_Operation::AddSection:
{
- const CurveCreator::Type aType = (CurveCreator::Type) pInt[0];
+ const CurveCreator::SectionType aType = (CurveCreator::SectionType) pInt[0];
std::string aName = std::string((char*)&pInt[2]);
char* aPtr = ((char*)&pInt[2]);
aPtr += (aName.length()) + 1;
getCoords((int*)aPtr, aCoords);
- theCurve->addSection(aName, aType, (pInt[1] != 0), aCoords);
+ theCurve->addSectionInternal(aName, aType, (pInt[1] != 0), aCoords);
}
break;
case CurveCreator_Operation::RemoveSection:
- theCurve->removeSection(pInt[0]);
+ theCurve->removeSectionInternal(pInt[0]);
break;
case CurveCreator_Operation::RenameSection:
{
std::string aName = std::string((char*)&pInt[1]);
- theCurve->setName(aName, pInt[0]);
+ theCurve->setSectionNameInternal(pInt[0], aName);
}
break;
default:
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#define _CurveCreator_Operation_HeaderFile
#include "CurveCreator.hxx"
+#include "CurveCreator_ICurve.hxx"
+#include "CurveCreator_PosPoint.hxx"
#include <string>
+#include <vector>
class CurveCreator_Curve;
* It is applicable to the following operations:
* <UL>
* <LI>Clear</LI>
- * <LI>Join (without arguments)</LI>
* </UL>
* @return true in case of success; false otherwise.
*/
const int theIntParam2);
/**
- * This method initializes the object with an operation with three integer
+ * This method initializes the object with an operation with two integer
* parameters. It is applicable to the following operations:
* <UL>
+ * <LI>Join (with a list of int arguments)</LI>
+ * </UL>
+ * @return true in case of success; false otherwise.
+ */
+ bool init(const Type theType, const std::list<int> theParamList);
+
+ /**
+ * This method initializes the object with an operation with
+ * list of pairs of integer parameters.
+ * It is applicable to the following operations:
+ * <UL>
* <LI>RemovePoints</LI>
* </UL>
* @return true in case of success; false otherwise.
*/
- bool init(const Type theType, const int theIntParam1,
- const int theIntParam2, const int theIntParam3);
+ bool init(const Type theType,
+ const CurveCreator_ICurve::SectionToPointList &theParamList1);
/**
* This method initializes the object with an operation with one
const int theIntParam);
/**
- * This method initializes the object with an operation with one
- * CurveCreator::Coordinates parameter and two integer parameters.
+ * This method initializes the object with an operation with
+ * list of pairs of integer parameters and CurveCreator::Coordinates parameters.
* It is applicable to the following operations:
* <UL>
- * <LI>AddSection</LI>
* <LI>InsertPoints</LI>
- * <LI>SetCoordinates</LI>
* </UL>
* @return true in case of success; false otherwise.
*/
- bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
- const int theIntParam1, const int theIntParam2);
+ bool init(const Type theType,
+ const CurveCreator_ICurve::SectionToPointCoordsList &theParamList1);
/**
* This method initializes the object with an operation with one
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File: CurveCreator_PosPoint.hxx
+// Author: Alexander KOVALEV
+
+#ifndef _CurveCreator_PosPoint_HeaderFile
+#define _CurveCreator_PosPoint_HeaderFile
+
+#include "CurveCreator.hxx"
+
+struct CurveCreator_PosPoint
+{
+public:
+ CurveCreator_PosPoint( int theID, CurveCreator::Coordinates theCoords )
+ : myID( theID ), myCoords( theCoords )
+ { };
+
+ ////! Overloaded operator to use sorting.
+ //bool operator < (CurveCreator_PosPoint const & thePosPoint) const
+ //{
+ // return myID < thePosPoint.myID;
+ //}
+
+ int myID; // point ID
+ CurveCreator::Coordinates myCoords; // point coordinates
+
+};
+
+#endif
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
std::string myName; //!< section name
CurveCreator::Coordinates myPoints; //!< points coordinates
- CurveCreator::Type myType; //!< type of the section
+ CurveCreator::SectionType myType; //!< type of the section
bool myIsClosed; //!< closed or not
};
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "CurveCreator_TableView.h"
+#include "CurveCreator_UtilsICurve.hxx"
+
+#include <gp_Pnt.hxx>
+
+#include <QTableWidget>
+#include <QTableWidgetItem>
+
+#include <QtxDoubleSpinBox.h>
+
+const double DBL_MINIMUM = -10000000.;
+const double DBL_MAXIMUM = 10000000.;
+
+const int SECTION_NAME_COLUMN_WIDTH = 75;
+const int POINT_INDEX_COLUMN_WIDTH = 40;
+
+const double LOCAL_SELECTION_TOLERANCE = 0.0001;
+
+CurveCreator_TableItemDelegate::CurveCreator_TableItemDelegate( QObject* theParent )
+: QItemDelegate( theParent )
+{
+}
+
+/**
+ * Creates an editor for the cell
+ */
+QWidget* CurveCreator_TableItemDelegate::createEditor( QWidget* theParent,
+ const QStyleOptionViewItem& theOption,
+ const QModelIndex& theIndex ) const
+{
+ QWidget* anEditor = 0;
+
+ int aColumnId = theIndex.column();
+ if ( aColumnId == 2 || aColumnId == 3 ) {
+ QDoubleSpinBox* aSpin = new QtxDoubleSpinBox( theParent );
+ aSpin->setDecimals( 2 );
+ aSpin->setRange( DBL_MINIMUM, DBL_MAXIMUM );
+ anEditor = aSpin;
+ }
+ else
+ anEditor = QItemDelegate::createEditor( theParent, theOption, theIndex );
+
+ return anEditor;
+}
+
+void CurveCreator_TableItemDelegate::setEditorData( QWidget* theEditor,
+ const QModelIndex& theIndex ) const
+{
+ int aColumnId = theIndex.column();
+ if ( aColumnId == 2 || aColumnId == 3 ) {
+ QDoubleSpinBox* aDblSpin = dynamic_cast<QDoubleSpinBox*>( theEditor );
+ if ( aDblSpin ) {
+ double aValue = theIndex.model()->data( theIndex, Qt::EditRole ).toDouble();
+ aDblSpin->setValue( aValue );
+ }
+ }
+ else
+ QItemDelegate::setEditorData( theEditor, theIndex );
+}
+
+void CurveCreator_TableItemDelegate::setModelData( QWidget* theEditor,
+ QAbstractItemModel* theModel,
+ const QModelIndex& theIndex ) const
+{
+ int aColumnId = theIndex.column();
+ if ( aColumnId == 2 || aColumnId == 3 ) {
+ QDoubleSpinBox* aDblSpin = dynamic_cast<QDoubleSpinBox*>( theEditor );
+ if ( aDblSpin ) {
+ double aValue = aDblSpin->value();
+ theModel->setData( theIndex, aValue, Qt::UserRole);
+ }
+ }
+ else
+ QItemDelegate::setModelData( theEditor, theModel, theIndex );
+}
+
+CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
+ QWidget* theParent,
+ const QStringList& theCoordTitles )
+: QTableWidget( theParent ), myCurve( theCurve )
+{
+ setItemDelegate( new CurveCreator_TableItemDelegate( this ) );
+ setVisible( false );
+ setColumnCount( 4 );
+ setColumnWidth( 0, SECTION_NAME_COLUMN_WIDTH );
+ setColumnWidth( 1, POINT_INDEX_COLUMN_WIDTH );
+ QStringList aLabels;
+ QString aCoord1 = theCoordTitles.size() > 0 ? theCoordTitles[0] : tr( "TABLE_X" ); // tr( "X_POSITION_LBL" )
+ QString aCoord2 = theCoordTitles.size() > 1 ? theCoordTitles[1] : tr( "TABLE_Y" ); // tr( "Y_POSITION_LBL" )
+ //aLabels << tr( "SECTION_LABEL" ) << tr( "IDENTIFIER_LABEL" ) << aCoord1 << aCoord2;
+ aLabels << tr( "TABLE_SECTION" ) << tr("TABLE_INDEX") << aCoord1 << aCoord2;
+ setHorizontalHeaderLabels( aLabels );
+}
+
+void CurveCreator_TableView::setCurve( CurveCreator_ICurve* theCurve )
+{
+ myCurve = theCurve;
+}
+
+void CurveCreator_TableView::setLocalPointsToTable(
+ const CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ setRowCount( thePoints.size() );
+
+ int aRowId = 0;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
+ aLast = thePoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ CurveCreator_ICurve::SectionToPoint aSPoint = *anIt;
+ int anISection = aSPoint.first;
+ int anIPoint = aSPoint.second;
+
+ QTableWidgetItem* anItem;
+ anItem = new QTableWidgetItem( myCurve->getSectionName( anISection ).c_str() );
+ anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
+ anItem->setData( Qt::UserRole, anISection );
+ setItem( aRowId, 0, anItem );
+
+ anItem = new QTableWidgetItem( QString::number( anIPoint + 1 ) );
+ anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
+ anItem->setData( Qt::UserRole, anIPoint );
+ setItem( aRowId, 1, anItem );
+
+ gp_Pnt aPoint;
+ CurveCreator_UtilsICurve::getPoint( myCurve, anISection, anIPoint, aPoint );
+
+ anItem = item( aRowId, 2 );
+ if ( !anItem ) {
+ anItem = new QTableWidgetItem();
+ setItem( aRowId, 2, anItem );
+ }
+ anItem->setData( Qt::UserRole, aPoint.X() );
+ anItem->setData( Qt::DisplayRole, QString::number( aPoint.X(), 'f', 2 ) );
+
+ anItem = item( aRowId, 3 );
+ if ( !anItem ) {
+ anItem = new QTableWidgetItem();
+ setItem( aRowId, 3, anItem );
+ }
+ anItem->setData( Qt::UserRole, aPoint.Y() );
+ anItem->setData( Qt::DisplayRole, QString::number( aPoint.Y(), 'f', 2 ) );
+
+ aRowId++;
+ }
+}
+
+int CurveCreator_TableView::getSectionId( const int theRowId ) const
+{
+ return item( theRowId, 0 )->data( Qt::UserRole ).toInt();
+}
+
+/**
+ * Returns a point index from the table
+ * \param theRowId a table row
+ */
+int CurveCreator_TableView::getPointId( const int theRowId ) const
+{
+ return item( theRowId, 1 )->data( Qt::UserRole ).toInt();
+}
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef CURVECREATOR_TABLEVIEW_H
+#define CURVECREATOR_TABLEVIEW_H
+
+#include "CurveCreator_ICurve.hxx"
+
+#include <QItemDelegate>
+#include <QTableWidget>
+
+class CurveCreator_TableItemDelegate : public QItemDelegate
+{
+public:
+ CurveCreator_TableItemDelegate( QObject* theParent );
+ ~CurveCreator_TableItemDelegate() {}
+
+ virtual QWidget* createEditor( QWidget* theParent,
+ const QStyleOptionViewItem& theOption,
+ const QModelIndex& theIndex ) const;
+ virtual void setEditorData( QWidget* theEditor, const QModelIndex& theIndex ) const;
+ virtual void setModelData( QWidget* theEditor, QAbstractItemModel* theModel,
+ const QModelIndex& theIndex ) const;
+};
+
+class CurveCreator_TableView : public QTableWidget
+{
+public:
+ CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0,
+ const QStringList& theCoordTitles = QStringList() );
+ ~CurveCreator_TableView() {};
+
+ void setCurve( CurveCreator_ICurve* theCurve );
+
+ void setLocalPointsToTable( const CurveCreator_ICurve::SectionToPointList& thePoints );
+
+ /**
+ * Returns a section index from the table
+ * \param theRowId a table row
+ */
+ int getSectionId( const int theRowId ) const;
+ /**
+ * Returns a point index from the table
+ * \param theRowId a table row
+ */
+ int getPointId( const int theRowId ) const;
+
+private:
+ CurveCreator_ICurve* myCurve;
+
+};
+
+#endif // CURVECREATOR_TABLEVIEW_H
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include "CurveCreator_TreeView.h"
-#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_ICurve.hxx"
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#define ID_SECTION -1
-CurveCreator_TreeViewModel::CurveCreator_TreeViewModel( CurveCreator_Curve* theCurve, QObject* parent ) :
+CurveCreator_TreeViewModel::CurveCreator_TreeViewModel( CurveCreator_ICurve* theCurve, QObject* parent ) :
QAbstractItemModel(parent), myCurve(theCurve)
{
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
}
else if( role == Qt::DecorationRole ){
if( aColumn == 0 ){
- CurveCreator::Type aSectionType = myCurve->getType(aRow);
+ CurveCreator::SectionType aSectionType = myCurve->getSectionType(aRow);
if( aSectionType == CurveCreator::Polyline ){
if( myCurve->isClosed(aRow) ){
return myCachedIcons[ICON_CLOSED_POLYLINE];
int aRowCnt = 0;
if( myCurve != NULL ){
if( !parent.isValid() ){
- //Points level
+ //Section level
aRowCnt = myCurve->getNbSections();
}
else{
- //Section level
if( parent.internalId() == ID_SECTION ){
+ //Points level
aRowCnt = myCurve->getNbPoints(parent.row());
}
}
return theIndx.row();
}
-void CurveCreator_TreeViewModel::setCurve( CurveCreator_Curve* theCurve )
+void CurveCreator_TreeViewModel::setCurve( CurveCreator_ICurve* theCurve )
{
myCurve = theCurve;
reset();
}
/*****************************************************************************************/
-CurveCreator_TreeView::CurveCreator_TreeView( CurveCreator_Curve* theCurve, QWidget *parent) :
+CurveCreator_TreeView::CurveCreator_TreeView( CurveCreator_ICurve* theCurve, QWidget *parent) :
QTreeView(parent)
{
header()->hide();
aSect << aModel->getSection( anIndxs[i] );
}
}
- qSort(aSect.begin(), aSect.end());
return aSect;
}
{
CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
if( aModel ){
- rowsInserted(QModelIndex(), theSection, theSection );
+ int nbRows = aModel->rowCount();
+ int aSection = (theSection == -1 ? (nbRows==0 ? 0 : nbRows-1) : theSection);
+ rowsInserted(QModelIndex(), aSection, aSection );
+ QModelIndex aSectIndx = aModel->sectionIndex(aSection);
+ selectionModel()->select(aSectIndx, QItemSelectionModel::Rows | QItemSelectionModel::ClearAndSelect);
}
}
}
}
-void CurveCreator_TreeView::pointsSwapped( int theSection, int thePointNum, int theOffset )
-{
- CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
- if( aModel ){
- QModelIndex aFirstIndex = aModel->pointIndex( theSection, thePointNum );
- QModelIndex aSecondIndex = aModel->pointIndex( theSection, thePointNum + theOffset );
- swapIndexes( aFirstIndex, aSecondIndex );
- }
-}
-
void CurveCreator_TreeView::setSelectedSections( const QList<int>& theList )
{
CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
selectionModel()->clearSelection();
for( int i = 0 ; i < theList.size() ; i++ ){
QModelIndex aSectIndx = aModel->sectionIndex(theList[i]);
- selectionModel()->select(aSectIndx, QItemSelectionModel::Select );
- }
- }
-}
-
-void CurveCreator_TreeView::setSelectedPoints( const QList< QPair<int, int> >& thePointsList )
-{
- CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
- if( aModel ){
- selectionModel()->clearSelection();
- for( int i = 0 ; i < thePointsList.size() ; i++ ){
- QModelIndex aSectIndx = aModel->pointIndex( thePointsList[i].first, thePointsList[i].second );
- selectionModel()->select(aSectIndx, QItemSelectionModel::Select );
+ selectionModel()->select(aSectIndx, QItemSelectionModel::Select | QItemSelectionModel::Rows );
}
}
}
return s1.second < s2.second;
}
-QList< QPair< int, int > > CurveCreator_TreeView::getSelectedPoints() const
-{
- QList< QPair< int, int > > aPoints;
- CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
- if( !aModel )
- return aPoints;
- QModelIndexList anIndxs = selectionModel()->selectedIndexes();
- for( int i = 0 ; i < anIndxs.size() ; i++ ){
- if( !aModel->isSection( anIndxs[i] ) ){
- int aSect = aModel->getSection(anIndxs[i]);
- int aPointNum = aModel->getPoint(anIndxs[i]);
- QPair< int, int > aPoint = QPair<int,int>( aSect, aPointNum );
- aPoints.push_back( aPoint );
- }
- }
- qSort( aPoints.begin(), aPoints.end(), pointLessThan );
- return aPoints;
-}
-
CurveCreator_TreeView::SelectionType CurveCreator_TreeView::getSelectionType() const
{
CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
int aSect = aModel->getSection(theIndx);
if( aModel->isSection(theIndx) ){
emit sectionEntered( aSect );
- return;
}
- int aPointNum = aModel->getPoint( theIndx );
- emit pointEntered( aSect, aPointNum );
}
-void CurveCreator_TreeView::setCurve( CurveCreator_Curve* theCurve )
+void CurveCreator_TreeView::setCurve( CurveCreator_ICurve* theCurve )
{
CurveCreator_TreeViewModel* aModel = dynamic_cast<CurveCreator_TreeViewModel*>(model());
if( aModel )
aModel->setCurve(theCurve);
reset();
}
+
+void CurveCreator_TreeView::reset()
+{
+ QList<int> aSelSections = getSelectedSections();
+ QTreeView::reset();
+ setSelectedSections(aSelSections);
+}
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QTreeView>
#include <QAbstractItemModel>
-class CurveCreator_Curve;
+class CurveCreator_ICurve;
class CurveCreator_TreeViewModel : public QAbstractItemModel
{
public:
- CurveCreator_TreeViewModel( CurveCreator_Curve* theCurve, QObject* parent );
+ CurveCreator_TreeViewModel( CurveCreator_ICurve* theCurve, QObject* parent );
virtual int columnCount(const QModelIndex & parent = QModelIndex()) const;
virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
int getSection( const QModelIndex& theIndx ) const;
int getPoint( const QModelIndex& theIndx ) const;
- void setCurve( CurveCreator_Curve* theCurve );
+ void setCurve( CurveCreator_ICurve* theCurve );
private:
enum IconType{ ICON_POLYLINE, ICON_SPLINE, ICON_CLOSED_SPLINE, ICON_CLOSED_POLYLINE, ICON_POINT };
private:
- CurveCreator_Curve* myCurve;
+ CurveCreator_ICurve* myCurve;
QMap<IconType, QPixmap> myCachedIcons;
};
public:
enum SelectionType{ ST_NOSEL, ST_POINTS, ST_POINTS_ONE_SECTION, ST_SECTIONS, ST_MIXED };
public:
- explicit CurveCreator_TreeView( CurveCreator_Curve* theCurve, QWidget *parent = 0);
+ explicit CurveCreator_TreeView( CurveCreator_ICurve* theCurve, QWidget *parent = 0);
SelectionType getSelectionType() const;
QList<int> getSelectedSections() const;
- QList< QPair< int, int > > getSelectedPoints() const;
void pointsAdded( int theSection, int thePoint, int thePointsCnt=1 );
void pointDataChanged( int theSection, int thePoint );
void pointsRemoved(int theSection, int thePoint, int thePointsCnt=1 );
- void pointsSwapped( int theSection, int thePointNum, int theOffset );
void sectionAdded( int theSection );
void sectionChanged(int theSection , int aSectCnt = 1);
void sectionsSwapped( int theSection, int theOffset );
void setSelectedSections( const QList<int>& theList );
- void setSelectedPoints( const QList< QPair<int, int> >& thePointsList );
- void setCurve( CurveCreator_Curve* theCurve );
+ void setCurve( CurveCreator_ICurve* theCurve );
+
+ void reset();
signals:
void selectionChanged();
void sectionEntered(int);
- void pointEntered(int,int);
-public slots:
+
protected slots:
void onActivated( QModelIndex theIndx );
protected:
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: CurveCreator_UndoOptsDlg.cxx
-// Author: Sergey KHROMOV
-
-#include "CurveCreator_UndoOptsDlg.h"
-
-#include <QButtonGroup>
-#include <QGridLayout>
-#include <QGroupBox>
-#include <QIntValidator>
-#include <QLineEdit>
-#include <QPushButton>
-#include <QRadioButton>
-
-#define UNDO_DEPTH_UNLIMITED 0
-#define UNDO_DEPTH_DISABLED 1
-#define UNDO_DEPTH_FIX_SIZE 2
-
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-CurveCreator_UndoOptsDlg::CurveCreator_UndoOptsDlg(QWidget* parent)
- : QDialog (parent),
- myUndoDepth (UNDO_DEPTH_UNLIMITED),
- myOptsBtnGrp (NULL),
- myBufferSizeEdit (NULL),
- myOkBtn (NULL),
- myCancelBtn (NULL)
-{
- setWindowTitle(tr("CC_UNDO_OPTIONS_TITLE"));
-
- // Set Undo/Redo options group
- QGroupBox *anUndoOptsGrp =
- new QGroupBox(tr("CC_UNDO_OPTIONS_MODIFY"));
- QGridLayout *anUndoOptsLO = new QGridLayout(anUndoOptsGrp);
- QRadioButton *aDisabledRdBtn =
- new QRadioButton(tr("CC_UNDO_OPTIONS_DISABLED"), anUndoOptsGrp);
- QRadioButton *aFixSizeRdBtn =
- new QRadioButton(tr("CC_UNDO_OPTIONS_FIXED_SIZE"), anUndoOptsGrp);
- QRadioButton *anUnlimRdBtn =
- new QRadioButton(tr("CC_UNDO_OPTIONS_UNLIMITED"), anUndoOptsGrp);
-
- myOptsBtnGrp = new QButtonGroup(anUndoOptsGrp);
- myBufferSizeEdit = new QLineEdit(anUndoOptsGrp);
- anUndoOptsLO->setMargin(9);
- anUndoOptsLO->setSpacing(6);
- anUndoOptsLO->addWidget(aDisabledRdBtn, 0, 0);
- anUndoOptsLO->addWidget(aFixSizeRdBtn, 1, 0);
- anUndoOptsLO->addWidget(anUnlimRdBtn, 2, 0);
- anUndoOptsLO->addWidget(myBufferSizeEdit, 1, 1);
- myOptsBtnGrp->addButton(anUnlimRdBtn, UNDO_DEPTH_UNLIMITED);
- myOptsBtnGrp->addButton(aDisabledRdBtn, UNDO_DEPTH_DISABLED);
- myOptsBtnGrp->addButton(aFixSizeRdBtn, UNDO_DEPTH_FIX_SIZE);
-
- // Set OK/Cancel buttons group
- QGroupBox *anOkCancelGrp = new QGroupBox;
- QGridLayout *anOkCancelLO = new QGridLayout(anOkCancelGrp);
-
- myOkBtn = new QPushButton(tr("GEOM_BUT_OK"), anOkCancelGrp);
- myCancelBtn = new QPushButton(tr("GEOM_BUT_CANCEL"), anOkCancelGrp);
- anOkCancelLO->setMargin(9);
- anOkCancelLO->setSpacing(6);
- anOkCancelLO->addWidget(myOkBtn, 0, 0);
- anOkCancelLO->addWidget(myCancelBtn, 0, 1);
-
- // Set main group
- QGroupBox *aMainGrp = new QGroupBox;
- QVBoxLayout *aMainLO = new QVBoxLayout(aMainGrp);
-
- aMainLO->addWidget(anUndoOptsGrp);
- aMainLO->addWidget(anOkCancelGrp);
-
- setLayout(aMainLO);
-
- init();
-}
-
-//=======================================================================
-// function: Destructor
-// purpose:
-//=======================================================================
-CurveCreator_UndoOptsDlg::~CurveCreator_UndoOptsDlg()
-{
-}
-
-//=======================================================================
-// function: setUndoDepth
-// purpose:
-//=======================================================================
-void CurveCreator_UndoOptsDlg::setUndoDepth(const int theDepth)
-{
- myUndoDepth = theDepth;
-
- const int aDepthId = myUndoDepth + 1;
- int anId = UNDO_DEPTH_FIX_SIZE;
-
- if (aDepthId == UNDO_DEPTH_UNLIMITED ||
- aDepthId == UNDO_DEPTH_DISABLED) {
- anId = aDepthId;
- } else if (myUndoDepth > 0) {
- myBufferSizeEdit->setText(QString::number(myUndoDepth));
- }
-
- myOptsBtnGrp->button(anId)->setChecked(true);
- optionChanged(anId);
-}
-
-//=======================================================================
-// function: getUndoDepth
-// purpose:
-//=======================================================================
-int CurveCreator_UndoOptsDlg::getUndoDepth() const
-{
- return myUndoDepth;
-}
-
-//=======================================================================
-// function: isEnabled
-// purpose:
-//=======================================================================
-bool CurveCreator_UndoOptsDlg::isEnabled() const
-{
- return (myUndoDepth + 1 != UNDO_DEPTH_DISABLED);
-}
-
-//=======================================================================
-// function: isUnlimited
-// purpose:
-//=======================================================================
-bool CurveCreator_UndoOptsDlg::isUnlimited() const
-{
- return (myUndoDepth + 1 == UNDO_DEPTH_UNLIMITED);
-}
-
-//=======================================================================
-// function: init
-// purpose:
-//=======================================================================
-void CurveCreator_UndoOptsDlg::init()
-{
- // Initialize sections group.
- myOptsBtnGrp->setExclusive(true);
- myOptsBtnGrp->button(UNDO_DEPTH_UNLIMITED)->setChecked(true);
- connect(myOptsBtnGrp, SIGNAL(buttonClicked(int)),
- this, SLOT(optionChanged(int)));
-
- // Initialize line edit.
- QIntValidator *aValidator = new QIntValidator(myBufferSizeEdit);
-
- aValidator->setBottom(1);
- myBufferSizeEdit->setValidator(aValidator);
- optionChanged(UNDO_DEPTH_UNLIMITED);
-
- // Init buttons.
- myOkBtn->setDefault(true);
-
- connect(myOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
- connect(myCancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
-
- setTabOrder();
-}
-
-//=======================================================================
-// function: setTabOrder
-// purpose:
-//=======================================================================
-void CurveCreator_UndoOptsDlg::setTabOrder()
-{
- QWidget::setTabOrder(myOptsBtnGrp->button(UNDO_DEPTH_DISABLED),
- myOptsBtnGrp->button(UNDO_DEPTH_FIX_SIZE));
- QWidget::setTabOrder(myOptsBtnGrp->button(UNDO_DEPTH_FIX_SIZE),
- myBufferSizeEdit);
- QWidget::setTabOrder(myBufferSizeEdit,
- myOptsBtnGrp->button(UNDO_DEPTH_UNLIMITED));
- QWidget::setTabOrder(myOptsBtnGrp->button(UNDO_DEPTH_UNLIMITED), myOkBtn);
- QWidget::setTabOrder(myOkBtn, myCancelBtn);
-}
-
-//=======================================================================
-// function: optionChanged
-// purpose:
-//=======================================================================
-void CurveCreator_UndoOptsDlg::optionChanged(int theId)
-{
- switch (theId) {
- case UNDO_DEPTH_FIX_SIZE:
- myBufferSizeEdit->setEnabled(true);
- break;
- case UNDO_DEPTH_UNLIMITED:
- case UNDO_DEPTH_DISABLED:
- default:
- myBufferSizeEdit->setEnabled(false);
- break;
- }
-}
-
-//=======================================================================
-// function: accept
-// purpose:
-//=======================================================================
-void CurveCreator_UndoOptsDlg::accept()
-{
- const int anId = myOptsBtnGrp->checkedId();
-
- switch (anId) {
- case UNDO_DEPTH_FIX_SIZE:
- myUndoDepth = myBufferSizeEdit->text().toInt();
- break;
- case UNDO_DEPTH_UNLIMITED:
- case UNDO_DEPTH_DISABLED:
- myUndoDepth = anId - 1;
- break;
- default:
- break;
- }
-
- QDialog::accept();
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: CurveCreator_UndoOptsDlg.h
-// Author: Sergey KHROMOV
-
-#ifndef _CurveCreator_UndoOptsDlg_HeaderFile
-#define _CurveCreator_UndoOptsDlg_HeaderFile
-
-#include <QDialog>
-
-class QButtonGroup;
-class QLineEdit;
-class QPushButton;
-
-
-class CurveCreator_UndoOptsDlg : public QDialog
-{
- Q_OBJECT
-
-public:
-
- CurveCreator_UndoOptsDlg(QWidget* parent);
-
- ~CurveCreator_UndoOptsDlg();
-
- void setUndoDepth(const int theDepth);
-
- int getUndoDepth() const;
-
- bool isEnabled() const;
-
- bool isUnlimited() const;
-
-private:
-
- void init();
-
- void setTabOrder();
-
-private slots:
-
- void optionChanged(int theId);
-
- void accept();
-
-protected:
-
- int myUndoDepth;
- QButtonGroup *myOptsBtnGrp;
- QLineEdit *myBufferSizeEdit;
- QPushButton *myOkBtn;
- QPushButton *myCancelBtn;
-
-};
-
-#endif
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "CurveCreator_Utils.hxx"
+#include "CurveCreator.hxx"
+#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_UtilsICurve.hxx"
+
+#include <GEOMUtils.hxx>
+
+#include <gp_Pln.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Compound.hxx>
+
+#include <AIS_ListOfInteractive.hxx>
+#include <AIS_ListIteratorOfListOfInteractive.hxx>
+#include <AIS_Shape.hxx>
+#include <AIS_Line.hxx>
+#include <AIS_Trihedron.hxx>
+#include <AIS_LocalContext.hxx>
+
+#include <Geom_Point.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_TrimmedCurve.hxx>
+
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
+#include <Select3D_SensitivePoint.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepTools_WireExplorer.hxx>
+
+#include <TColgp_HArray1OfPnt.hxx>
+#include <TColStd_HArray1OfBoolean.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColgp_Array1OfVec.hxx>
+#include <GeomAPI_Interpolate.hxx>
+
+#include <ProjLib.hxx>
+#include <ElSLib.hxx>
+
+#include <math.h>
+
+#include "CurveCreator_ICurve.hxx"
+
+const double LOCAL_SELECTION_TOLERANCE = 0.0001;
+const int SCENE_PIXEL_PROJECTION_TOLERANCE = 10;
+const int SCENE_PIXEL_POINT_TOLERANCE = 5;
+
+#define PLN_FREE 0
+#define PLN_ORIGIN 1
+#define PLN_OX 2
+#define PLN_FIXED 3
+
+/**
+ * This static function returns the curve of original type from the edge.
+ *
+ * \param theEdge the edge
+ * \return the curve of original type. Can be null handle.
+ */
+static Handle(Geom_Curve) GetCurve(const TopoDS_Edge &theEdge)
+{
+ Handle(Geom_Curve) aResult;
+
+ if (theEdge.IsNull()) {
+ return aResult;
+ }
+
+ Standard_Real aF;
+ Standard_Real aL;
+
+ aResult = BRep_Tool::Curve(theEdge, aF, aL);
+
+ if (aResult.IsNull()) {
+ return aResult;
+ }
+
+ // Get the curve of original type
+ Handle(Standard_Type) aType = aResult->DynamicType();
+
+ while (aType == STANDARD_TYPE(Geom_TrimmedCurve)) {
+ Handle(Geom_TrimmedCurve) aTrCurve =
+ Handle(Geom_TrimmedCurve)::DownCast(aResult);
+
+ aResult = aTrCurve->BasisCurve();
+ aType = aResult->DynamicType();
+ }
+
+ return aResult;
+}
+
+//=======================================================================
+// function : ConvertClickToPoint()
+// purpose : Returns the point clicked in 3D view
+//=======================================================================
+void CurveCreator_Utils::ConvertPointToClick( const gp_Pnt& thePoint,
+ Handle(V3d_View) theView,
+ int& x, int& y )
+{
+ theView->Convert(thePoint.X(), thePoint.Y(), thePoint.Z(), x, y );
+}
+
+
+//=======================================================================
+// function : ConvertClickToPoint()
+// purpose : Returns the point clicked in 3D view
+//=======================================================================
+gp_Pnt CurveCreator_Utils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
+{
+ // the 3D point, that is a projection of the pixels to the XYZ view plane
+ //return GEOMUtils::ConvertClickToPoint( x, y, aView );
+
+ // we need the projection to the XOY plane
+ // 1. find a point in the plane of the eye and the normal to the plane
+ Standard_Real X, Y, Z;
+ Quantity_Parameter Vx, Vy, Vz;
+ aView->ConvertWithProj( x, y, X, Y, Z, Vx, Vy, Vz );
+
+ // 2. build a ray from the point by the normal to the XOY plane and intersect it
+ // The ray equation is the following : p(x,y,z) = p0(x,y,z) + t*V(x,y,z)
+ // X,Y,Z - defines p0(x,y,z), Vx,Vy,Vz - defines V(x,y,z)
+ // p(x,y,z) - is a searched point, t - should to be calculated by the condition of XOY plane
+ // The system of equations is the following:
+ // p(x) = p0(x)+t*V(x)
+ // p(y) = p0(y)+t*V(y)
+ // p(z) = p0(z)+t*V(z)
+ // p(z) = 0
+
+ Standard_Real aXp, aYp, aZp;
+ //It is not possible to use Precision::Confusion(), because it is e-0.8, but V is sometimes e-6
+ Standard_Real aPrec = LOCAL_SELECTION_TOLERANCE;
+ if ( fabs( Vz ) > aPrec ) {
+ Standard_Real aT = -Z/Vz;
+ aXp = X + aT*Vx;
+ aYp = Y + aT*Vy;
+ aZp = Z + aT*Vz;
+ }
+ else { // Vz = 0 - the eyed plane is orthogonal to Z plane - XOZ, or YOZ
+ aXp = aYp = aZp = 0;
+ if ( fabs( Vy ) < aPrec ) // Vy = 0 - the YOZ plane
+ aYp = Y;
+ else if ( fabs( Vx ) < aPrec ) // Vx = 0 - the XOZ plane
+ aXp = X;
+ }
+ /*std::cout << "ConvertClickToPoint: " << std::endl
+ << "XYZ1 = (" << X << ", " << Y << ", " << Z << "); " << std::endl
+ << "Vxyz = (" << Vx << ", " << Vy << ", " << Vz << "); " << std::endl
+ << "Resp = (" << aXp << ", " << aYp << ", " << aZp << "); " << std::endl;*/
+
+ gp_Pnt ResultPoint( aXp, aYp, aZp );
+ return ResultPoint;
+}
+
+void CurveCreator_Utils::constructShape( const CurveCreator_ICurve* theCurve,
+ TopoDS_Shape& theShape )
+{
+ BRep_Builder aBuilder;
+ TopoDS_Compound aComp;
+ aBuilder.MakeCompound( aComp );
+ for( int iSection = 0 ; iSection < theCurve->getNbSections() ; iSection++ )
+ {
+ int theISection = iSection;
+
+ CurveCreator::SectionType aSectType = theCurve->getSectionType( theISection );
+ int aPointSize = theCurve->getNbPoints( theISection );
+ if ( aPointSize == 0 )
+ continue;
+
+ bool aSectIsClosed = theCurve->isClosed( theISection );
+ bool isPolyline = aSectType == CurveCreator::Polyline;
+
+ int iPoint = 0;
+ gp_Pnt aPrevPoint, aPoint;
+ // filters the curve points to skip equal points
+ std::vector<gp_Pnt> aPoints;
+ CurveCreator_UtilsICurve::getPoint( theCurve, theISection, iPoint, aPoint );
+ aPoints.push_back( aPoint );
+ aPrevPoint = aPoint;
+ iPoint++;
+ for( ; iPoint < aPointSize; iPoint++ ) {
+ CurveCreator_UtilsICurve::getPoint( theCurve, theISection, iPoint, aPoint );
+ if ( !isEqualPoints( aPrevPoint, aPoint ) )
+ aPoints.push_back( aPoint );
+ aPrevPoint = aPoint;
+ }
+ int aNbPoints = aPoints.size();
+
+ if ( aNbPoints == 1 ) {
+ aPoint = aPoints.front();
+ TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
+ aBuilder.Add( aComp, aVertex );
+ }
+ else if ( aNbPoints > 1 ) {
+ Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aNbPoints);
+ TColgp_Array1OfVec aTangents(1, aNbPoints);
+ Handle(TColStd_HArray1OfBoolean) aTangentFlags = new TColStd_HArray1OfBoolean(1, aNbPoints);
+ gp_Vec aNullVec(0, 0, 0);
+
+ TopoDS_Edge aPointEdge;
+ TopoDS_Vertex aVertex;
+
+ std::vector<gp_Pnt>::const_iterator aPointIt = aPoints.begin(), aPointLast = aPoints.end();
+ aPoint = *aPointIt;
+
+ int aHIndex = 1;
+ aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
+ aBuilder.Add( aComp, aVertex );
+ if ( !isPolyline ) {
+ aHCurvePoints->SetValue( aHIndex, aPoint );
+ aTangents.SetValue( aHIndex, aNullVec );
+ aTangentFlags->SetValue( aHIndex, Standard_False );
+ aHIndex++;
+ }
+
+ aPrevPoint = aPoint;
+ aPointIt++;
+ for( ; aPointIt != aPointLast; aPointIt++ ) {
+ aPoint = *aPointIt;
+ aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
+ aBuilder.Add( aComp, aVertex );
+ if ( isPolyline ) {
+ TopoDS_Edge aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
+ aBuilder.Add( aComp, aPointEdge );
+ }
+ else {
+ aHCurvePoints->SetValue( aHIndex, aPoint );
+ aTangents.SetValue( aHIndex, aNullVec );
+ aTangentFlags->SetValue( aHIndex, Standard_False );
+ aHIndex++;
+ }
+ aPrevPoint = aPoint;
+ }
+ if( aSectIsClosed && ( aNbPoints > 2 ) ) {
+ aPoint = aPoints.front();
+ aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
+ aBuilder.Add( aComp, aVertex );
+ if ( isPolyline ) {
+ aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
+ aBuilder.Add( aComp, aPointEdge );
+ }
+ }
+ if( !isPolyline ) {
+ // compute BSpline
+ Handle(Geom_BSplineCurve) aBSplineCurve;
+ GeomAPI_Interpolate aGBC(aHCurvePoints, aSectIsClosed, gp::Resolution());
+ // correct the spline degree to be as 3 for non-periodic spline if number of points
+ // less than 3. It is need to have a knot in each spline point. This knots are used
+ // to found a neighbour points when a new point is inserted between two existing.
+ if (!aSectIsClosed ) {
+ if (aHCurvePoints->Length() == 3)
+ aGBC.Load(aTangents, aTangentFlags);
+ }
+
+ aGBC.Perform();
+ if ( aGBC.IsDone() )
+ aBSplineCurve = aGBC.Curve();
+ TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSplineCurve ).Edge();
+ TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire();
+ aBuilder.Add( aComp, aWire );
+ }
+ }
+ }
+ theShape = aComp;
+}
+
+/**
+ * This is an intermediate structure for curve construction.
+ */
+struct Section3D
+{
+ Section3D() : myIsClosed(false), myIsBSpline(false)
+ { }
+
+ bool myIsClosed;
+ bool myIsBSpline;
+ Handle(TColgp_HArray1OfPnt) myPoints;
+};
+
+//=======================================================================
+// function : constructCurve
+// purpose :
+//=======================================================================
+bool CurveCreator_Utils::constructCurve
+ (const TopoDS_Shape theShape,
+ CurveCreator_Curve *theCurve,
+ gp_Ax3 &theLocalCS)
+{
+ if (theShape.IsNull()) {
+ return false;
+ }
+
+ // Collect wires or vertices from shape.
+ TopTools_ListOfShape aWOrV;
+ TopAbs_ShapeEnum aType = theShape.ShapeType();
+
+ if (aType == TopAbs_WIRE || aType == TopAbs_VERTEX) {
+ aWOrV.Append(theShape);
+ } else if (aType == TopAbs_COMPOUND) {
+ TopoDS_Iterator aShIter(theShape);
+
+ for (; aShIter.More(); aShIter.Next()) {
+ const TopoDS_Shape &aSubShape = aShIter.Value();
+
+ aType = aSubShape.ShapeType();
+
+ if (aType == TopAbs_WIRE || aType == TopAbs_VERTEX) {
+ aWOrV.Append(aSubShape);
+ } else {
+ // Only subshapes of types wire or vertex are supported.
+ return false;
+ }
+ }
+ } else {
+ // Only wire (vertex) or compound of wires (vertices) are supported.
+ return false;
+ }
+
+ // Treat each wire or vertex. Get points, compute the working plane.
+ gp_Pln aPlane;
+ Standard_Integer aPlaneStatus = PLN_FREE;
+ TopTools_ListIteratorOfListOfShape anIter(aWOrV);
+ std::list<Section3D> aListSec;
+
+ for (; anIter.More(); anIter.Next()) {
+ Section3D aSec3D;
+
+ aSec3D.myPoints = CurveCreator_Utils::getPoints
+ (anIter.Value(), aSec3D.myIsClosed, aSec3D.myIsBSpline);
+
+ if (aSec3D.myPoints.IsNull()) {
+ return false;
+ }
+
+ aListSec.push_back(aSec3D);
+
+ if (aPlaneStatus != PLN_FIXED) {
+ // Compute plane
+ CurveCreator_Utils::FindPlane(aSec3D.myPoints, aPlane, aPlaneStatus);
+ }
+ }
+
+ // Check if it is possible to change a computed coordinate system by
+ // XOY, XOZ or YOZ or parallel to them.
+ gp_Pnt aO(0., 0., 0.);
+ gp_Dir aNDir(0., 0., 1.);
+ gp_Dir aXDir(1., 0., 0.);
+ gp_Ax3 anAxis;
+ Standard_Real aTolAng = Precision::Confusion(); // Angular() is too small.
+
+ switch (aPlaneStatus) {
+ case PLN_ORIGIN:
+ {
+ // Change the location.
+ aO.SetZ(aPlane.Location().Z());
+ anAxis.SetLocation(aO);
+ aPlane.SetPosition(anAxis);
+ }
+ break;
+ case PLN_OX:
+ {
+ // Fixed origin + OX axis
+ const gp_Dir &aPlnX = aPlane.Position().XDirection();
+
+ if (Abs(aPlnX.Z()) <= aTolAng) {
+ // Make a coordinate system parallel to XOY.
+ aO.SetZ(aPlane.Location().Z());
+ anAxis.SetLocation(aO);
+ aPlane.SetPosition(anAxis);
+ } else if (Abs(aPlnX.Y()) <= aTolAng) {
+ // Make a coordinate system parallel to XOZ.
+ aO.SetY(aPlane.Location().Y());
+ aNDir.SetCoord(0., 1., 0.);
+ aXDir.SetCoord(0., 0., 1.);
+ anAxis = gp_Ax3(aO, aNDir, aXDir);
+ aPlane.SetPosition(anAxis);
+ } else if (Abs(aPlnX.X()) <= aTolAng) {
+ // Make a coordinate system parallel to YOZ.
+ aO.SetX(aPlane.Location().X());
+ aNDir.SetCoord(1., 0., 0.);
+ aXDir.SetCoord(0., 1., 0.);
+ anAxis = gp_Ax3(aO, aNDir, aXDir);
+ aPlane.SetPosition(anAxis);
+ }
+ }
+ break;
+ case PLN_FIXED:
+ {
+ const gp_Dir &aPlnN = aPlane.Position().Direction();
+ gp_Dir aYDir(0., 1., 0.);
+
+ if (aPlnN.IsParallel(aNDir, aTolAng)) {
+ // Make a coordinate system parallel to XOY.
+ aO.SetZ(aPlane.Location().Z());
+ anAxis.SetLocation(aO);
+ aPlane.SetPosition(anAxis);
+ } else if (aPlnN.IsParallel(aYDir, aTolAng)) {
+ // Make a coordinate system parallel to XOZ.
+ aO.SetY(aPlane.Location().Y());
+ aNDir.SetCoord(0., 1., 0.);
+ aXDir.SetCoord(0., 0., 1.);
+ anAxis = gp_Ax3(aO, aNDir, aXDir);
+ aPlane.SetPosition(anAxis);
+ } else if (aPlnN.IsParallel(aXDir, aTolAng)) {
+ // Make a coordinate system parallel to YOZ.
+ aO.SetX(aPlane.Location().X());
+ aNDir.SetCoord(1., 0., 0.);
+ aXDir.SetCoord(0., 1., 0.);
+ anAxis = gp_Ax3(aO, aNDir, aXDir);
+ aPlane.SetPosition(anAxis);
+ }
+ }
+ break;
+ case PLN_FREE:
+ default:
+ // Use XOY plane.
+ aPlane.SetPosition(anAxis);
+ break;
+ }
+
+ // Compute 2d points.
+ std::list<Section3D>::const_iterator aSecIt = aListSec.begin();
+ Standard_Real aTolConf2 =
+ Precision::Confusion()*Precision::Confusion();
+ Standard_Real aX;
+ Standard_Real aY;
+
+ for (; aSecIt != aListSec.end(); ++aSecIt) {
+ Standard_Integer i;
+ CurveCreator::Coordinates aCoords;
+
+ for (i = aSecIt->myPoints->Lower(); i <= aSecIt->myPoints->Upper(); ++i) {
+ const gp_Pnt &aPnt = aSecIt->myPoints->Value(i);
+
+ if (aPlane.SquareDistance(aPnt) > aTolConf2) {
+ // The point doesn't lie on the plane.
+ return false;
+ }
+
+ ElSLib::Parameters(aPlane, aPnt, aX, aY);
+ aCoords.push_back(aX);
+ aCoords.push_back(aY);
+ }
+
+ // Add a new section to the curve.
+ const std::string aSecName =
+ CurveCreator_UtilsICurve::getUniqSectionName(theCurve);
+ const CurveCreator::SectionType aSecType = aSecIt->myIsBSpline ?
+ CurveCreator::Spline : CurveCreator::Polyline;
+
+ theCurve->addSectionInternal(aSecName, aSecType,
+ aSecIt->myIsClosed, aCoords);
+ }
+
+ // Set the local coordinate system.
+ theLocalCS = aPlane.Position();
+
+ return true;
+}
+
+class CompareSectionToPoint
+{
+public:
+ CompareSectionToPoint( const int theISection = -1, const int theIPoint = -1 )
+ : mySectionId( theISection ), myPointId( theIPoint ) {};
+ ~CompareSectionToPoint() {}
+
+ bool operator < ( const CompareSectionToPoint& theOther ) const
+ {
+ bool isLess = mySectionId < theOther.mySectionId;
+ if ( !isLess && mySectionId == theOther.mySectionId )
+ isLess = myPointId < theOther.myPointId;
+ return isLess;
+ }
+
+private:
+ int mySectionId;
+ int myPointId;
+};
+
+
+void CurveCreator_Utils::getSelectedPoints( Handle(AIS_InteractiveContext) theContext,
+ const CurveCreator_ICurve* theCurve,
+ CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ thePoints.clear();
+
+ std::list<float> aSelectedPoints;
+ gp_Pnt aPnt;
+ std::map<CompareSectionToPoint, int> aPointsMap;
+
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ for ( theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected() ) {
+ TopoDS_Vertex aVertex;
+ TopoDS_Shape aShape = theContext->SelectedShape();
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+ aVertex = TopoDS::Vertex( theContext->SelectedShape() );
+
+ if ( aVertex.IsNull() )
+ continue;
+ aPnt = BRep_Tool::Pnt( aVertex );
+
+ CurveCreator_UtilsICurve::findSectionsToPoints( theCurve, aPnt.X(), aPnt.Y(), aPoints );
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aPoints.begin(),
+ aLast = aPoints.end();
+ CompareSectionToPoint aPoint;
+ for ( ; anIt != aLast; anIt++ ) {
+ aPoint = CompareSectionToPoint( (*anIt).first, (*anIt).second );
+ if ( aPointsMap.find( aPoint ) != aPointsMap.end() )
+ continue;
+ aPointsMap[aPoint] = 0;
+
+ thePoints.push_back( *anIt );
+ }
+ }
+}
+
+void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theContext,
+ const CurveCreator_ICurve* theCurve,
+ const CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ if ( !theCurve )
+ return;
+
+ Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject();
+ if ( anAIS.IsNull() )
+ return;
+ Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( anAIS );
+ if ( anAISShape.IsNull() )
+ return;
+
+ //ASL: we convert list of point indices to list of points coordinates
+ int aSize = thePoints.size();
+ std::vector<gp_Pnt> aPntsToSelect( aSize );
+
+ CurveCreator_ICurve::SectionToPointList::const_iterator
+ aPIt = thePoints.begin(), aPLast = thePoints.end();
+ CurveCreator_ICurve::SectionToPoint aSToPoint;
+ for( int i=0; aPIt != aPLast; aPIt++, i++ )
+ {
+ gp_Pnt aPntToSelect;
+ CurveCreator_UtilsICurve::getPoint( theCurve, aPIt->first, aPIt->second, aPntToSelect );
+ aPntsToSelect[i] = aPntToSelect;
+ }
+
+ theContext->ClearSelected( Standard_False );
+ //ASL: we switch off automatic highlight to improve performance of selection
+ theContext->SetAutomaticHilight( Standard_False );
+
+ Handle_SelectMgr_Selection aSelection = anAISShape->Selection( AIS_Shape::SelectionMode( TopAbs_VERTEX ) );
+ for( aSelection->Init(); aSelection->More(); aSelection->Next() )
+ {
+ Handle_SelectBasics_SensitiveEntity aSenEntity = aSelection->Sensitive();
+ Handle_Select3D_SensitivePoint aSenPnt = Handle_Select3D_SensitivePoint::DownCast( aSenEntity );
+
+ gp_Pnt anOwnerPnt = aSenPnt->Point();
+ Handle_SelectMgr_EntityOwner anOwner = Handle_SelectMgr_EntityOwner::DownCast( aSenPnt->OwnerId() );
+
+
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
+ aLast = thePoints.end();
+ bool isFound = false;
+ for( int i=0; i<aSize; i++ )
+ {
+ bool isIntersect = fabs( aPntsToSelect[i].X() - anOwnerPnt.X() ) < LOCAL_SELECTION_TOLERANCE &&
+ fabs( aPntsToSelect[i].Y() - anOwnerPnt.Y() ) < LOCAL_SELECTION_TOLERANCE;
+ if( isIntersect )
+ {
+ theContext->AddOrRemoveSelected( anOwner, Standard_False );
+ break;
+ }
+ }
+ }
+
+ //ASL: we switch on again automatic highlight (otherwise selection will not be shown)
+ // and call HilightPicked to draw selected owners
+ theContext->SetAutomaticHilight( Standard_True );
+ theContext->LocalContext()->HilightPicked( Standard_True );
+}
+
+//=======================================================================
+// function : setLocalPointContext
+// purpose : Open/close the viewer local context
+//=======================================================================
+void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCurve,
+ Handle(AIS_InteractiveContext) theContext,
+ const bool theOpen )
+{
+ if ( !theContext )
+ return;
+
+ if ( theOpen ) {
+ // Open local context if there is no one
+ if ( !theContext->HasOpenedContext() ) {
+ theContext->ClearCurrents( false );
+ theContext->OpenLocalContext( false/*use displayed objects*/, true/*allow shape decomposition*/ );
+ }
+ // load the curve AIS object to the local context with the point selection
+ Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject();
+ if ( !anAIS.IsNull() )
+ {
+ if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
+ {
+ theContext->Load( anAIS, -1/*selection mode*/, true/*allow decomposition*/ );
+ theContext->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)TopAbs_VERTEX ) );
+ }
+ }
+ }
+ else {
+ if ( theContext->HasOpenedContext() )
+ theContext->CloseAllContexts();
+ }
+}
+
+bool CurveCreator_Utils::pointOnObject( Handle(V3d_View) theView,
+ Handle(AIS_InteractiveObject) theObject,
+ const int theX, const int theY,
+ gp_Pnt& thePoint,
+ gp_Pnt& thePoint1, gp_Pnt& thePoint2 )
+{
+ bool isFullFound = false;
+
+ if ( theObject.IsNull() || theView.IsNull() )
+ return isFullFound;
+ Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast( theObject );
+ if ( aShape.IsNull() )
+ return isFullFound;
+ const TopoDS_Compound& aCompound = TopoDS::Compound( aShape->Shape() );
+ if ( aCompound.IsNull() )
+ return isFullFound;
+
+ gp_Pnt aCurPoint, aCurPoint1, aCurPoint2;
+ gp_Pnt aFoundPoint, aFoundPnt1, aFoundPnt2;
+ Standard_Real aParameter;
+ bool isFound = false;
+ int aDelta, aMinDelta = 2*SCENE_PIXEL_PROJECTION_TOLERANCE*SCENE_PIXEL_PROJECTION_TOLERANCE;
+ TopExp_Explorer anExp( aCompound, TopAbs_EDGE );
+ for ( ; anExp.More(); anExp.Next())
+ {
+ const TopoDS_Edge& anEdge = TopoDS::Edge(anExp.Current());
+ if ( anEdge.IsNull() )
+ continue;
+ Standard_Real aFirst, aLast;
+ Handle(Geom_Curve) aCurve = BRep_Tool::Curve( anEdge, aFirst, aLast );
+ if ( aCurve->IsKind( STANDARD_TYPE(Geom_BSplineCurve) ) ) {
+ Handle(Geom_BSplineCurve) aBSplineCurve =
+ Handle(Geom_BSplineCurve)::DownCast( aCurve );
+ if ( !aBSplineCurve.IsNull() ) {
+ isFound = hasProjectPointOnCurve( theView, theX, theY, aBSplineCurve,
+ aParameter, aDelta );
+ if ( isFound ) {
+ aCurPoint = aBSplineCurve->Value( aParameter );
+ Standard_Integer anI1, anI2;
+ aBSplineCurve->LocateU( aParameter, LOCAL_SELECTION_TOLERANCE, anI1, anI2 );
+ aCurPoint1 = aBSplineCurve->Value( aBSplineCurve->Knot( anI1 ) );
+ aCurPoint2 = aBSplineCurve->Value( aBSplineCurve->Knot( anI2 ) );
+ }
+ }
+ }
+ else { // a curve built on a polyline edge
+ Handle(Geom_Line) aGLine = Handle(Geom_Line)::DownCast( aCurve );
+ if ( aGLine.IsNull() )
+ continue;
+ isFound = hasProjectPointOnCurve( theView, theX, theY, aGLine, aParameter,
+ aDelta );
+ if ( isFound ) {
+ aCurPoint = aGLine->Value( aParameter );
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices( anEdge, V1, V2, Standard_True );
+ if ( V1.IsNull() || V2.IsNull() )
+ continue;
+ aCurPoint1 = BRep_Tool::Pnt(V1);
+ aCurPoint2 = BRep_Tool::Pnt(V2);
+
+ // check that the projected point is on the bounded curve
+ gp_Vec aVec1( aCurPoint1, aCurPoint );
+ gp_Vec aVec2( aCurPoint2, aCurPoint );
+ isFound = fabs( aVec1.Angle( aVec2 ) - M_PI ) < LOCAL_SELECTION_TOLERANCE;
+ }
+ }
+ if ( isFound && aMinDelta >= aDelta ) {
+ aMinDelta = aDelta;
+
+ isFullFound = true;
+ aFoundPnt1 = aCurPoint1;
+ aFoundPnt2 = aCurPoint2;
+ aFoundPoint = aCurPoint;
+ }
+ }
+ if ( isFullFound ) {
+ int aX, anY, aX1, anY1, aX2, anY2;
+ int aDelta;
+ CurveCreator_Utils::ConvertPointToClick( aFoundPoint, theView, aX, anY );
+ CurveCreator_Utils::ConvertPointToClick( aFoundPnt1, theView, aX1, anY1 );
+ CurveCreator_Utils::ConvertPointToClick( aFoundPnt2, theView, aX2, anY2 );
+
+ isFullFound = !isEqualPixels( aX, anY, aX1, anY1, SCENE_PIXEL_POINT_TOLERANCE, aDelta ) &&
+ !isEqualPixels( aX, anY, aX2, anY2, SCENE_PIXEL_POINT_TOLERANCE, aDelta );
+ if ( isFullFound ) {
+ thePoint = aFoundPoint;
+ thePoint1 = aFoundPnt1;
+ thePoint2 = aFoundPnt2;
+ }
+ }
+ return isFullFound;
+}
+
+bool CurveCreator_Utils::hasProjectPointOnCurve( Handle(V3d_View) theView,
+ const int theX, const int theY,
+ const Handle(Geom_Curve)& theCurve,
+ Standard_Real& theParameter,
+ int& theDelta )
+{
+ bool isFound = false;
+ if ( theView.IsNull() )
+ return isFound;
+
+ gp_Pnt aPoint = CurveCreator_Utils::ConvertClickToPoint( theX, theY, theView );
+
+ GeomAPI_ProjectPointOnCurve aProj( aPoint, theCurve );
+ Standard_Integer aNbPoint = aProj.NbPoints();
+ if (aNbPoint > 0) {
+ for (Standard_Integer j = 1; j <= aNbPoint && !isFound; j++) {
+ gp_Pnt aNewPoint = aProj.Point( j );
+ theParameter = aProj.Parameter( j );
+
+ int aX, anY;
+ CurveCreator_Utils::ConvertPointToClick( aNewPoint, theView, aX, anY );
+
+ isFound = isEqualPixels( aX, anY, theX, theY, SCENE_PIXEL_PROJECTION_TOLERANCE, theDelta );
+ }
+ }
+ return isFound;
+}
+
+bool CurveCreator_Utils::isEqualPixels( const int theX, const int theY, const int theOtherX,
+ const int theOtherY, const double theTolerance, int& theDelta )
+{
+ int aXDelta = abs( theX - theOtherX );
+ int anYDelta = abs( theY - theOtherY );
+
+ theDelta = aXDelta*aXDelta + anYDelta*anYDelta;
+
+ return aXDelta < theTolerance && anYDelta < theTolerance;
+}
+
+bool CurveCreator_Utils::isEqualPoints( const gp_Pnt& thePoint, const gp_Pnt& theOtherPoint )
+{
+ return theOtherPoint.IsEqual( thePoint, LOCAL_SELECTION_TOLERANCE );
+}
+
+//=======================================================================
+// function : getPoints
+// purpose :
+//=======================================================================
+Handle(TColgp_HArray1OfPnt) CurveCreator_Utils::getPoints
+ (const TopoDS_Shape &theShape,
+ bool &IsClosed,
+ bool &IsBSpline)
+{
+ Handle(TColgp_HArray1OfPnt) aResult;
+
+ IsClosed = false;
+ IsBSpline = false;
+
+ if (theShape.IsNull()) {
+ return aResult;
+ }
+
+ const TopAbs_ShapeEnum aShType = theShape.ShapeType();
+
+ if (aShType == TopAbs_VERTEX) {
+ // There is a single point.
+ gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(theShape));
+
+ aResult = new TColgp_HArray1OfPnt(1, 1, aPnt);
+
+ return aResult;
+ } else if (aShType != TopAbs_WIRE) {
+ // The shape is neither a vertex nor a wire.
+ return aResult;
+ }
+
+ // Treat wire.
+ BRepTools_WireExplorer anExp(TopoDS::Wire(theShape));
+
+ if (!anExp.More()) {
+ // Empty wires are not allowed.
+ return aResult;
+ }
+
+ // Treat the first edge.
+ TopoDS_Edge anEdge = anExp.Current();
+ Handle(Geom_Curve) aCurve = GetCurve(anEdge);
+
+ if (aCurve.IsNull()) {
+ return aResult;
+ }
+
+ // Check the curve type.
+ Handle(Standard_Type) aType = aCurve->DynamicType();
+
+ if (aType == STANDARD_TYPE(Geom_BSplineCurve)) {
+ IsBSpline = true;
+ } else if (aType != STANDARD_TYPE(Geom_Line)) {
+ // The curve is neither a line or a BSpline. It is not valid.
+ return aResult;
+ }
+
+ // Go to the next edge.
+ TopoDS_Vertex aFirstVtx = anExp.CurrentVertex();
+
+ anExp.Next();
+
+ if (IsBSpline) {
+ // There should be a single BSpline curve in the wire.
+ if (anExp.More()) {
+ return aResult;
+ }
+
+ // Construct a section from poles of BSpline.
+ Handle(Geom_BSplineCurve) aBSplCurve =
+ Handle(Geom_BSplineCurve)::DownCast(aCurve);
+
+ // Check if the edge is valid. It should not be based on trimmed curve.
+ gp_Pnt aCP[2] = { aBSplCurve->StartPoint(), aBSplCurve->EndPoint() };
+ TopoDS_Vertex aV[2];
+ Standard_Integer i;
+
+ TopExp::Vertices(anEdge, aV[0], aV[1]);
+
+ for (i = 0; i < 2; i++) {
+ gp_Pnt aPnt = BRep_Tool::Pnt(aV[i]);
+ Standard_Real aTol = BRep_Tool::Tolerance(aV[i]);
+
+ if (!aPnt.IsEqual(aCP[i], aTol)) {
+ return aResult;
+ }
+ }
+
+ IsClosed = aV[0].IsSame(aV[1]) ? true : false;
+
+ const Standard_Integer aNbPoints = aBSplCurve->NbKnots();
+ TColStd_Array1OfReal aKnots(1, aNbPoints);
+
+ aBSplCurve->Knots(aKnots);
+ aResult = new TColgp_HArray1OfPnt(1, aBSplCurve->NbKnots());
+
+ for (i = aKnots.Lower(); i <= aKnots.Upper(); ++i) {
+ aResult->SetValue(i, aBSplCurve->Value(aKnots.Value(i)));
+ }
+ } else {
+ // This is a polyline.
+ TopTools_ListOfShape aVertices;
+ Standard_Integer aNbVtx = 1;
+
+
+ aVertices.Append(aFirstVtx);
+
+ for (; anExp.More(); anExp.Next(), ++aNbVtx) {
+ anEdge = anExp.Current();
+ aCurve = GetCurve(anEdge);
+
+ if (aCurve.IsNull()) {
+ return aResult;
+ }
+
+ aType = aCurve->DynamicType();
+
+ if (aType != STANDARD_TYPE(Geom_Line)) {
+ // The curve is not a line. It is not valid.
+ return aResult;
+ }
+
+ // Add the current vertex to the list.
+ aVertices.Append(anExp.CurrentVertex());
+ }
+
+ // Check if the section is closed.
+ TopoDS_Vertex aLastVtx = TopExp::LastVertex(anEdge, Standard_True);
+
+ IsClosed = aFirstVtx.IsSame(aLastVtx) ? true : false;
+
+ // Fill the array of points.
+ aResult = new TColgp_HArray1OfPnt(1, aNbVtx);
+
+ Standard_Integer i;
+ TopTools_ListIteratorOfListOfShape aVtxIter(aVertices);
+
+ for (i = 1; aVtxIter.More(); aVtxIter.Next(), ++i) {
+ gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aVtxIter.Value()));
+
+ aResult->SetValue(i, aPnt);
+ }
+ }
+
+ return aResult;
+}
+//=======================================================================
+// function : FindPlane
+// purpose :
+//=======================================================================
+void CurveCreator_Utils::FindPlane
+ (const Handle_TColgp_HArray1OfPnt &thePoints,
+ gp_Pln &thePlane,
+ Standard_Integer &thePlnStatus)
+{
+ if (thePoints.IsNull() || thePlnStatus == PLN_FIXED) {
+ // The plane can't be defined or is fixed. Nothing to change.
+ return;
+ }
+
+ Standard_Integer i;
+ const Standard_Real aTolConf = Precision::Confusion();
+
+ for (i = thePoints->Lower(); i <= thePoints->Upper(); ++i) {
+ const gp_Pnt &aPnt = thePoints->Value(i);
+
+ switch (thePlnStatus) {
+ case PLN_FREE:
+ // Fix the origin.
+ thePlane.SetLocation(aPnt);
+ thePlnStatus = PLN_ORIGIN;
+ break;
+ case PLN_ORIGIN:
+ {
+ // Fix origin + OX axis
+ const gp_Pnt &aPlnLoc = thePlane.Location();
+
+ if (!aPnt.IsEqual(aPlnLoc, aTolConf)) {
+ // Set the X axis.
+ gp_Dir aXDir(aPnt.XYZ().Subtracted(aPlnLoc.XYZ()));
+ gp_Ax3 aXNorm(aPlnLoc, aXDir);
+ gp_Ax3 aNewPlnPos(aPlnLoc, aXNorm.XDirection(), aXNorm.Direction());
+
+ thePlane.SetPosition(aNewPlnPos);
+ thePlnStatus = PLN_OX;
+ }
+ }
+ break;
+ case PLN_OX:
+ {
+ // Fix OY axis
+ gp_Lin aXLin(thePlane.XAxis());
+ Standard_Real aSqrDist = aXLin.SquareDistance(aPnt);
+
+ if (aSqrDist > aTolConf*aTolConf) {
+ // Compute main axis.
+ const gp_Pnt &aPlnLoc = thePlane.Location();
+ gp_Dir aDir(aPnt.XYZ().Subtracted(aPlnLoc.XYZ()));
+ gp_Ax3 aXNorm(aPlnLoc, aXLin.Direction(), aDir);
+ gp_Ax3 aNewPlnPos(aPlnLoc, aXNorm.YDirection(),
+ aXNorm.Direction());
+
+ thePlane.SetPosition(aNewPlnPos);
+ thePlnStatus = PLN_FIXED;
+ return;
+ }
+ }
+ break;
+ default:
+ return;
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef CURVECREATOR_UTILS_H
+#define CURVECREATOR_UTILS_H
+
+#include "CurveCreator_Macro.hxx"
+#include "CurveCreator_ICurve.hxx"
+
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_InteractiveObject.hxx> // TODO: remove
+#include <V3d_View.hxx>
+#include <gp_Pnt.hxx>
+#include <Geom_Curve.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
+
+#include <list>
+#include <vector> // TODO: remove
+
+class CurveCreator_Curve;
+
+
+class CurveCreator_Utils
+{
+public:
+
+ /*!
+ * \brief Returns the point clicked in 3D view.
+ *
+ * \param x The X coordinate in the view.
+ * \param y The Y coordinate in the view.
+ * \param theView View where the given point takes place.
+ * \retval gp_Pnt Returns the point clicked in 3D view
+ */
+ CURVECREATOR_EXPORT static void ConvertPointToClick( const gp_Pnt& thePoint,
+ Handle(V3d_View) theView,
+ int& x, int& y );
+
+ /*!
+ * \brief Returns the point clicked in 3D view.
+ *
+ * \param x The X coordinate in the view.
+ * \param y The Y coordinate in the view.
+ * \param theView View where the given point takes place.
+ * \retval gp_Pnt Returns the point clicked in 3D view
+ */
+ CURVECREATOR_EXPORT static gp_Pnt ConvertClickToPoint( int x, int y,
+ Handle(V3d_View) theView );
+
+ /**
+ * Generates shape on the curve
+ * \param theCurve a curve object, that contains data
+ * \param theShape a generated shape
+ */
+ CURVECREATOR_EXPORT static void constructShape( const CurveCreator_ICurve* theCurve,
+ TopoDS_Shape& theShape );
+
+ /**
+ * Generates a curve from a shape.
+ * \param theShape a shape to be converted to curve.
+ * \param theCurve a curve object to be initialized.
+ * \param theLocalCS the local coordinate system of the curve.
+ * \return true in case of success; false otherwise. Warning: the curve can
+ * be modified even if the shape is not valid for curve construction.
+ */
+ CURVECREATOR_EXPORT static bool constructCurve
+ (const TopoDS_Shape theShape,
+ CurveCreator_Curve *theCurve,
+ gp_Ax3 &theLocalCS);
+
+ /**
+ * Find selected points in the context
+ * \param theContext the viewer context
+ * \param theCurve a curve object, that contains data
+ */
+ CURVECREATOR_EXPORT static void getSelectedPoints( Handle(AIS_InteractiveContext) theContext,
+ const CurveCreator_ICurve* theCurve,
+ CurveCreator_ICurve::SectionToPointList& thePoints );
+
+ /**
+ * Set selected points to the context
+ * \param theContext the viewer context
+ * \param theCurve a curve object, that contains data
+ * \param thePoints the curve point indices to be selected in the context
+ */
+ CURVECREATOR_EXPORT static void setSelectedPoints(
+ Handle(AIS_InteractiveContext) theContext,
+ const CurveCreator_ICurve* theCurve,
+ const CurveCreator_ICurve::SectionToPointList& thePoints =
+ CurveCreator_ICurve::SectionToPointList() );
+
+ /*!
+ * \brief Sets the local point context for the 3D viewer.
+ * \param theCurve a curve object, that contains data
+ * \param theContext the viewer context
+ * \param theOpen The flag to open or close the local context.
+ */
+ CURVECREATOR_EXPORT static void setLocalPointContext(
+ const CurveCreator_ICurve* theCurve,
+ Handle(AIS_InteractiveContext) theContext,
+ const bool theOpen );
+
+ /**
+ * Checks whether the point belongs to the OCC object
+ * \param theObject a line or shape with a bspline inside
+ * \param theX the X coordinate in the view.
+ * \param theY the Y coordinate in the view.
+ * \param thePoint the output point to be append to the model curve
+ * \param thePoint1 the output point to bound the line where a new point should be inserted
+ * \param thePoint2 the output point to bound the line where a new point should be inserted
+ */
+ CURVECREATOR_EXPORT static bool pointOnObject( Handle(V3d_View) theView,
+ Handle(AIS_InteractiveObject) theObject,
+ const int theX, const int theY,
+ gp_Pnt& thePoint, gp_Pnt& thePoint1,
+ gp_Pnt& thePoint2 );
+
+protected:
+ /*
+ * Returns whether the clicked point belong to the curve or has a very near projection
+ * \param theX the X coordinate of a point clicked in the OCC viewer
+ * \param theY the Y coordinate of a point clicked in the OCC viewer
+ * \param theCurve a geometry curve
+ * \param theOutPoint a found projected point on the curve
+ */
+ static bool hasProjectPointOnCurve(
+ Handle(V3d_View) theView,
+ const int theX, const int theY,
+ const Handle(Geom_Curve)& theCurve,
+ Standard_Real& theParameter,
+ int& theDelta );
+
+ /*
+ * Returns whether the X and Y coordinates is in the pixel tolerance
+ * \param theX the X coordinate of the first point
+ * \param theY the Y coordinate of the first point
+ * \param theOtherX the X coordinate of the second point
+ * \param theOtherY the Y coordinate of the second point
+ * \param theTolerance the tolerance to compare
+ * \param theDelta the sum of the a square of X and a square of Y
+ * \returns whether the points are provide to the pixel tolerance
+ */
+ static bool isEqualPixels( const int theX, const int theY,
+ const int theOtherX, const int theOtherY,
+ const double theTolerance, int& theDelta );
+
+
+ /*
+ * Returns whether the points are the same
+ * \param thePoint the first point
+ * \param theOtherPoint the second point
+ * \returns whether the points are provide to the pixel tolerance
+ */
+ static bool isEqualPoints( const gp_Pnt& thePoint,
+ const gp_Pnt& theOtherPoint );
+
+ /**
+ * Returns the array of points of a shape to construct a curve section. The
+ * shape can be either a wire or a vertex. For vertex a single point in the
+ * array is returned.
+ *
+ * \param theShape the shape. Can be either a wire or a vertex.
+ * \param IsClosed closed flag. Output parameter.
+ * \param IsBSpline BSpline flag. Output parameter.
+ * \return the array of points. Null handle in case of failure.
+ */
+ static Handle_TColgp_HArray1OfPnt getPoints
+ (const TopoDS_Shape &theShape,
+ bool &IsClosed,
+ bool &IsBSpline);
+
+ /**
+ * This method computes a plane using the input points. The plane is defined
+ * by gp_Pln object and the status. The status can have one of the following
+ * values:
+ * - 0 plane is not set.<BR>
+ * - 1 origin of the plane is fixed. The plane is defined by 1 or several
+ * coincident points.<BR>
+ * - 2 origin + OX axis of the plane is fixed. The plane is defined by 2
+ * or more points that lie on a particular line.<BR>
+ * - 3 plane is fixed. Plane is defined by 3 not coincident points.<BR>
+ *
+ * \param thePoints the points.
+ * \param thePlane the current plane on input. It can be modified on output.
+ * \param thePlnStatus the current status on input. It can be modified on
+ * output.
+ */
+ static void FindPlane(const Handle_TColgp_HArray1OfPnt &thePoints,
+ gp_Pln &thePlane,
+ Standard_Integer &thePlnStatus);
+
+};
+
+#endif // CURVECREATOR_UTILS_H
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "CurveCreator_UtilsICurve.hxx"
+
+#include "CurveCreator.hxx"
+#include <gp_Pnt.hxx>
+
+const double LOCAL_SELECTION_TOLERANCE = 0.0001;
+
+int CurveCreator_UtilsICurve::findLocalPointIndex( const CurveCreator_ICurve* theCurve,
+ int theSectionId, float theX, float theY )
+{
+ int aPntIndex = -1;
+ if ( !theCurve )
+ return aPntIndex;
+
+ CurveCreator::Coordinates aCoords;
+ for ( int i = 0, aNb = theCurve->getNbPoints( theSectionId ); i < aNb && aPntIndex < 0; i++ ) {
+ aCoords = theCurve->getPoint( theSectionId, i );
+ if ( aCoords.size() < 2 )
+ continue;
+ if ( fabs( aCoords[0] - theX ) < LOCAL_SELECTION_TOLERANCE &&
+ fabs( aCoords[1] - theY ) < LOCAL_SELECTION_TOLERANCE )
+ aPntIndex = i;
+ }
+
+ return aPntIndex;
+}
+
+void CurveCreator_UtilsICurve::findSectionsToPoints( const CurveCreator_ICurve* theCurve,
+ const double theX, const double theY,
+ CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ thePoints.clear();
+
+ int aPointId = -1;
+ for ( int i = 0, aNb = theCurve->getNbSections(); i < aNb; i++ ) {
+ aPointId = CurveCreator_UtilsICurve::findLocalPointIndex( theCurve, i, theX, theY );
+ if ( aPointId < 0 )
+ continue;
+ CurveCreator_ICurve::SectionToPoint aPoint = std::make_pair( i, aPointId );
+ if ( !CurveCreator_UtilsICurve::contains( thePoints, aPoint ) )
+ thePoints.push_back( aPoint );
+ }
+}
+
+void CurveCreator_UtilsICurve::convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
+ QMap<int, QList<int> >& theConvPoints )
+{
+ theConvPoints.clear();
+
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
+ aLast = thePoints.end();
+ QList<int> aPoints;
+ int aSectionId, aPointId;
+ for ( ; anIt != aLast; anIt++ ) {
+ aSectionId = anIt->first;
+ aPointId = anIt->second;
+ aPoints.clear();
+ if ( theConvPoints.contains( aSectionId ) )
+ aPoints = theConvPoints[aSectionId];
+ if ( aPoints.contains( aPointId ) )
+ continue;
+ aPoints.append( aPointId );
+ theConvPoints[aSectionId] = aPoints;
+ }
+}
+
+#include "CurveCreator_Curve.hxx" // TODO
+void CurveCreator_UtilsICurve::getPoint( const CurveCreator_ICurve* theCurve, const int theISection,
+ const int theIPoint, gp_Pnt& thePoint )
+{
+ double anX, anY, aZ;
+ // TODO
+ const CurveCreator_Curve* aCurve = dynamic_cast<const CurveCreator_Curve*>( theCurve );
+ if ( aCurve )
+ aCurve->getCoordinates( theISection, theIPoint, anX, anY, aZ );
+ thePoint = gp_Pnt( anX, anY, aZ);
+}
+
+std::string CurveCreator_UtilsICurve::getUniqSectionName( CurveCreator_ICurve* theCurve )
+{
+ for( int i = 0 ; i < 1000000 ; i++ ){
+ char aBuffer[255];
+ sprintf( aBuffer, "Section_%d", i+1 );
+ std::string aName(aBuffer);
+ int j;
+ for( j = 0 ; j < theCurve->getNbSections() ; j++ ){
+ if( theCurve->getSectionName(j) == aName )
+ break;
+ }
+ if( j == theCurve->getNbSections() )
+ return aName;
+ }
+ return "";
+}
+
+bool CurveCreator_UtilsICurve::contains( const CurveCreator_ICurve::SectionToPointList& theList,
+ const CurveCreator_ICurve::SectionToPoint& theValue )
+{
+ bool isFound = false;
+
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = theList.begin(),
+ aLast = theList.end();
+ for ( ; anIt != aLast && !isFound; anIt++ )
+ isFound = anIt->first == theValue.first && anIt->second == theValue.second;
+
+ return isFound;
+}
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef CURVECREATOR_UTILS_ICURVE_H
+#define CURVECREATOR_UTILS_ICURVE_H
+
+#include "CurveCreator_Macro.hxx"
+
+#include "CurveCreator_ICurve.hxx"
+
+#include <gp_Pnt.hxx>
+
+#include <QMap>
+#include <QList>
+
+class CurveCreator_UtilsICurve
+{
+public:
+
+ /*!
+ * Returns a point index in the model curve by the point coordinates in the viewer
+ * \param theX the X coordinate of the point
+ * \param theY the Y coordinate of the point
+ */
+ CURVECREATOR_EXPORT static int findLocalPointIndex( const CurveCreator_ICurve* theCurve,
+ int theSectionId, float theX, float theY );
+
+ CURVECREATOR_EXPORT static void findSectionsToPoints( const CurveCreator_ICurve* theCurve,
+ const double theX, const double theY,
+ CurveCreator_ICurve::SectionToPointList& thePoints );
+ CURVECREATOR_EXPORT static void convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
+ QMap<int, QList<int> >& theConvPoints );
+
+ CURVECREATOR_EXPORT static void getPoint( const CurveCreator_ICurve* theCurve, const int theISection,
+ const int theIPoint, gp_Pnt& thePoint );
+
+ /*!
+ * Returns a unique section name
+ * \param theCurve a curve interface
+ */
+ CURVECREATOR_EXPORT static std::string getUniqSectionName(
+ CurveCreator_ICurve* theCurve );
+
+ /**
+ * Returns whethe the container has the value
+ * \param theList a container of values
+ * \param theValue a value
+ */
+ CURVECREATOR_EXPORT static bool contains( const CurveCreator_ICurve::SectionToPointList& theList,
+ const CurveCreator_ICurve::SectionToPoint& theValue );
+};
+
+#endif // CURVECREATOR_UTILS_ICURVE_H
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "CurveCreator_Widget.h"
#include "CurveCreator_TreeView.h"
-#include "CurveCreator_Curve.hxx"
-#include "CurveCreator_CurveEditor.hxx"
+#include "CurveCreator_ICurve.hxx"
#include "CurveCreator.hxx"
-#include "CurveCreator_NewPointDlg.h"
#include "CurveCreator_NewSectionDlg.h"
-
-#include <GEOMUtils.hxx>
+#include "CurveCreator_Utils.hxx"
+#include "CurveCreator_UtilsICurve.hxx"
+#include "CurveCreator_TableView.h"
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_ViewManager.h>
-#include <OCCViewer_ViewWindow.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewPort3d.h>
-
-#include <BRep_Tool.hxx>
-#include <TopoDS.hxx>
+#include <OCCViewer_Utilities.h>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QMenu>
#include <QMouseEvent>
#include <QApplication>
+#include <QTableWidget>
+#include <QTime>
+
+//#define MEASURE_TIME
+
+#ifdef MEASURE_TIME
+
+ #define START_MEASURE_TIME \
+ QTime aTimer; \
+ aTimer.start(); \
+
+ #define END_MEASURE_TIME( theMsg ) \
+ double aTime = aTimer.elapsed() * 0.001; \
+ FILE* aFile = fopen( "performance", "a" ); \
+ fprintf( aFile, "%s = %.3lf sec\n", theMsg, aTime ); \
+ fclose( aFile ); \
+
+#else
+
+ #define START_MEASURE_TIME
+ #define END_MEASURE_TIME( theMsg )
+
+#endif
+
+
+
+
+
CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
- CurveCreator_Curve *theCurve,
- Qt::WindowFlags fl) :
- QWidget(parent), myNewPointEditor(NULL), myNewSectionEditor(NULL), myEdit(NULL), myCurve(theCurve)
-{
- if( myCurve )
- myEdit = new CurveCreator_CurveEditor( myCurve );
-
- CurveCreator::Dimension aDim = CurveCreator::Dim2d;
- if( myCurve )
- aDim = myCurve->getDimension();
- myNewPointEditor = new CurveCreator_NewPointDlg( aDim, this );
- myNewPointEditor->hide();
-// connect( myNewPointEditor, SIGNAL(addPoint()), this, SLOT(onAddNewPoint()) );
- connect( myNewPointEditor, SIGNAL(modifyPoint()), this, SLOT(onModifyPoint()) );
- connect( myNewPointEditor, SIGNAL(cancelPoint()), this, SLOT(onCancelPoint()) );
-
- myNewSectionEditor = new CurveCreator_NewSectionDlg( this );
- myNewSectionEditor->hide();
- connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) );
- connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) );
- connect( myNewSectionEditor, SIGNAL(cancelSection()), this, SLOT(onCancelSection()) );
-
- QGroupBox* aSectionGroup = new QGroupBox(tr("Sections"),this);
-
- mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup);
- connect( mySectionView, SIGNAL(selectionChanged()), this, SLOT( onSelectionChanged() ) );
- connect( mySectionView, SIGNAL(pointEntered(int,int)), this, SLOT(onEditPoint(int,int)) );
- connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) );
- connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
- QToolBar* aTB = new QToolBar(tr("TOOL_BAR_TLT"), aSectionGroup);
+ CurveCreator_ICurve *theCurve,
+ const int theActionFlags,
+ const QStringList& theCoordTitles,
+ Qt::WindowFlags fl,
+ int theLocalPointRowLimit )
+: QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
+ myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
+ myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit ),
+ myOld2DMode(OCCViewer_ViewWindow::No2dMode)
+{
+ bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
+ myNewSectionEditor = new CurveCreator_NewSectionDlg( this, isToEnableClosed );
+ myNewSectionEditor->hide();
+ connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) );
+ connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) );
+ connect( myNewSectionEditor, SIGNAL(cancelSection()), this, SLOT(onCancelSection()) );
+
+ QGroupBox* aSectionGroup = new QGroupBox(tr("SECTION_GROUP_TITLE"),this);
+
+ mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup);
+ mySectionView->setSelectionMode( QTreeView::ExtendedSelection );
+ connect( mySectionView, SIGNAL(selectionChanged()), this, SLOT( onSelectionChanged() ) );
+ connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) );
+ connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
+
+ myLocalPointView = new CurveCreator_TableView( myCurve, this, theCoordTitles );
+ connect( myLocalPointView, SIGNAL( cellChanged( int, int ) ),
+ this, SLOT( onCellChanged( int, int ) ) );
+
+ QToolBar* aTB = new QToolBar(tr("SECTION_GROUP_TITLE"), aSectionGroup);
// QToolButton* anUndoBtn = new QToolButton(aTB);
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- QPixmap anUndoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_UNDO")));
- QPixmap aRedoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_REDO")));
- QPixmap aNewSectionPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_SECTION")));
- QPixmap aNewPointPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_POINT")));
- QPixmap anEditPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
- QPixmap aDetectPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
- QPixmap aPolylinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
- QPixmap aSplinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_SPLINE")));
- QPixmap aRemovePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_DELETE")));
- QPixmap aJoinPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_JOIN")));
- QPixmap aStepUpPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_UP")));
- QPixmap aStepDownPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_DOWN")));
-
-/* QPixmap anUndoPixmap = QPixmap(tr(":images/ICON_UNDO"));
- QPixmap aRedoPixmap = QPixmap(tr(":images/ICON_REDO"));
- QPixmap aNewSectionPixmap = QPixmap(tr(":images/ICON_NEW_SECTION"));
- QPixmap aNewPointPixmap = QPixmap(tr(":images/ICON_NEW_POINT"));
- QPixmap aPolylinePixmap = QPixmap(tr(":images/ICON_POLYLINE"));
- QPixmap aSplinePixmap = QPixmap(tr(":images/ICON_SPLINE"));
- QPixmap aRemovePixmap = QPixmap(tr(":images/ICON_REMOVE"));
- QPixmap aJoinPixmap = QPixmap(tr(":images/ICON_JOIN"));
- QPixmap aStepUpPixmap = QPixmap(tr(":images/ICON_STEP_UP"));
- QPixmap aStepDownPixmap = QPixmap(tr(":images/ICON_STEP_DOWN"));*/
-
- QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Z) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onUndo()) );
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap anUndoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_UNDO")));
+ QPixmap aRedoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_REDO")));
+ QPixmap aNewSectionPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_SECTION")));
+ QPixmap aNewPointPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_POINT")));
+ QPixmap anEditPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
+ QPixmap aDetectPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
+ QPixmap aPolylinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
+ QPixmap aSplinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_SPLINE")));
+ QPixmap aRemovePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_DELETE")));
+ QPixmap aJoinPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_JOIN")));
+ QPixmap aStepUpPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_UP")));
+ QPixmap aStepDownPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_DOWN")));
+
+ QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_Z) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onUndo()) );
+ aTB->addAction(anAct);
+
+ anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_Y) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onRedo()) );
+ aTB->addAction(anAct);
+
+ aTB->addSeparator();
+
+ anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_N) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
+ if ( !(theActionFlags & DisableNewSection) ) {
aTB->addAction(anAct);
+ aTB->addSeparator();
+ }
- anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Y) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onRedo()) );
+ anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
+ QKeySequence() );
+ anAct->setCheckable(true);
+ connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onAdditionMode(bool)) );
+ connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
+ aTB->addAction(anAct);
+
+ anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"),
+ QKeySequence() );
+ anAct->setCheckable(true);
+ connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onModificationMode(bool)) );
+ connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
+ aTB->addAction(anAct);
+
+ anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"),
+ QKeySequence() );
+ anAct->setCheckable(true);
+ connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
+ connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
+ if ( !(theActionFlags & DisableDetectionMode) ) {
aTB->addAction(anAct);
+ }
+
+ anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_W) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
+
+ anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(),
+ tr("UNCLOSE_SECTIONS_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_S) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onUncloseSections()) );
+
+ anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"),
+ aPolylinePixmap, tr("SET_SECTIONS_POLYLINE_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_E) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onSetPolyline()) );
+
+ anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap,
+ tr("SET_SECTIONS_SPLINE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_R) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onSetSpline()) );
+
+ anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
+ connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
+ aTB->addAction(anAct);
+
+ aTB->addSeparator();
+
+ anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"),
+ QKeySequence(Qt::ControlModifier|Qt::Key_Plus ) );
+ connect( anAct, SIGNAL(triggered()), this, SLOT(onJoin()) );
+ aTB->addAction(anAct);
+
+ anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"),
+ QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Delete ) );
+ connect( anAct, SIGNAL(triggered()), this, SLOT( onClearAll()) );
+
+ anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"),
+ QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Plus ) );
+ connect( anAct, SIGNAL(triggered()), this, SLOT(onJoinAll()) );
+
+ QVBoxLayout* aSectLayout = new QVBoxLayout();
+ aSectLayout->setMargin( 5 );
+ aSectLayout->setSpacing( 5 );
+ aSectLayout->addWidget(aTB);
+ aSectLayout->addWidget(mySectionView);
+ aSectLayout->addWidget( myLocalPointView );
+ aSectionGroup->setLayout(aSectLayout);
+ QVBoxLayout* aLay = new QVBoxLayout();
+ aLay->setMargin( 0 );
+ aLay->setSpacing( 5 );
+// aLay->addLayout(aNameLayout);
+ aLay->addWidget(aSectionGroup);
+ setLayout(aLay);
- aTB->addSeparator();
+ updateActionsStates();
+ updateUndoRedo();
+}
- anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_N) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
- aTB->addAction(anAct);
- aTB->addSeparator();
+/**
+ * Set an OCC viewer
+ */
+void CurveCreator_Widget::setOCCViewer( OCCViewer_Viewer* theViewer )
+{
+ if ( myOCCViewer == theViewer )
+ return;
- anAct = createAction( INSERT_SECTION_BEFORE_ID, tr("INSERT_SECTION_BEFORE"), QPixmap(),
- tr("INSERT_SECTION_BEFORE_TLT"),
- QKeySequence(Qt::ControlModifier | Qt::Key_Insert ) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onInsertSectionBefore()) );
-
- anAct = createAction( INSERT_SECTION_AFTER_ID, tr("INSERT_SECTION_AFTER"), QPixmap(),
- tr("INSERT_SECTION_AFTER_TLT"),
- QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Insert ) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onInsertSectionAfter()) );
-
- anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
- QKeySequence() );
- anAct->setCheckable(true);
- connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onAdditionMode(bool)) );
- connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
- aTB->addAction(anAct);
+ if ( myOCCViewer ) {
+ OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
+ ( myOCCViewer->getViewManager() );
+ disconnect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ disconnect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ disconnect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ disconnect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
+ // restore normal mode in the viewer
+ SetViewer2DMode(false);
+ // all local contexts should be closed if the viewer is not more used
+ setLocalPointContext( false, true );
+ }
+
+ myOCCViewer = theViewer;
+ if ( myOCCViewer ) {
+ OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
+ ( myOCCViewer->getViewManager() );
+ connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ connect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ connect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ connect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
+ SetViewer2DMode(true);
+ }
+}
+
+/**
+ * Returns current OCC viewer
+ */
+OCCViewer_Viewer* CurveCreator_Widget::getOCCViewer()
+{
+ return myOCCViewer;
+}
+
+/**
+ * Returns OCC viewer context
+ */
+Handle(AIS_InteractiveContext) CurveCreator_Widget::getAISContext()
+{
+ Handle(AIS_InteractiveContext) aContext;
+ OCCViewer_Viewer* aViewer = getOCCViewer();
+ if ( aViewer )
+ aContext = aViewer->getAISContext();
+
+ return aContext;
+}
+
+/**
+ * Returns OCC viewer view port
+ */
+OCCViewer_ViewPort3d* CurveCreator_Widget::getViewPort()
+{
+ OCCViewer_ViewPort3d* aViewPort = 0;
+ OCCViewer_Viewer* aViewer = getOCCViewer();
+ if ( aViewer )
+ aViewPort = ((OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView())->getViewPort();
- anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"),
- QKeySequence() );
- anAct->setCheckable(true);
- connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onModificationMode(bool)) );
- connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
- aTB->addAction(anAct);
+ return aViewPort;
+}
- anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"),
- QKeySequence() );
- anAct->setCheckable(true);
- connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectPoints(bool)) );
- connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
- aTB->addAction(anAct);
+/**
+ * Set interaction style in the OCC viewer
+ * \param theStyle a new style
+ * \return the previous style
+ */
+int CurveCreator_Widget::changeInteractionStyle( int theStyle )
+{
+ OCCViewer_Viewer* aViewer = getOCCViewer();
+ if ( !aViewer )
+ return -1;
- anAct = createAction( INSERT_POINT_BEFORE_ID, tr("INSERT_POINT_BEFORE"), QPixmap(),
- tr("INSERT_POINT_BEFORE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_B) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onInsertPointBefore()) );
-
- anAct = createAction( INSERT_POINT_AFTER_ID, tr("INSERT_POINT_AFTER"), QPixmap(),
- tr("INSERT_POINT_AFTER_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_M) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onInsertPointAfter()) );
-
- anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_W) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
-
- anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(),
- tr("UNCLOSE_SECTIONS_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_S) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onUncloseSections()) );
-
- anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"),
- aPolylinePixmap, tr("SET_POLYLINE_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_E) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onSetPolyline()) );
-
- anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap,
- tr("SET_SPLINE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_R) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onSetSpline()) );
-
- anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
- connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
- aTB->addAction(anAct);
- aTB->addSeparator();
+ int aPrevStyle = aViewer->interactionStyle();
+ aViewer->setInteractionStyle( theStyle );
- anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Plus ) );
- connect( anAct, SIGNAL(triggered()), this, SLOT(onJoin()) );
- aTB->addAction(anAct);
- aTB->addSeparator();
+ return aPrevStyle;
+}
- anAct = createAction( UP_ID, tr("STEP_UP"), aStepUpPixmap, tr("STEP_UP_TLT"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Up ) );
- connect( anAct, SIGNAL(triggered()), this, SLOT(onMoveUp()) );
-
- anAct = createAction( DOWN_ID, tr("STEP_DOWN"), aStepDownPixmap, tr("STEP_DOWN"),
- QKeySequence(Qt::ControlModifier|Qt::Key_Down ) );
- connect( anAct, SIGNAL(triggered()), this, SLOT(onMoveDown()) );
-
- anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"),
- QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Delete ) );
- connect( anAct, SIGNAL(triggered()), this, SLOT( onClearAll()) );
-
- anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"),
- QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Plus ) );
- connect( anAct, SIGNAL(triggered()), this, SLOT(onJoinAll()) );
-
- QVBoxLayout* aSectLayout = new QVBoxLayout();
- aSectLayout->setMargin( 5 );
- aSectLayout->setSpacing( 5 );
- aSectLayout->addWidget(aTB);
- aSectLayout->addWidget(mySectionView);
- aSectionGroup->setLayout(aSectLayout);
- QVBoxLayout* aLay = new QVBoxLayout();
- aLay->setMargin( 0 );
- aLay->setSpacing( 5 );
-// aLay->addLayout(aNameLayout);
- aLay->addWidget(aSectionGroup);
- setLayout(aLay);
- onSelectionChanged();
+//=======================================================================
+// function: reset
+// purpose: reset the widget viewer, close local context, clear selection
+//=======================================================================
+void CurveCreator_Widget::reset()
+{
}
-void CurveCreator_Widget::setCurve( CurveCreator_Curve* theCurve )
+void CurveCreator_Widget::setCurve( CurveCreator_ICurve* theCurve )
{
- if( myEdit != NULL ){
- delete myEdit;
- myEdit = NULL;
- }
myCurve = theCurve;
- mySectionView->setCurve(myCurve);
- if( myCurve != NULL ){
- myEdit = new CurveCreator_CurveEditor(myCurve);
- }
- onSelectionChanged();
+ mySectionView->setCurve( myCurve );
+ myLocalPointView->setCurve( myCurve );
+ updateActionsStates();
updateUndoRedo();
}
void CurveCreator_Widget::onSelectionChanged()
+{
+ updateActionsStates();
+ updateUndoRedo();
+ emit selectionChanged();
+}
+
+void CurveCreator_Widget::updateActionsStates()
{
QList<ActionId> anEnabledAct;
if( myCurve ){
- anEnabledAct << NEW_SECTION_ID;
+ anEnabledAct << NEW_SECTION_ID << MODIFICATION_MODE_ID;
+ if ( removeEnabled() )
+ anEnabledAct << REMOVE_ID;
QList<int> aSelSections = mySectionView->getSelectedSections();
- QList< QPair< int, int > > aSelPoints = mySectionView->getSelectedPoints();
CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
switch( aSelType ){
case CurveCreator_TreeView::ST_NOSEL:{
anEnabledAct << UP_ID;
}*/
if( aSelSections.size() == 1 ){
- anEnabledAct << ADDITION_MODE_ID << MODIFICATION_MODE_ID << DETECTION_MODE_ID;
+ anEnabledAct << ADDITION_MODE_ID << DETECTION_MODE_ID;
}
- if (myActionMap[ADDITION_MODE_ID]->isChecked()) {
- mySection = -1;
- myPointNum = -1;
- QList<int> aSelSection = mySectionView->getSelectedSections();
- if( aSelSection.size() > 0 ){
- mySection = aSelSection[0];
- myPointNum = myCurve->getNbPoints(mySection);
+ switch ( getActionMode() ) {
+ case AdditionMode: {
+ mySection = -1;
+ myPointNum = -1;
+ QList<int> aSelSection = mySectionView->getSelectedSections();
+ if( aSelSection.size() > 0 ){
+ mySection = aSelSection[0];
+ myPointNum = myCurve->getNbPoints(mySection);
+ }
}
- } else if (myActionMap[MODIFICATION_MODE_ID]->isChecked()) {
- anEnabledAct << REMOVE_ID;
- anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
- int aSectCnt = myCurve->getNbSections();
- if( aSectCnt > 0 )
- anEnabledAct << CLEAR_ALL_ID;
- if( aSectCnt > 1 )
- anEnabledAct << JOIN_ALL_ID;
- if( aSelSections.size() > 1 ){
- anEnabledAct << JOIN_ID;
+ break;
+ case ModificationMode: {
+ if ( myNewSectionEditor->isEnableClosed() )
+ anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID;
+ anEnabledAct << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
+ int aSectCnt = myCurve->getNbSections();
+ if( aSectCnt > 0 )
+ anEnabledAct << CLEAR_ALL_ID;
+ if( aSectCnt > 1 )
+ anEnabledAct << JOIN_ALL_ID;
+ if( aSelSections.size() > 1 ){
+ anEnabledAct << JOIN_ID;
+ }
+ }
+ break;
+ case DetectionMode: {
}
- } else if (myActionMap[DETECTION_MODE_ID]->isChecked()) {
- } else { //no active mode
+ break;
+ case NoneMode:
+ {
+ int aSectCnt = myCurve->getNbSections();
+ if( aSectCnt > 1 )
+ anEnabledAct << JOIN_ALL_ID;
+ if( aSelSections.size() > 1 )
+ anEnabledAct << JOIN_ID;
+ }
+ break;
+ default:
+ break;
}
/*if( aSelSections[ aSelSections.size() - 1 ] < ( myCurve->getNbSections() - 1 ) ){
anEnabledAct << DOWN_ID;
}
}
}
- emit selectionChanged();
}
void CurveCreator_Widget::onAdditionMode(bool checked)
{
- if( !myEdit )
+ if (!checked)
return;
- SUIT_ViewWindow* aViewWindow = 0;
- SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy();
- if ( activeStudy )
- aViewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
- if ( aViewWindow == 0 )
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+ if( !myCurve || aContext.IsNull() )
return;
- SUIT_ViewManager* aViewManager = aViewWindow->getViewManager();
-
- if ( aViewManager->getType() == OCCViewer_Viewer::Type() ) {
- if (checked) {
- connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( onGetPointByClick( SUIT_ViewWindow*, QMouseEvent* ) ) );
- } else {
- disconnect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( onGetPointByClick( SUIT_ViewWindow*, QMouseEvent* ) ) );
- return;
- }
- }
mySection= -1;
myPointNum = -1;
if( aSelSection.size() > 0 ){
mySection = aSelSection[0];
}
- else{
- QList< QPair<int,int> > aSelPoints = mySectionView->getSelectedPoints();
- if( aSelPoints.size() > 0 ){
- mySection = aSelPoints[0].first;
- myPointNum = aSelPoints[0].second + 1;
- }
- }
-/*
- QString aSectName;
- if( mySection < 0 ){
- mySection = myCurve->getNbSections() - 1;
- }
- aSectName = QString::fromStdString( myCurve->getSectionName(mySection));
- if( myPointNum < 0 ){
- myPointNum = myCurve->getNbPoints(mySection);
- }
- myNewPointEditor->clear();
- myNewPointEditor->setEditMode(false);
- myNewPointEditor->setSectionName(aSectName);
- myNewPointEditor->setDimension(myCurve->getDimension());
-*/
// emit subOperationStarted( myNewPointEditor );
}
void CurveCreator_Widget::onModificationMode(bool checked)
{
- SUIT_ViewWindow* aViewWindow = 0;
- SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy();
- if ( activeStudy )
- aViewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
- if ( aViewWindow == 0 )
- return;
- SUIT_ViewManager* aViewManager = aViewWindow->getViewManager();
- if ( aViewManager->getType() == OCCViewer_Viewer::Type() ) {
- if (checked) {
-// connect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
-// this, SLOT( onPointSelect( SUIT_ViewWindow*, QMouseEvent* ) ) );
- connect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( onPointDrag( SUIT_ViewWindow*, QMouseEvent* ) ) );
- }
- else {
-// disconnect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
-// this, SLOT( onPointSelect( SUIT_ViewWindow*, QMouseEvent* ) ) );
- disconnect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
- this, SLOT( onPointDrag( SUIT_ViewWindow*, QMouseEvent* ) ) );
- return;
- }
- }
+ myLocalPointView->setVisible( checked );
}
-void CurveCreator_Widget::onDetectPoints(bool checked)
+void CurveCreator_Widget::onDetectionMode(bool checked)
{
}
void CurveCreator_Widget::onModeChanged(bool checked)
{
+ ActionMode aMode = NoneMode;
if (checked) {
QAction* anAction = (QAction*)sender();
switch(myActionMap.key(anAction)) {
case ADDITION_MODE_ID:
+ aMode = AdditionMode;
if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
myActionMap[MODIFICATION_MODE_ID]->trigger();
else if (myActionMap[DETECTION_MODE_ID]->isChecked())
myActionMap[DETECTION_MODE_ID]->trigger();
break;
case MODIFICATION_MODE_ID:
+ aMode = ModificationMode;
if (myActionMap[ADDITION_MODE_ID]->isChecked())
myActionMap[ADDITION_MODE_ID]->trigger();
else if (myActionMap[DETECTION_MODE_ID]->isChecked())
myActionMap[DETECTION_MODE_ID]->trigger();
break;
case DETECTION_MODE_ID:
+ aMode = DetectionMode;
if (myActionMap[ADDITION_MODE_ID]->isChecked())
myActionMap[ADDITION_MODE_ID]->trigger();
else if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
break;
}
}
- onSelectionChanged();
-}
-
-void CurveCreator_Widget::onAddNewPoint(const CurveCreator::Coordinates& theCoords)
-{
- if( !myEdit )
- return;
-// CurveCreator::Coordinates aCoords = myNewPointEditor->getCoordinates();
- myEdit->insertPoints(theCoords, mySection, myPointNum );
- mySectionView->pointsAdded( mySection, myPointNum );
-// myNewPointEditor->clear();
- myPointNum++;
- onSelectionChanged();
+ updateActionsStates();
updateUndoRedo();
+ setLocalPointContext( aMode == ModificationMode, true );
}
void CurveCreator_Widget::onNewSection()
{
- if( !myEdit )
+ if( !myCurve )
return;
+
+ stopActionMode();
myNewSectionEditor->clear();
myNewSectionEditor->setEditMode(false);
- QString aSectName = QString( myCurve->getUnicSectionName().c_str() );
+ QString aSectName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
myNewSectionEditor->setSectionParameters(aSectName, true, CurveCreator::Polyline );
- emit subOperationStarted( myNewSectionEditor );
+ emit subOperationStarted( myNewSectionEditor, false );
}
void CurveCreator_Widget::onAddNewSection()
{
- if( !myEdit )
+ if( !myCurve )
return;
- CurveCreator::Coordinates aCoords;
- myEdit->addSection( myNewSectionEditor->getName().toStdString(), myNewSectionEditor->getSectionType(),
- myNewSectionEditor->isClosed(), aCoords );
- mySectionView->sectionAdded( mySection );
- QString aNewName = QString(myCurve->getUnicSectionName().c_str());
+ myCurve->addSection( myNewSectionEditor->getName().toStdString(),
+ myNewSectionEditor->getSectionType(),
+ myNewSectionEditor->isClosed() );
+ mySectionView->sectionAdded( -1 ); // add a new section to the end of list
+ QString aNewName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
myNewSectionEditor->setSectionName(aNewName);
- mySection++;
- onSelectionChanged();
+ updateActionsStates();
updateUndoRedo();
onCancelSection();
}
-void CurveCreator_Widget::onCancelPoint()
-{
- emit subOperationFinished( myNewPointEditor );
-}
-
void CurveCreator_Widget::onCancelSection()
{
emit subOperationFinished( myNewSectionEditor );
return anAct;
}
-QAction* CurveCreator_Widget::getAction(ActionId theId)
+QAction* CurveCreator_Widget::getAction( ActionId theId )
{
if( myActionMap.contains(theId) )
return myActionMap[theId];
return NULL;
}
+QAction* CurveCreator_Widget::getAction( ActionMode theMode )
+{
+ ActionId anActionId = NONE_ID;
+ switch ( theMode ) {
+ case AdditionMode:
+ anActionId = ADDITION_MODE_ID;
+ break;
+ case ModificationMode:
+ anActionId = MODIFICATION_MODE_ID;
+ break;
+ case DetectionMode:
+ anActionId = DETECTION_MODE_ID;
+ break;
+ default:
+ break;
+ }
+ QAction* anAction = 0;
+ if ( anActionId != NONE_ID && myActionMap.contains( anActionId ) )
+ anAction = myActionMap[anActionId];
+ return anAction;
+}
+
void CurveCreator_Widget::onEditSection( int theSection )
{
- if( !myEdit )
+ if( !myCurve )
return;
+
+ stopActionMode();
mySection = theSection;
QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
bool isClosed = myCurve->isClosed(theSection);
- CurveCreator::Type aType = myCurve->getType(theSection);
+ CurveCreator::SectionType aType = myCurve->getSectionType(theSection);
myNewSectionEditor->setEditMode(true);
myNewSectionEditor->setSectionParameters( aSectName, isClosed, aType );
- emit subOperationStarted( myNewSectionEditor );
+ emit subOperationStarted( myNewSectionEditor, true );
}
void CurveCreator_Widget::onModifySection()
{
- if( !myEdit )
+ if( !myCurve )
return;
QString aName = myNewSectionEditor->getName();
bool isClosed = myNewSectionEditor->isClosed();
- CurveCreator::Type aSectType = myNewSectionEditor->getSectionType();
- myEdit->startOperation();
- myEdit->setClosed( isClosed, mySection );
- myEdit->setName( aName.toStdString(), mySection );
- myEdit->setType( aSectType, mySection );
- myEdit->finishOperation();
+ CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
+ if( myCurve->getSectionName(mySection) != aName.toStdString() )
+ myCurve->setSectionName( mySection , aName.toStdString() );
+
+ bool isGeomModified = false;
+
+ if( myCurve->getSectionType(mySection) != aSectType ) {
+ myCurve->setSectionType( mySection, aSectType );
+ isGeomModified = true;
+ }
+
+ if( myCurve->isClosed(mySection) != isClosed ) {
+ myCurve->setClosed( mySection, isClosed );
+ isGeomModified = true;
+ }
mySectionView->sectionChanged(mySection);
updateUndoRedo();
onCancelSection();
-}
-void CurveCreator_Widget::onEditPoint( int theSection, int thePoint )
-{
- if( !myNewPointEditor || !myEdit )
- return;
- mySection = theSection;
- myPointNum = thePoint;
- QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
- myNewPointEditor->setEditMode(true);
- myNewPointEditor->setSectionName(aSectName);
- myNewPointEditor->setDimension( myCurve->getDimension() );
- CurveCreator::Coordinates aCoords = myCurve->getCoordinates(theSection,thePoint);
- myNewPointEditor->setCoordinates(aCoords);
- emit subOperationStarted( myNewPointEditor );
-}
-
-void CurveCreator_Widget::onModifyPoint()
-{
- if( !myEdit )
- return;
- CurveCreator::Coordinates aCoords = myNewPointEditor->getCoordinates();
- myEdit->setCoordinates( aCoords, mySection, myPointNum );
- mySectionView->pointDataChanged( mySection, myPointNum );
- updateUndoRedo();
- onCancelPoint();
+ emit curveModified();
}
void CurveCreator_Widget::onJoin()
{
- if( !myEdit )
+ if( !myCurve )
return;
QList<int> aSections = mySectionView->getSelectedSections();
if( aSections.size() == 0 ){
return;
}
- int aMainSect = aSections[0];
- int aMainSectSize = myCurve->getNbPoints(aMainSect);
- myEdit->startOperation();
- for( int i = 1 ; i < aSections.size() ; i++ ){
- int aSectNum = aSections[i] - (i-1);
- myEdit->join( aMainSect, aSectNum );
- mySectionView->sectionsRemoved( aSectNum );
+ stopActionMode();
+
+ std::list<int> aSectionsToJoin;
+ for( int i = 0; i < aSections.size() ; i++ ){
+ aSectionsToJoin.push_back( aSections[i] );
+ }
+ //int aMainSect = aSectionsToJoin.front();
+ //int aMainSectSize = myCurve->getNbPoints(aMainSect);
+ if ( myCurve->join( aSectionsToJoin ) )
+ {
+ std::list<int>::const_iterator anIt = aSectionsToJoin.begin(),
+ aLast = aSectionsToJoin.end();
+ // the first section should be skipped. It is not removed, but is modified
+ anIt++;
+ for ( ; anIt != aLast; anIt++ )
+ mySectionView->sectionsRemoved( *anIt );
}
- myEdit->finishOperation();
+
+ /* The update for the points of the main section
int aNewSectSize = myCurve->getNbPoints(aMainSect);
if( aNewSectSize != aMainSectSize )
- mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );
+ mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );*/
updateUndoRedo();
-}
-void CurveCreator_Widget::onRemove()
-{
- if( !myEdit )
- return;
- QList< QPair<int,int> > aSelPoints = mySectionView->getSelectedPoints();
- int aCurrSect=-1;
- int aRemoveCnt = 0;
- myEdit->startOperation();
- for( int i = 0 ; i < aSelPoints.size() ; i++ ){
- if( aCurrSect != aSelPoints[i].first ){
- aRemoveCnt = 0;
- aCurrSect = aSelPoints[i].first;
- }
- int aPntIndx = aSelPoints[i].second - aRemoveCnt;
- myEdit->removePoints(aCurrSect,aPntIndx, 1);
- mySectionView->pointsRemoved( aCurrSect, aPntIndx );
- aRemoveCnt++;
- }
- QList<int> aSections = mySectionView->getSelectedSections();
- for( int i = 0 ; i < aSections.size() ; i++ ){
- int aSectNum = aSections[i] - (i);
- myEdit->removeSection( aSectNum );
- mySectionView->sectionsRemoved( aSectNum );
- }
- myEdit->finishOperation();
- mySectionView->clearSelection();
- updateUndoRedo();
+ emit curveModified();
}
-void CurveCreator_Widget::onMoveUp()
+void CurveCreator_Widget::onRemove()
{
- if( !myEdit )
+ if( !myCurve )
return;
- if( mySectionView->getSelectionType() == CurveCreator_TreeView::ST_SECTIONS ){
- //Move sections
- QList<int> aSections = mySectionView->getSelectedSections();
- for( int i = 0 ; i < aSections.size() ; i++ ){
- int anIndx = aSections[i];
- myEdit->moveSection( anIndx, anIndx-1);
- mySectionView->sectionsSwapped( anIndx, -1 );
- }
- }
- else{
- //Move points
- QList< QPair<int,int> > aPoints = mySectionView->getSelectedPoints();
- for( int i = 0 ; i < aPoints.size() ; i++ ){
- int aSection = aPoints[i].first;
- int aPoint = aPoints[i].second;
- myEdit->movePoint(aSection, aPoint, aPoint-2);
- mySectionView->pointsSwapped( aSection, aPoint, -1 );
- }
- }
- updateUndoRedo();
-}
-void CurveCreator_Widget::onMoveDown()
-{
- if( !myEdit )
- return;
- if( mySectionView->getSelectionType() == CurveCreator_TreeView::ST_SECTIONS ){
- //Move sections
- QList<int> aSections = mySectionView->getSelectedSections();
- for( int i = aSections.size()-1 ; i >=0 ; i-- ){
- int anIndx = aSections[i];
- myEdit->moveSection( anIndx, anIndx+1);
- mySectionView->sectionsSwapped( anIndx, 1 );
- }
- }
- else{
- //Move points
- QList< QPair<int,int> > aPoints = mySectionView->getSelectedPoints();
- for( int i = aPoints.size() - 1; i >= 0 ; i-- ){
- int aSection = aPoints[i].first;
- int aPoint = aPoints[i].second;
- myEdit->movePoint(aSection, aPoint, aPoint+1);
- mySectionView->pointsSwapped( aSection, aPoint, 1 );
- }
+ switch( getActionMode() ) {
+ case NoneMode:
+ removeSection();
+ break;
+ case ModificationMode:
+ removePoint();
+ break;
+ default:
+ break;
}
- updateUndoRedo();
}
void CurveCreator_Widget::onClearAll()
{
- if( !myEdit )
+ if( !myCurve )
return;
- myEdit->clear();
+ stopActionMode();
+ myCurve->clear();
mySectionView->reset();
- onSelectionChanged();
+ updateActionsStates();
updateUndoRedo();
+
+ emit curveModified();
}
void CurveCreator_Widget::onJoinAll()
{
- if( !myEdit )
+ if( !myCurve )
return;
- myEdit->join();
- mySectionView->reset();
- onSelectionChanged();
- updateUndoRedo();
-}
+ stopActionMode();
-void CurveCreator_Widget::onInsertSectionBefore()
-{
-
-}
-
-void CurveCreator_Widget::onInsertSectionAfter()
-{
-
-}
-
-void CurveCreator_Widget::onInsertPointBefore()
-{
-
-}
+ std::list<int> aSectionsToJoin;
+ for( int i = 0, aNb = myCurve->getNbSections(); i < aNb ; i++ ){
+ aSectionsToJoin.push_back( i );
+ }
+ bool aRes = myCurve->join( aSectionsToJoin );
-void CurveCreator_Widget::onInsertPointAfter()
-{
+ mySectionView->reset();
+ updateActionsStates();
+ updateUndoRedo();
+ emit curveModified();
}
void CurveCreator_Widget::onUndoSettings()
void CurveCreator_Widget::onSetSpline()
{
- if( !myEdit )
+ if( !myCurve )
return;
+ stopActionMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
- myEdit->startOperation();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myEdit->setType(CurveCreator::BSpline, aSelSections[i]);
+ myCurve->setSectionType(aSelSections[i], CurveCreator::Spline );
mySectionView->sectionChanged(aSelSections[i]);
}
- myEdit->finishOperation();
updateUndoRedo();
+
+ emit curveModified();
}
void CurveCreator_Widget::onSetPolyline()
{
- if( !myEdit )
+ if( !myCurve )
return;
- myEdit->startOperation();
+ stopActionMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myEdit->setType(CurveCreator::Polyline, aSelSections[i]);
- mySectionView->sectionChanged(aSelSections[i]);
+ myCurve->setSectionType( aSelSections[i], CurveCreator::Polyline );
+ mySectionView->sectionChanged( aSelSections[i] );
}
- myEdit->finishOperation();
updateUndoRedo();
+
+ emit curveModified();
}
void CurveCreator_Widget::onCloseSections()
{
- if( !myEdit )
+ if( !myCurve )
return;
- myEdit->startOperation();
+ stopActionMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myEdit->setClosed(true, aSelSections[i]);
+ myCurve->setClosed(aSelSections[i], true);
mySectionView->sectionChanged(aSelSections[i]);
}
- myEdit->finishOperation();
updateUndoRedo();
+
+ emit curveModified();
}
void CurveCreator_Widget::onUncloseSections()
{
- if( !myEdit )
+ if( !myCurve )
return;
- myEdit->startOperation();
+ stopActionMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myEdit->setClosed(false, aSelSections[i]);
+ myCurve->setClosed(aSelSections[i], false);
mySectionView->sectionChanged(aSelSections[i]);
}
- myEdit->finishOperation();
updateUndoRedo();
+
+ emit curveModified();
}
void CurveCreator_Widget::onUndo()
{
- if( !myEdit )
- return;
- myEdit->undo();
- mySectionView->reset();
- updateUndoRedo();
+ if( !myCurve )
+ return;
+
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+ myCurve->undo();
+ finishCurveModification();
+ mySectionView->reset();
+
+ emit curveModified();
}
void CurveCreator_Widget::onRedo()
{
- if( !myEdit )
- return;
- myEdit->redo();
- mySectionView->reset();
- updateUndoRedo();
+ if( !myCurve )
+ return;
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+ myCurve->redo();
+ finishCurveModification();
+ mySectionView->reset();
+
+ emit curveModified();
}
void CurveCreator_Widget::updateUndoRedo()
{
- QAction* anAct = myActionMap[UNDO_ID];
- if( anAct != 0 ){
- if( myEdit->getNbUndo() != 0 ){
- anAct->setEnabled(true);
- }
- else{
- anAct->setDisabled(true);
- }
+ if( !myCurve )
+ return;
+ QAction* anAct = myActionMap[UNDO_ID];
+ if( anAct != 0 ){
+ if( myCurve->getNbUndo() != 0 ){
+ anAct->setEnabled(true);
}
- anAct = myActionMap[REDO_ID];
- if( anAct != 0 ){
- if( myEdit->getNbRedo() != 0 ){
- anAct->setEnabled(true);
- }
- else{
- anAct->setDisabled(true);
- }
+ else{
+ anAct->setDisabled(true);
+ }
+ }
+ anAct = myActionMap[REDO_ID];
+ if( anAct != 0 ){
+ if( myCurve->getNbRedo() != 0 ){
+ anAct->setEnabled(true);
}
+ else{
+ anAct->setDisabled(true);
+ }
+ }
}
void CurveCreator_Widget::onContextMenu( QPoint thePoint )
{
QList<ActionId> aContextActions;
- aContextActions << CLEAR_ALL_ID << JOIN_ALL_ID << SEPARATOR_ID <<
+ aContextActions << CLEAR_ALL_ID << JOIN_ID << JOIN_ALL_ID << SEPARATOR_ID <<
CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID <<
SET_SECTIONS_SPLINE_ID;
QPoint aGlPoint = mySectionView->mapToGlobal(thePoint);
return mySectionView->getSelectedSections();
}
-QList< QPair< int, int > > CurveCreator_Widget::getSelectedPoints()
+void CurveCreator_Widget::setSelectedSections( const QList<int>& theSections )
{
- return mySectionView->getSelectedPoints();
+ mySectionView->setSelectedSections( theSections );
+ updateActionsStates();
+ updateUndoRedo();
}
-bool CurveCreator_Widget::isInstantSketchingEnabled() const
+/**
+ * According to the widget state, performs the remove action
+ */
+void CurveCreator_Widget::removeSelected()
{
- if( myNewPointEditor )
- return myNewPointEditor->isInstantSketchingEnabled();
- return false;
+ onRemove();
}
-void CurveCreator_Widget::setInstantSketchingEnabled( const bool theState )
+/**
+ * Checks whether there are some selection to be removed
+ */
+bool CurveCreator_Widget::removeEnabled()
{
- if( myNewPointEditor )
- myNewPointEditor->setInstantSketchingEnabled( theState );
+ bool isEnabled = getActionMode() == ModificationMode;
+ if ( !isEnabled ) {
+ QList<int> aSelSections = mySectionView->getSelectedSections();
+ CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
+ isEnabled = aSelType == CurveCreator_TreeView::ST_SECTIONS &&
+ aSelSections.size() == 1;
+ }
+ return isEnabled;
+}
+
+void CurveCreator_Widget::setActionMode( const ActionMode& theMode )
+{
+ ActionMode aPrevMode = getActionMode();
+ QAction* aPrevAction = getAction( aPrevMode );
+ QAction* anAction = getAction( theMode );
+ switch ( theMode ) {
+ case NoneMode:
+ case AdditionMode: {
+ if ( aPrevAction ) {
+ if ( aPrevAction->isChecked() ) {
+ aPrevAction->setChecked( false );
+ }
+ }
+ if ( aPrevMode == ModificationMode )
+ onModificationMode( false );
+ if ( aPrevMode == AdditionMode )
+ onAdditionMode( false );
+
+ if ( theMode == AdditionMode )
+ {
+ anAction->setChecked( true );
+ onModeChanged( true );
+ }
+ }
+ break;
+ break;
+ case ModificationMode:
+ {
+ //TODO
+ }
+ break;
+ case DetectionMode:
+ break;
+ }
+}
+
+CurveCreator_Widget::ActionMode CurveCreator_Widget::getActionMode() const
+{
+ ActionMode aMode = NoneMode;
+
+ if ( myActionMap[ADDITION_MODE_ID]->isChecked() )
+ aMode = AdditionMode;
+ else if ( myActionMap[MODIFICATION_MODE_ID]->isChecked() )
+ aMode = ModificationMode;
+ else if ( myActionMap[DETECTION_MODE_ID]->isChecked() )
+ aMode = DetectionMode;
+
+ return aMode;
+}
+
+void CurveCreator_Widget::SetViewer2DMode(const bool To2D)
+{
+ if (myOCCViewer) {
+ if (To2D) {
+ myOld2DMode = OCCViewer_Utilities::setViewer2DMode
+ (myOCCViewer, OCCViewer_ViewWindow::XYPlane);
+ } else {
+ OCCViewer_Utilities::setViewer2DMode(myOCCViewer, myOld2DMode);
+ }
+ }
}
//=================================================================================
-// function : GeometryGUI::onGetPointByClick()
+// function : GeometryGUI::addCoordsByClick()
// purpose : Manage mouse press events in Additon mode
//=================================================================================
-void CurveCreator_Widget::onGetPointByClick( SUIT_ViewWindow* theViewWindow, QMouseEvent* pe )
+void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
{
- if ( myNewPointEditor && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
- pe->modifiers() != Qt::ControlModifier ) {
- OCCViewer_Viewer* anOCCViewer =
- ( (OCCViewer_ViewManager*)( theViewWindow->getViewManager() ) )->getOCCViewer();
- Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
+ if (pe->button() != Qt::LeftButton)
+ return;
+
+ if ( pe->modifiers() != Qt::ControlModifier ) {
+ Handle(AIS_InteractiveContext) ic = getAISContext();
+ if ( ic.IsNull() )
+ return;
gp_Pnt aPnt;
else
ic->Select(); // New selection
- /*TopoDS_Shape aShape;
-
- ic->InitSelected();
- if ( ic->MoreSelected() )
- aShape = ic->SelectedShape();
-
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
- aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
- else*/
{
- OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
- aPnt = GEOMUtils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
+ OCCViewer_ViewPort3d* vp = getViewPort();
+ aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
// set the coordinates into dialog
CurveCreator::Coordinates aCoords;
if ( myCurve->getDimension() == 3 ) {
aCoords.push_back( aPnt.Z() );
}
- onAddNewPoint(aCoords);
-// myNewPointEditor->setCoordinates( aCoords );
+ addNewPoint(aCoords);
}
}
-//=================================================================================
-// function : GeometryGUI::onPointDrag()
-// purpose : Manage mouse move events in Modification mode
-//=================================================================================
-void CurveCreator_Widget::onPointDrag( SUIT_ViewWindow* theViewWindow, QMouseEvent* pe )
+/**
+ * Manage mouse press events
+ * \param theWindow an owner of the signal
+ * \param theEvent a mouse event
+ */
+void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent )
{
- if ( !(pe->buttons() & Qt::LeftButton) )
+ if ( theEvent->button() != Qt::LeftButton )
return;
- if ( (pe->pos() - myDragStartPosition).manhattanLength() < QApplication::startDragDistance() )
+
+ myPressedX = theEvent->x();
+ myPressedY = theEvent->y();
+
+ switch( getActionMode() ) {
+ case ModificationMode: {
+ //store initial cursor position for Drag&Drop
+ setDragStarted( true, theEvent->pos() );
+ break;
+ }
+ case AdditionMode: {
+ addCoordsByClick( theEvent );
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/**
+ * Manage mouse release events in Modification mode
+ * \param theWindow an owner of the signal
+ * \param theEvent a mouse event
+ */
+void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent )
+{
+ if ( getActionMode() != ModificationMode )
return;
-/*
- QDrag *drag = new QDrag(this);
- QMimeData *mimeData = new QMimeData;
-
- mimeData->setData(mimeType, data);
- drag->setMimeData(mimeData);
-
- Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction);
- */
+
+ if ( myDragStarted ) {
+ bool isDragged = myDragged;
+ CurveCreator_ICurve::SectionToPointList aDraggedPoints;
+ QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float > > anInitialDragPointsCoords;
+ if ( myDragged ) {
+ aDraggedPoints = myDragPoints;
+ anInitialDragPointsCoords = myInitialDragPointsCoords;
+ }
+
+ setDragStarted( false );
+
+ if ( aDraggedPoints.size() > 0 ) {
+ // Collect old coordinates of the dragged points
+ CurveCreator_ICurve::SectionToPointCoordsList anOldPoints;
+ foreach ( const CurveCreator_ICurve::SectionToPoint aSectionToPoint, anInitialDragPointsCoords.keys() ) {
+ CurveCreator::Coordinates aCoords = anInitialDragPointsCoords.value( aSectionToPoint );
+ anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
+ }
+
+ if ( myCurve->canPointsBeSorted() ) {
+ // Add old coordinates of the curve points (except the dragged points) to the list
+ for( int aSectionId = 0 ; aSectionId < myCurve->getNbSections() ; aSectionId++ ) {
+ CurveCreator::Coordinates aCoords;
+ for ( int aPointId = 0, aNb = myCurve->getNbPoints( aSectionId ); aPointId < aNb; aPointId++ ) {
+ aCoords = myCurve->getPoint( aSectionId, aPointId );
+ if ( aCoords.size() < 2 ) {
+ continue;
+ }
+
+ CurveCreator_ICurve::SectionToPoint aSectionToPoint = std::make_pair( aSectionId, aPointId );
+
+ if ( !anInitialDragPointsCoords.contains( aSectionToPoint ) ) {
+ anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
+ }
+ }
+ }
+
+ // Apply points sorting
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+
+ myCurve->setSkipSorting( false );
+
+ CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aDraggedPoints.begin(),
+ aLast = aDraggedPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ int aPointId = anIt->second;
+ std::deque<float> aPos = myCurve->getPoint( aSectionId, aPointId );
+
+ aCoordList.push_back(
+ std::make_pair( std::make_pair( aSectionId, aPointId ), aPos ) );
+ }
+
+ myCurve->setSeveralPoints( aCoordList, false );
+
+ finishCurveModification( aDraggedPoints );
+ } else {
+ // if the drag of some points has happened, restore the drag selection
+ START_MEASURE_TIME;
+ setSelectedPoints( aDraggedPoints );
+ END_MEASURE_TIME( "drop" );
+ }
+
+ // Save drag difference
+ myCurve->saveCoordDiff( anOldPoints );
+ }
+ }
+ else // check whether the segment is clicked an a new point should be added to the segment
+ {
+ int aReleasedX = theEvent->x();
+ int aReleasedY = theEvent->y();
+ if ( myPressedX == aReleasedX && myPressedY == aReleasedY )
+ insertPointToSelectedSegment( aReleasedX, aReleasedY );
+ }
+
+ // updates the input panel table to show the selected point coordinates
+ updateLocalPointView();
+ updateUndoRedo();
+
+ emit curveModified();
+}
+
+/**
+ * Manage mouse move events in Modification mode
+ * \param theWindow an owner of the signal
+ * \param theEvent a mouse event
+ */
+void CurveCreator_Widget::onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent )
+{
+ if ( getActionMode() != ModificationMode || !myDragStarted )
+ return;
+
+ QPoint aPos = theEvent->pos();
+ if ( (aPos - myDragStartPosition).manhattanLength() < QApplication::startDragDistance() )
+ return;
+
+ START_MEASURE_TIME;
+
+ moveSelectedPoints( aPos.x(), aPos.y() );
+ myDragStartPosition = aPos;
+
+ END_MEASURE_TIME( "drag" );
+}
+
+/**
+ * Set zero viewer by the last view closed in
+ * \param theManager a viewer manager
+ */
+void CurveCreator_Widget::onLastViewClosed( SUIT_ViewManager* theManager )
+{
+ myOCCViewer = 0;
+}
+
+void CurveCreator_Widget::onMousePress( QMouseEvent* theEvent )
+{
+ onMousePress( 0, theEvent );
+}
+
+void CurveCreator_Widget::onMouseRelease( QMouseEvent* theEvent )
+{
+ onMouseRelease( 0, theEvent );
+}
+
+void CurveCreator_Widget::onMouseMove( QMouseEvent* theEvent )
+{
+ onMouseMove( 0, theEvent );
+}
+
+void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
+{
+ int aCurrSect = myLocalPointView->getSectionId( theRow );
+ int aPntIndex = myLocalPointView->getPointId( theRow );
+
+ if ( aPntIndex < 0 )
+ return;
+
+ CurveCreator_ICurve::SectionToPointList aSelPoints;
+ startCurveModification( aSelPoints );
+
+ double aX = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
+ double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
+ std::deque<float> aChangedPos;
+ aChangedPos.push_back( aX );
+ aChangedPos.push_back( anY );
+ myCurve->setPoint( aCurrSect, aPntIndex, aChangedPos );
+
+ finishCurveModification( aSelPoints );
+
+ emit curveModified();
+}
+
+/**
+ * Removes a selected section from the curve. Updates undo/redo status
+ */
+void CurveCreator_Widget::removeSection()
+{
+ stopActionMode();
+
+ QList<int> aSections = mySectionView->getSelectedSections();
+ for( int i = 0 ; i < aSections.size() ; i++ ){
+ int aSectNum = aSections[i] - (i);
+ myCurve->removeSection( aSectNum );
+ mySectionView->sectionsRemoved( aSectNum );
+ }
+ mySectionView->clearSelection();
+ updateUndoRedo();
+
+ emit curveModified();
+}
+
+/**
+ * Removes a selected points from the curve. Updates undo/redo status
+ */
+void CurveCreator_Widget::removePoint()
+{
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ getSelectedPoints( aPoints );
+ if ( aPoints.size() == 0 )
+ return;
+
+ CurveCreator_ICurve::SectionToPointList aSelPoints;
+ startCurveModification( aSelPoints, false );
+
+ myCurve->removeSeveralPoints( aPoints );
+ finishCurveModification( CurveCreator_ICurve::SectionToPointList() );
+ mySectionView->reset();
+
+ emit curveModified();
+}
+
+void CurveCreator_Widget::addNewPoint(const CurveCreator::Coordinates& theCoords)
+{
+ if( !myCurve )
+ return;
+ QList<int> aSections = mySectionView->getSelectedSections();
+ if( aSections.size() == 0 ){
+ return;
+ }
+ int aSection = aSections[0];
+ myCurve->addPoints(theCoords, aSection); // add to the end of section
+ mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
+ updateActionsStates();
+ updateUndoRedo();
+
+ emit curveModified();
+}
+
+void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
+ const int theY )
+{
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+
+ OCCViewer_ViewPort3d* aViewPort = getViewPort();
+ Handle(V3d_View) aView;
+ if ( aViewPort )
+ aView = aViewPort->getView();
+
+ if ( aContext.IsNull() || aView.IsNull() )
+ return;
+ gp_Pnt aPoint;
+ gp_Pnt aPoint1, aPoint2;
+ Handle(AIS_InteractiveObject) anAISObject = myCurve->getAISObject();
+ bool isFoundPoint = CurveCreator_Utils::pointOnObject( aView, anAISObject, theX, theY,
+ aPoint, aPoint1, aPoint2 );
+ if ( !isFoundPoint )
+ return;
+
+ // insert the point to the model curve
+ CurveCreator_ICurve::SectionToPointList aSelPoints;
+ startCurveModification( aSelPoints );
+
+ CurveCreator::Coordinates aCoords;
+ aCoords.push_back( aPoint.X() );
+ aCoords.push_back( aPoint.Y() );
+
+ CurveCreator_ICurve::SectionToPointList aPoints1, aPoints2;
+ findSectionsToPoints( aPoint1.X(), aPoint1.Y(), aPoints1 );
+ findSectionsToPoints( aPoint2.X(), aPoint2.Y(), aPoints2 );
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aPoints1.begin(),
+ aLast = aPoints1.end();
+ int aSectionId = -1;
+ // find the indices of the neighbour point
+ // there can be a case when a new point is added into two sections
+ int aPoint1Id = -1, aPoint2Id = -1;
+ for ( ; anIt != aLast && aSectionId < 0; anIt++ ) {
+ int aSectionCur = anIt->first;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt2 = aPoints2.begin(),
+ aLast2 = aPoints2.end();
+ for ( ; anIt2 != aLast2 && aSectionId < 0; anIt2++ ) {
+ if ( anIt2->first == aSectionCur ) {
+ aSectionId = aSectionCur;
+ aPoint1Id = anIt->second;
+ aPoint2Id = anIt2->second;
+ }
+ }
+ }
+
+ int anInsertPos = -1;
+ int aLastPoint = myCurve->getNbPoints( aSectionId )-1;
+ if ( ( aPoint1Id == aLastPoint && aPoint2Id == 0 ) ||
+ ( aPoint2Id == aLastPoint && aPoint1Id == 0 ) )
+ anInsertPos = -1; // if the section happens between first and last points
+ else
+ anInsertPos = aPoint1Id < aPoint2Id ? aPoint1Id + 1 : aPoint2Id + 1;
+
+ myCurve->addPoints( aCoords, aSectionId, anInsertPos );
+ mySectionView->pointsAdded( aSectionId, myCurve->getNbPoints( aSectionId ) );
+
+ finishCurveModification( aSelPoints );
+
+ setSelectedPoints();
+
+ emit curveModified();
+}
+
+void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
+ const int theYPosition )
+{
+ OCCViewer_ViewPort3d* aViewPort = getViewPort();
+ if ( !aViewPort )
+ return;
+
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+
+ gp_Pnt aStartPnt = CurveCreator_Utils::ConvertClickToPoint( myDragStartPosition.x(),
+ myDragStartPosition.y(),
+ aViewPort->getView() );
+ gp_Pnt anEndPnt = CurveCreator_Utils::ConvertClickToPoint( theXPosition, theYPosition,
+ aViewPort->getView() );
+ double aXDelta = aStartPnt.X() - anEndPnt.X();
+ double anYDelta = aStartPnt.Y() - anEndPnt.Y();
+
+ CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
+ std::deque<float> aChangedPos;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myDragPoints.begin(),
+ aLast = myDragPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ int aPointId = anIt->second;
+ aChangedPos = myCurve->getPoint( aSectionId, aPointId );
+ if ( aChangedPos.size() < 2 )
+ continue;
+
+ // Remember drag points coordinates
+ if ( !myDragged ) {
+ myInitialDragPointsCoords.insert( std::make_pair( aSectionId, aPointId ), aChangedPos );
+ }
+
+ aChangedPos[0] = aChangedPos[0] - aXDelta;
+ aChangedPos[1] = aChangedPos[1] - anYDelta;
+
+ aCoordList.push_back(
+ std::make_pair(std::make_pair( aSectionId, aPointId ),
+ aChangedPos ));
+ }
+ myCurve->setSeveralPoints( aCoordList, false );
+
+ myDragged = true;
+ finishCurveModification( myDragPoints );
+
+ emit curveModified();
+}
+
+void CurveCreator_Widget::updateLocalPointView()
+{
+ if ( myDragStarted )
+ return;
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+ if ( aContext.IsNull() )
+ return;
+
+ CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
+ int aNbPoints = myLocalPoints.size();
+
+ bool isRowLimit = aNbPoints > myLocalPointRowLimit;
+ myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
+
+ if ( !isRowLimit ) {
+ bool isBlocked = myLocalPointView->blockSignals(true);
+
+ myLocalPointView->setLocalPointsToTable( myLocalPoints );
+
+ myLocalPointView->blockSignals( isBlocked );
+ }
+}
+
+/**
+ *
+ */
+void CurveCreator_Widget::setLocalPointContext( const bool theOpen, const bool isUpdateTable )
+{
+ CurveCreator_Utils::setLocalPointContext( myCurve, getAISContext(), theOpen );
+ if ( !theOpen && isUpdateTable )
+ updateLocalPointView();
+}
+
+/**
+ * Set drag operation started. Save the position and a list of dragged points
+ * \param theState the drag operation state: started/finished
+ * \param thePoint the start drag position
+ */
+void CurveCreator_Widget::setDragStarted( const bool theState, const QPoint& thePoint )
+{
+ if ( theState ) {
+ getSelectedPoints( myDragPoints );
+
+ myDragStarted = myDragPoints.size();
+ myDragStartPosition = thePoint;
+ if ( myDragStarted ) {
+ // change a viewer interaction style in order to avoid a select rectangle build
+ myDragInteractionStyle = changeInteractionStyle( SUIT_ViewModel::KEY_FREE );
+ myCurve->setSkipSorting( true );
+ }
+ }
+ else {
+ if ( myDragStarted )
+ changeInteractionStyle( myDragInteractionStyle );
+ myDragStarted = false;
+ myDragPoints.clear();
+ myInitialDragPointsCoords.clear();
+ }
+ myDragged = false;
+}
+
+void CurveCreator_Widget::getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ thePoints.clear();
+ thePoints = myLocalPoints;
+}
+
+void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ if ( myDragStarted )
+ return;
+ Handle(AIS_InteractiveContext) aContext = getAISContext();
+ if ( aContext.IsNull() || !aContext->HasOpenedContext() )
+ return;
+
+ CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
+
+ updateLocalPointView();
+}
+
+void CurveCreator_Widget::stopActionMode()
+{
+ setActionMode( NoneMode );
+}
+
+/**
+ * Get viewer information before perform the curve modification.
+ * Take a list of selected cuve points an close local context.
+ * The context should be closed because the curve presentation is
+ * redisplayed and if it is not closed, when we close the local context
+ * later, the presentation shown in the local context is disappeared.
+ * \param thePoints an output list of curve selected points
+ * \param theFillPoints a flag whether the selection list should be filled
+ */
+void CurveCreator_Widget::startCurveModification(
+ CurveCreator_ICurve::SectionToPointList& thePoints,
+ const bool theFillPoints )
+{
+ if ( theFillPoints ) {
+ thePoints.clear();
+ getSelectedPoints( thePoints );
+ }
+ setLocalPointContext( false );
+}
+
+/**
+ * Restore the viewer state after the curve modification is done.
+ * Open local context and select given points inside it.
+ * \param thePoints a list of curve selected points
+ */
+void CurveCreator_Widget::finishCurveModification(
+ const CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ if ( getActionMode() == ModificationMode )
+ setLocalPointContext( true );
+ setSelectedPoints( thePoints );
+ updateUndoRedo();
+}
+
+/**
+ * Returns a point index in the model curve by the point coordinates in the viewer
+ * \param theX the X coordinate of the point
+ * \param theY the Y coordinate of the point
+ */
+int CurveCreator_Widget::findLocalPointIndex( int theSectionId, float theX, float theY )
+{
+ return CurveCreator_UtilsICurve::findLocalPointIndex( myCurve, theSectionId, theX, theY );
+}
+
+void CurveCreator_Widget::findSectionsToPoints( const double theX, const double theY,
+ CurveCreator_ICurve::SectionToPointList& thePoints )
+{
+ return CurveCreator_UtilsICurve::findSectionsToPoints( myCurve, theX, theY, thePoints );
+}
+
+void CurveCreator_Widget::convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
+ QMap<int, QList<int> >& theConvPoints )
+{
+ return CurveCreator_UtilsICurve::convert( thePoints, theConvPoints );
+}
+
+/**
+ * Returns whethe the container has the value
+ * \param theList a container of values
+ * \param theValue a value
+ */
+bool CurveCreator_Widget::contains( const CurveCreator_ICurve::SectionToPointList& theList,
+ const CurveCreator_ICurve::SectionToPoint& theValue ) const
+{
+ return CurveCreator_UtilsICurve::contains( theList, theValue );
}
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
+// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#ifndef CURVECREATOR_WIDGET_H
#define CURVECREATOR_WIDGET_H
-#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_Macro.hxx"
#include "CurveCreator.hxx"
+#include "CurveCreator_ICurve.hxx"
#include <QWidget>
#include <QMap>
+#include <OCCViewer_ViewWindow.h>
#include <SUIT_ViewWindow.h>
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_InteractiveContext.hxx>
+
+#include <Geom_Curve.hxx>
+#include <V3d_View.hxx>
+#include <gp_Pnt.hxx>
+#include <TopoDS_Vertex.hxx> // TODO - remove
+
+class OCCViewer_Viewer;
+class OCCViewer_ViewPort3d;
+
+class AIS_ListOfInteractive;
class QAction;
class QPixmap;
-class CurveCreator_CurveEditor;
+class CurveCreator_TableView;
class CurveCreator_TreeView;
-class CurveCreator_NewPointDlg;
class CurveCreator_NewSectionDlg;
class CURVECREATOR_EXPORT CurveCreator_Widget : public QWidget
{
- Q_OBJECT
+ Q_OBJECT
+
+public:
+ enum ActionFlags {
+ NoFlags = 0x00000000,
+ DisableDetectionMode = 0x00000001,
+ DisableNewSection = 0x00000002,
+ DisableClosedSection = 0x00000004
+ };
+
+ enum ActionMode {
+ NoneMode,
+ AdditionMode,
+ ModificationMode,
+ DetectionMode
+ };
+
public:
- explicit CurveCreator_Widget( QWidget* parent,
- CurveCreator_Curve *theCurve,
- Qt::WindowFlags fl=0 );
+ explicit CurveCreator_Widget( QWidget* parent,
+ CurveCreator_ICurve *theCurve,
+ const int theActionFlags = NoFlags,
+ const QStringList& theCoordTitles = QStringList(),
+ Qt::WindowFlags fl=0,
+ int theLocalPointRowLimit = 20);
- void setCurve( CurveCreator_Curve* theCurve );
+ // OCC viewer manipulation
+ void setOCCViewer( OCCViewer_Viewer* theViewer );
- QList<int> getSelectedSections();
- QList< QPair< int, int > > getSelectedPoints();
+ Handle(AIS_InteractiveContext) getAISContext();
+ OCCViewer_ViewPort3d* getViewPort();
+ int changeInteractionStyle( int theStyle );
- bool isInstantSketchingEnabled() const;
- void setInstantSketchingEnabled( const bool theState );
+ void reset();
+ void setCurve( CurveCreator_ICurve* theCurve );
+
+ QList<int> getSelectedSections();
+ void setSelectedSections( const QList<int>& theSections );
+
+ void removeSelected();
+ bool removeEnabled();
+
+ void setActionMode( const ActionMode& theMode );
+ ActionMode getActionMode() const;
+
+ void SetViewer2DMode(const bool To2D);
signals:
- void selectionChanged();
- void subOperationStarted( QWidget* );
- void subOperationFinished( QWidget* );
+ void selectionChanged();
+ void subOperationStarted( QWidget*, bool );
+ void subOperationFinished( QWidget* );
+ void curveModified();
public slots:
protected slots:
- void onAdditionMode(bool checked);
- void onModificationMode(bool checked);
- void onDetectPoints(bool checked);
- void onModeChanged(bool checked);
- void onNewSection();
- void onSelectionChanged();
- void onAddNewPoint(const CurveCreator::Coordinates& theCoords);
- void onAddNewSection();
- void onEditSection( int theSection );
- void onEditPoint( int theSection, int thePoint );
- void onModifyPoint();
- void onModifySection();
- void onCancelPoint();
- void onCancelSection();
- void onJoin();
- void onRemove();
- void onMoveUp();
- void onMoveDown();
- void onClearAll();
- void onJoinAll();
- void onInsertSectionBefore();
- void onInsertSectionAfter();
- void onSetSpline();
- void onSetPolyline();
- void onCloseSections();
- void onUncloseSections();
- void onInsertPointBefore();
- void onInsertPointAfter();
- void onUndo();
- void onRedo();
- void onUndoSettings();
- void onContextMenu(QPoint thePoint);
- void onGetPointByClick( SUIT_ViewWindow*, QMouseEvent* );
-// void onPointSelect( SUIT_ViewWindow*, QMouseEvent* );
- void onPointDrag( SUIT_ViewWindow*, QMouseEvent* );
+ void onAdditionMode(bool checked);
+ void onModificationMode(bool checked);
+ void onDetectionMode(bool checked);
+ void onModeChanged(bool checked);
+ void onNewSection();
+ void onSelectionChanged();
+ void onAddNewSection();
+ void onEditSection( int theSection );
+ void onModifySection();
+ void onCancelSection();
+ void onJoin();
+ void onRemove();
+ void onClearAll();
+ void onJoinAll();
+ void onSetSpline();
+ void onSetPolyline();
+ void onCloseSections();
+ void onUncloseSections();
+ void onUndo();
+ void onRedo();
+ void onUndoSettings();
+ void onContextMenu(QPoint thePoint);
+
+ void onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent );
+ void onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent );
+ void onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent );
+ void onLastViewClosed( SUIT_ViewManager* theManager );
+
+ void onMousePress( QMouseEvent* theEvent );
+ void onMouseRelease( QMouseEvent* theEvent );
+ void onMouseMove( QMouseEvent* theEvent );
+
+ void onCellChanged( int theRow, int theColumn );
+
+protected:
+ void addCoordsByClick( QMouseEvent* );
+
protected:
- enum ActionId{ UNDO_ID, REDO_ID, NEW_SECTION_ID, ADDITION_MODE_ID, REMOVE_ID, REMOVE_ALL_ID, JOIN_ID,
- JOIN_ALL_ID, UP_ID, DOWN_ID, INSERT_SECTION_BEFORE_ID, INSERT_SECTION_AFTER_ID,
- INSERT_POINT_BEFORE_ID, INSERT_POINT_AFTER_ID, CLOSE_SECTIONS_ID, UNCLOSE_SECTIONS_ID,
- SET_SECTIONS_POLYLINE_ID, SET_SECTIONS_SPLINE_ID, CLEAR_ALL_ID, SEPARATOR_ID,
- MODIFICATION_MODE_ID, DETECTION_MODE_ID };
+ enum ActionId{ NONE_ID,
+ UNDO_ID,
+ REDO_ID,
+ NEW_SECTION_ID,
+ ADDITION_MODE_ID,
+ REMOVE_ID,
+ REMOVE_ALL_ID,
+ JOIN_ID,
+ JOIN_ALL_ID,
+ CLOSE_SECTIONS_ID,
+ UNCLOSE_SECTIONS_ID,
+ SET_SECTIONS_POLYLINE_ID,
+ SET_SECTIONS_SPLINE_ID,
+ CLEAR_ALL_ID,
+ SEPARATOR_ID,
+ MODIFICATION_MODE_ID,
+ DETECTION_MODE_ID
+ };
+
private:
- QAction* createAction( ActionId theId, const QString& theName, const QPixmap& theImage,
- const QString& theToolTip, const QKeySequence& theShortcut );
- QAction* getAction(ActionId theId);
- void updateUndoRedo();
+ OCCViewer_Viewer* getOCCViewer();
+
+ QAction* createAction( ActionId theId, const QString& theName, const QPixmap& theImage,
+ const QString& theToolTip, const QKeySequence& theShortcut );
+ QAction* getAction(ActionId theId);
+ QAction* getAction(ActionMode theMode);
+
+ void updateActionsStates();
+ void updateUndoRedo();
+
+ void removeSection();
+ void removePoint();
+ void addNewPoint(const CurveCreator::Coordinates& theCoords);
+ void insertPointToSelectedSegment( const int theXPosition,
+ const int theYPosition );
+ void moveSelectedPoints( const int theXPosition, const int theYPosition );
+ void updateLocalPointView();
+ void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
+
+ void setDragStarted( const bool theState, const QPoint& thePoint = QPoint() );
+
+ void getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints );
+ void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
+ CurveCreator_ICurve::SectionToPointList() );
+
+ void stopActionMode();
+
+ void startCurveModification( CurveCreator_ICurve::SectionToPointList& thePoints,
+ const bool theFillPoints = true );
+ void finishCurveModification( const CurveCreator_ICurve::SectionToPointList& thePoints =
+ CurveCreator_ICurve::SectionToPointList() );
+
+ // curve algorithm
+ int findLocalPointIndex( int theSectionId, float theX, float theY );
+ void findSectionsToPoints( const double theX, const double theY,
+ CurveCreator_ICurve::SectionToPointList& thePoints );
+ void convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
+ QMap<int, QList<int> >& theConvPoints );
+
+ bool contains( const CurveCreator_ICurve::SectionToPointList& theList,
+ const CurveCreator_ICurve::SectionToPoint& theValue ) const;
+
private:
- QMap<ActionId, QAction*> myActionMap;
- CurveCreator_Curve* myCurve;
- CurveCreator_CurveEditor* myEdit;
- CurveCreator_TreeView* mySectionView;
- CurveCreator_NewPointDlg* myNewPointEditor;
- CurveCreator_NewSectionDlg* myNewSectionEditor;
- int mySection;
- int myPointNum;
- QPoint myDragStartPosition;
+ QMap<ActionId, QAction*> myActionMap;
+ CurveCreator_ICurve* myCurve;
+ CurveCreator_TreeView* mySectionView;
+ CurveCreator_TableView* myLocalPointView;
+ CurveCreator_ICurve::SectionToPointList myLocalPoints;
+ CurveCreator_NewSectionDlg* myNewSectionEditor;
+ OCCViewer_Viewer* myOCCViewer;
+ int myLocalPointRowLimit;
+ int mySection;
+ int myPointNum;
+ bool myDragStarted;
+ QPoint myDragStartPosition;
+ int myDragInteractionStyle;
+ CurveCreator_ICurve::SectionToPointList myDragPoints;
+ QMap<CurveCreator_ICurve::SectionToPoint, CurveCreator::Coordinates> myInitialDragPointsCoords;
+ bool myDragged;
+ QByteArray myGuiState;
+ int myPressedX;
+ int myPressedY;
+ OCCViewer_ViewWindow::Mode2dType myOld2DMode;
};
#endif // CURVECREATOR_WIDGET_H
--- /dev/null
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(UseQt4Ext)
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${QT_INCLUDES}
+ ${GUI_INCLUDE_DIRS}
+ ${CAS_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_BINARY_DIR}/idl
+ )
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ ${GUI_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ ${CAS_DEFINITIONS}
+ )
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+# libraries to link to
+SET(_link_LIBRARIES
+ ${QT_LIBRARIES}
+ ${GUI_SalomeApp}
+ ${GUI_GraphicsView}
+ GEOM
+ GEOMBase
+ )
+
+# --- headers ---
+
+SET(DependencyTree_HEADERS
+ DependencyTree_Arrow.h
+ DependencyTree_Object.h
+ DependencyTree_Selector.h
+ DependencyTree.h
+ )
+
+# header files / to be processed by moc
+SET(_moc_HEADERS
+ DependencyTree_View.h
+ DependencyTree_ViewModel.h
+ )
+
+# --- sources ---
+
+# sources / moc wrappings
+QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+SET(DependencyTree_SOURCES
+ DependencyTree_Arrow.cxx
+ DependencyTree_Object.cxx
+ DependencyTree_Selector.cxx
+ DependencyTree_View.cxx
+ DependencyTree_ViewModel.cxx
+ ${_moc_SOURCES}
+ )
+
+# --- resources ---
+
+# resource files / to be processed by lrelease
+SET(_res_files
+ resources/DependencyTree_msg_en.ts
+ resources/DependencyTree_msg_fr.ts
+ resources/DependencyTree_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(DependencyTree ${DependencyTree_SOURCES})
+TARGET_LINK_LIBRARIES(DependencyTree ${_link_LIBRARIES})
+INSTALL(TARGETS DependencyTree EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+INSTALL(FILES ${DependencyTree_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+
+QT4_INSTALL_TS_RESOURCES("${_res_files}" "${SALOME_GEOM_INSTALL_RES_DATA}")
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_H
+#define DEPENDENCYTREE_H
+
+#if defined WIN32
+# if defined DEPENDENCYTREE_EXPORTS || defined DependencyTree_EXPORTS
+# define DEPENDENCYTREE_EXPORT __declspec( dllexport )
+# else
+# define DEPENDENCYTREE_EXPORT __declspec( dllimport )
+# endif
+#else
+# define DEPENDENCYTREE_EXPORT
+#endif
+
+#endif // DEPENDENCYTREE_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "DependencyTree_Arrow.h"
+#include "DependencyTree_Object.h"
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+// Qt includes
+#include <QPainter>
+
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#endif
+
+#include <math.h>
+
+const qreal arrowSize = 20;
+
+DependencyTree_Arrow::DependencyTree_Arrow( DependencyTree_Object* theStartItem,
+ DependencyTree_Object* theEndItem,
+ QGraphicsItem* parent, QGraphicsScene* scene )
+:QGraphicsLineItem( parent, scene ),
+myIsBiLink( false ),
+myStartItem( theStartItem ),
+myEndItem( theEndItem )
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ myColor = resMgr->colorValue( "Geometry", "dependency_tree_arrow_color", QColor( 0, 0, 130 ) );
+ myHighlightColor = resMgr->colorValue( "Geometry", "dependency_tree_highlight_arrow_color", QColor( 0, 0, 255 ) );
+ mySelectColor = resMgr->colorValue( "Geometry", "dependency_tree_select_arrow_color", QColor( 255, 0, 0 ) );
+
+ myStartItem = theStartItem;
+ myEndItem = theEndItem;
+
+ myLine = QLineF( myStartItem->pos(), myEndItem->pos() );
+ myArrowHead = createArrowHead( myStartItem->pos(), myEndItem->pos() );
+ myReverseArrowHead = createArrowHead( myEndItem->pos(), myStartItem->pos() );
+
+ mySelfDependencyArrow = QRectF();
+
+ setPen( QPen( myColor, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
+ setColor( myColor );
+
+ setFlag( QGraphicsItem::ItemIsSelectable, true );
+ setZValue( -1000.0 );
+}
+
+DependencyTree_Arrow::~DependencyTree_Arrow()
+{
+}
+
+//=================================================================================
+// function : boundingRect()
+// purpose : return the outer bounds of the item as a rectangle.
+// QGraphicsView uses this to determine whether the item requires redrawing
+//=================================================================================
+QRectF DependencyTree_Arrow::boundingRect() const
+{
+ qreal extra;
+ QRectF boundingRect;
+ if( myStartItem == myEndItem ) {
+ extra = arrowSize / 2.0 + 2.0;
+ boundingRect = mySelfDependencyArrow;
+ }
+ else {
+ extra = ( pen().width() + 20 ) / 2.0;
+ boundingRect = QRectF( myLine.p1(), QSizeF( myLine.p2().x() - myLine.p1().x(),
+ myLine.p2().y() - myLine.p1().y() ) );
+ }
+ return boundingRect.normalized().adjusted( -extra, -extra, extra, extra );
+}
+
+//=================================================================================
+// function : shape()
+// purpose : return the shape of this item to define an area of preselection
+//=================================================================================
+QPainterPath DependencyTree_Arrow::shape() const
+{
+ QPainterPath path;
+
+ if( myStartItem == myEndItem ) {
+ qreal extra = 5;
+ QPolygonF aPolygonBigger( mySelfDependencyArrow.normalized()
+ .adjusted( -extra, -extra, extra, extra ) );
+ QPolygonF aPolygonSmaller( mySelfDependencyArrow.normalized()
+ .adjusted( extra, extra, -extra, -extra ) );
+ path.addPolygon( aPolygonBigger.subtracted( aPolygonSmaller ) );
+ path.addPolygon(myArrowHead);
+ }
+ else {
+ QPolygonF aShapePolygon;
+ QPolygon anArrowHead = myArrowHead.toPolygon();
+ QPolygon anReverseArrowHead = myReverseArrowHead.toPolygon();
+ aShapePolygon << anArrowHead.point(1) << anArrowHead.point(0) << anArrowHead.point(2) <<
+ anReverseArrowHead.point(1) << anReverseArrowHead.point(0) << anReverseArrowHead.point(2);
+ path.addPolygon( aShapePolygon );
+ }
+ return path;
+ }
+
+//=================================================================================
+// function : setColor()
+// purpose : set default color for arrow
+//=================================================================================
+void DependencyTree_Arrow::setColor( const QColor& theColor )
+{
+ myColor = theColor;
+}
+
+//=================================================================================
+// function : setHighlightColor()
+// purpose : set color for highlighted arrow
+//=================================================================================
+void DependencyTree_Arrow::setHighlightColor( const QColor& theColor )
+{
+ myHighlightColor = theColor;
+}
+
+//=================================================================================
+// function : setSelectColor()
+// purpose : set color for selected arrow
+//=================================================================================
+void DependencyTree_Arrow::setSelectColor( const QColor& theColor )
+{
+ mySelectColor = theColor;
+}
+
+//=================================================================================
+// function : getStartItem()
+// purpose : get start item of arrow
+//=================================================================================
+DependencyTree_Object* DependencyTree_Arrow::getStartItem() const
+{
+ return myStartItem;
+}
+
+//=================================================================================
+// function : getEndItem()
+// purpose : get end item of arrow
+//=================================================================================
+DependencyTree_Object* DependencyTree_Arrow::getEndItem() const
+{
+ return myEndItem;
+}
+
+//=================================================================================
+// function : setIsBiLink()
+// purpose : set true if current arrow is bi-directional link, else set false
+//=================================================================================
+void DependencyTree_Arrow::setIsBiLink( bool theIsBiLink )
+{
+ myIsBiLink = theIsBiLink;
+}
+
+//=================================================================================
+// function : paint()
+// purpose : paint the contents of an item in local coordinates (called by QGraphicsView)
+//=================================================================================
+void DependencyTree_Arrow::paint( QPainter* painter, const QStyleOptionGraphicsItem*, QWidget* )
+{
+ if( isSelected() ) {
+ painter->setBrush( mySelectColor );
+ painter->setPen( QPen( mySelectColor, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
+ }
+ else if( isUnderMouse() ) {
+ painter->setBrush( myHighlightColor );
+ painter->setPen( QPen( myHighlightColor, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
+ }
+ else {
+ painter->setBrush( myColor );
+ painter->setPen( QPen( myColor, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
+ }
+
+ if( myStartItem == myEndItem ) {
+ int lineSize = 60;
+ QPointF p1( myStartItem->pos().x() - myStartItem->boundingRect().width()/2,
+ myStartItem->pos().y() );
+ QPointF p2( p1.x() - lineSize + myStartItem->boundingRect().height()/2, p1.y() );
+ QPointF p3( p2.x(), p2.y() - lineSize );
+ QPointF p4( p3.x() + lineSize, p3.y() );
+ QPointF p5( p4.x(), p4.y() + lineSize - myStartItem->boundingRect().height()/2 );
+ mySelfDependencyArrow = QRectF( p3.x(), p3.y(), lineSize, lineSize );
+ myArrowHead = createArrowHead( p4, p5, false );
+ QVector<QPointF> pointVector;
+ pointVector << p1 << p2 << p2 << p3 << p3 << p4 << p4 << p5;
+
+ painter->drawLines( pointVector);
+ painter->drawPolygon(myArrowHead);
+ }
+ else {
+ if (myStartItem->collidesWithItem(myEndItem))
+ return;
+
+ myArrowHead = createArrowHead( myStartItem->pos(), myEndItem->pos() );
+ myReverseArrowHead = createArrowHead( myEndItem->pos(), myStartItem->pos() );
+
+ painter->drawLine( myLine );
+ painter->drawPolygon( myArrowHead );
+ if( myIsBiLink )
+ painter->drawPolygon( myReverseArrowHead );
+ }
+}
+
+//=================================================================================
+// function : createArrowHead()
+// purpose : create a head of arrow from start point to end point
+//=================================================================================
+QPolygonF DependencyTree_Arrow::createArrowHead( QPointF theStartPoint, QPointF theEndPoint,
+ bool theIsDynamic )
+{
+ if( theIsDynamic ) {
+ QLineF centerLine( theStartPoint, theEndPoint );
+ QPolygonF endPolygon = QPolygonF( myEndItem->boundingRect() );
+ QPointF p1 = endPolygon.first() + theEndPoint;
+ QPointF p2;
+ QPointF intersectPoint;
+ QLineF polyLine;
+ for( int i = 1; i < endPolygon.count(); ++i ) {
+ p2 = endPolygon.at(i) + theEndPoint;
+ polyLine = QLineF( p1, p2 );
+ QLineF::IntersectType intersectType = polyLine.intersect( centerLine, &intersectPoint );
+ if( intersectType == QLineF::BoundedIntersection )
+ break;
+ p1 = p2;
+ }
+ myLine = QLineF( intersectPoint, theStartPoint );
+ }
+ else
+ myLine = QLineF( theEndPoint, theStartPoint );
+
+ double angle = acos(myLine.dx() / myLine.length());
+ if( myLine.dy() >= 0 )
+ angle = ( M_PI * 2 ) - angle;
+
+ QPointF arrowP1 = myLine.p1() + QPointF( sin( angle + M_PI / 3 ) * arrowSize,
+ cos( angle + M_PI / 3 ) * arrowSize );
+ QPointF arrowP2 = myLine.p1() + QPointF( sin( angle + M_PI - M_PI / 3 ) * arrowSize,
+ cos( angle + M_PI - M_PI / 3 ) * arrowSize );
+
+ QPolygonF anArrowHead;
+ anArrowHead << myLine.p1() << arrowP1 << arrowP2;
+ return anArrowHead;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_ARROW_H
+#define DEPENDENCYTREE_ARROW_H
+
+#include <QGraphicsLineItem>
+
+#include "DependencyTree.h"
+
+class DependencyTree_Object;
+
+class DEPENDENCYTREE_EXPORT DependencyTree_Arrow : public QGraphicsLineItem
+{
+
+public:
+
+ DependencyTree_Arrow( DependencyTree_Object* startItem, DependencyTree_Object* endItem,
+ QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );
+ ~DependencyTree_Arrow();
+
+ virtual QRectF boundingRect() const;
+ virtual QPainterPath shape() const;
+
+ void setColor(const QColor& );
+ void setHighlightColor(const QColor& );
+ void setSelectColor(const QColor& );
+
+ DependencyTree_Object* getStartItem() const;
+ DependencyTree_Object* getEndItem() const;
+
+ void setIsBiLink( bool );
+
+protected:
+
+ void paint( QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0 );
+
+private:
+
+ QPolygonF createArrowHead( QPointF , QPointF, bool = true );
+
+ DependencyTree_Object* myStartItem;
+ DependencyTree_Object* myEndItem;
+
+ QColor myColor;
+ QColor mySelectColor;
+ QColor myHighlightColor;
+
+ QPolygonF myArrowHead;
+ QPolygonF myReverseArrowHead;
+
+ bool myIsBiLink;
+
+ QRectF mySelfDependencyArrow;
+
+ QLineF myLine;
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "DependencyTree_Object.h"
+
+// GEOM includes
+#include <GeometryGUI.h>
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+
+// Qt includes
+#include <QFont>
+
+const int itemH = 20;
+const int itemW = 90;
+
+DependencyTree_Object::DependencyTree_Object( const std::string& theEntry, QGraphicsItem* theParent )
+:GraphicsView_Object( theParent ),
+myIsMainObject( false )
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ myColor = resMgr->colorValue( "Geometry", "dependency_tree_node_color", QColor( 62, 180, 238 ) );
+ mySelectColor = resMgr->colorValue( "Geometry", "dependency_tree_select_node_color", QColor( 237, 243, 58 ) );
+ myMainObjectColor = resMgr->colorValue( "Geometry", "dependency_tree_main_node_color", QColor( 238, 90, 125 ) );
+ myUnpublishObjectColor = resMgr->colorValue( "Geometry", "dependency_tree_unpublish_node_color", QColor( 255, 255, 255 ) );
+
+ myPolygonItem = new QGraphicsPolygonItem();
+ QPolygonF myPolygon;
+ myPolygon << QPointF( -itemW, -itemH ) << QPointF( itemW, -itemH ) << QPointF( itemW, itemH )
+ << QPointF( -itemW, itemH ) << QPointF( -itemW, -itemH );
+
+ myPolygonItem->setPolygon( myPolygon );
+
+ myTextItem = new QGraphicsSimpleTextItem();
+ QFont textFont;
+ textFont.setPointSize( itemH );
+ 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() );
+
+ updateName();
+
+ addToGroup( myPolygonItem );
+ addToGroup( myTextItem );
+}
+
+DependencyTree_Object::~DependencyTree_Object()
+{
+}
+
+//=================================================================================
+// function : highlight()
+// purpose : highlight current item
+//=================================================================================
+bool DependencyTree_Object::highlight( double theX, double theY )
+{
+ if( !isHighlighted() ) {
+ QColor color = myPolygonItem->brush().color();
+ int saturation = ( color.saturation() - 100 ) > 10 ? color.saturation() - 100 : 10;
+ color.setHsv( color.hsvHue(), saturation, color.value() );
+
+ myPolygonItem->setBrush( color );
+ myPolygonItem->setPen( getPen( color ) );
+
+ myPolygonItem->setToolTip( getName() );
+ }
+ return GraphicsView_Object::highlight( theX, theY );
+}
+
+//=================================================================================
+// function : unhighlight()
+// purpose : set properties for unhighlighted item
+//=================================================================================
+void DependencyTree_Object::unhighlight()
+{
+ if( isSelected() )
+ myPolygonItem->setBrush( mySelectColor );
+ else if( myIsMainObject )
+ myPolygonItem->setBrush( myMainObjectColor );
+ else
+ myPolygonItem->setBrush( myColor );
+
+ myPolygonItem->setPen( getPen( myPolygonItem->brush().color() ) );
+
+ GraphicsView_Object::unhighlight();
+}
+
+//=================================================================================
+// function : select()
+// purpose : select current item
+//=================================================================================
+bool DependencyTree_Object::select( double theX, double theY, const QRectF& theRect )
+{
+ myPolygonItem->setBrush( mySelectColor );
+ myPolygonItem->setPen( getPen( mySelectColor ) );
+
+ return GraphicsView_Object::select( theX, theY, theRect );
+}
+
+//=================================================================================
+// function : unselect()
+// purpose : set properties for unselected item
+//=================================================================================
+void DependencyTree_Object::unselect()
+{
+ if( myIsMainObject )
+ myPolygonItem->setBrush( myMainObjectColor );
+ else
+ myPolygonItem->setBrush( myColor );
+
+ myPolygonItem->setPen( getPen( myPolygonItem->brush().color() ) );
+
+ GraphicsView_Object::unselect();
+}
+
+//=================================================================================
+// function : getEntry()
+// purpose : get entry of current item
+//=================================================================================
+std::string DependencyTree_Object::getEntry() const
+{
+ return myEntry;
+}
+
+//=================================================================================
+// function : getGeomObject()
+// purpose : get geometry object of current item
+//=================================================================================
+GEOM::GEOM_BaseObject_var DependencyTree_Object::getGeomObject() const
+{
+ return myGeomObject;
+}
+
+//=================================================================================
+// function : updateName()
+// purpose : update name of current item using its entry
+//=================================================================================
+void DependencyTree_Object::updateName()
+{
+
+ QString name = myGeomObject->GetName();
+ CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
+
+ if( QString( studyEntryVar.in() ).isEmpty() ) {
+ if( name.isEmpty() )
+ name = "unpublished";
+ myColor = myUnpublishObjectColor;
+ }
+
+ myPolygonItem->setBrush( myColor );
+ myPolygonItem->setPen( getPen( myColor ) );
+
+ setName( name );
+
+ myTextItem->setText( name );
+ double textWidth = myTextItem->sceneBoundingRect().width();
+ double textHeight = myTextItem->sceneBoundingRect().height();
+
+ double polygonWidth = myPolygonItem->sceneBoundingRect().width();
+ double polygonHeight = myPolygonItem->sceneBoundingRect().height();
+
+ if( ( textWidth - 4 ) > polygonWidth ) {
+ int numberSymbol = int( polygonWidth * name.length() / textWidth );
+ QString newName = name.left( numberSymbol - 3 ) + "...";
+ myTextItem->setText( newName );
+ textWidth = myTextItem->sceneBoundingRect().width();
+ }
+ myTextItem->setPos( ( polygonWidth - textWidth ) / 2 - itemW,
+ ( polygonHeight - textHeight ) / 2 - itemH );
+}
+
+//=================================================================================
+// function : setColor()
+// purpose : set default color of current item
+//=================================================================================
+void DependencyTree_Object::setColor( const QColor& theColor )
+{
+ CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
+ if( QString( studyEntryVar.in() ).isEmpty() )
+ myColor = myUnpublishObjectColor;
+ else
+ myColor = theColor;
+
+}
+
+//=================================================================================
+// function : setSelectColor()
+// purpose : set color of selected item
+//=================================================================================
+void DependencyTree_Object::setSelectColor( const QColor& theColor )
+{
+ mySelectColor = theColor;
+}
+
+//=================================================================================
+// function : setMainObjectColor()
+// purpose : set color if current item is main object of dependency tree
+//=================================================================================
+void DependencyTree_Object::setMainObjectColor( const QColor& theColor )
+{
+ myMainObjectColor = theColor;
+}
+
+//=================================================================================
+// function : setUnpublishObjectColor()
+// purpose : set color if current item is unpublished object
+//=================================================================================
+void DependencyTree_Object::setUnpublishObjectColor( const QColor& theColor )
+{
+ myUnpublishObjectColor = theColor;
+ CORBA::String_var studyEntryVar = myGeomObject->GetStudyEntry();
+ if( QString( studyEntryVar.in() ).isEmpty() )
+ myColor = myUnpublishObjectColor;
+}
+
+//=================================================================================
+// function : setIsMainObject()
+// purpose : set true if current item is main object of dependency tree
+//=================================================================================
+void DependencyTree_Object::setIsMainObject( bool theIsMainObject )
+{
+ myIsMainObject = theIsMainObject;
+
+ if( myIsMainObject )
+ myPolygonItem->setBrush( myMainObjectColor );
+ else
+ myPolygonItem->setBrush( myColor );
+
+ myPolygonItem->setPen( getPen( myPolygonItem->brush().color() ) );
+}
+
+//=================================================================================
+// function : getPen()
+// purpose : get pen which is dependent of current color
+//=================================================================================
+QPen DependencyTree_Object::getPen( const QColor& theColor )
+{
+ int value = ( theColor.value() - 100 ) > 10 ? theColor.value() - 100 : 10;
+ QColor penColor;
+ penColor.setHsv( theColor.hsvHue(), theColor.saturation(), value );
+ return QPen( QBrush( penColor ), 4 );
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_OBJECT_H
+#define DEPENDENCYTREE_OBJECT_H
+
+#include <GraphicsView_Object.h>
+
+// GEOM includes
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+
+#include <QPen>
+
+#include "DependencyTree.h"
+
+class DEPENDENCYTREE_EXPORT DependencyTree_Object: public GraphicsView_Object
+{
+
+public:
+
+ DependencyTree_Object( const std::string&, QGraphicsItem* = 0 );
+ ~DependencyTree_Object();
+
+ virtual void compute() {};
+
+ virtual bool highlight( double, double );
+ virtual void unhighlight();
+
+ virtual bool select( double, double, const QRectF& );
+ virtual void unselect();
+
+ std::string getEntry() const;
+
+ GEOM::GEOM_BaseObject_var getGeomObject() const;
+
+ void updateName();
+
+ void setColor( const QColor& );
+ void setSelectColor( const QColor& );
+ void setMainObjectColor( const QColor& );
+ void setUnpublishObjectColor( const QColor& );
+
+ void setIsMainObject( bool );
+
+private:
+
+ QPen getPen( const QColor& );
+
+ QColor myColor;
+ QColor mySelectColor;
+ QColor myMainObjectColor;
+ QColor myUnpublishObjectColor;
+
+ QGraphicsPolygonItem* myPolygonItem;
+ QGraphicsSimpleTextItem* myTextItem;
+
+ GEOM::GEOM_BaseObject_var myGeomObject;
+ std::string myEntry;
+
+ bool myIsMainObject;
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "DependencyTree_Selector.h"
+#include "DependencyTree_View.h"
+#include "DependencyTree_ViewModel.h"
+#include "DependencyTree_Object.h"
+
+// GUI includes
+#include <LightApp_DataOwner.h>
+
+//GEOM includes
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
+
+DependencyTree_Selector::DependencyTree_Selector( DependencyTree_ViewModel* theModel, SUIT_SelectionMgr* theSelMgr )
+:LightApp_GVSelector( (GraphicsView_Viewer*)theModel, theSelMgr )
+{
+ myView = dynamic_cast<DependencyTree_View*>( theModel->getActiveViewPort() );
+}
+
+DependencyTree_Selector::~DependencyTree_Selector()
+{
+}
+
+//=================================================================================
+// function : getSelection()
+// purpose : get list of selected Data Owner objects.
+//=================================================================================
+void DependencyTree_Selector::getSelection( SUIT_DataOwnerPtrList& theList ) const
+{
+ for( myView->initSelected(); myView->moreSelected(); myView->nextSelected() )
+ 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() );
+ if( anObj->_is_nil() )
+ continue;
+ CORBA::String_var studyEntryVar = anObj->GetStudyEntry();
+ studyEntry = studyEntryVar.in();
+ if( studyEntry.isEmpty() ) {
+ studyEntry = treeObject->getEntry().c_str();
+ name = "TEMP_IO_UNPUBLISHED";
+ }
+ else {
+ name = "TEMP_IO";
+ }
+ Handle(SALOME_InteractiveObject) tmpIO =
+ new SALOME_InteractiveObject( studyEntry.toStdString().c_str(),
+ "GEOM",
+ name.toStdString().c_str());
+
+ theList.append( new LightApp_DataOwner( tmpIO ) );
+ }
+}
+
+//=================================================================================
+// function : setSelection()
+// purpose : set to selected list of Data Owner objects.
+//=================================================================================
+void DependencyTree_Selector::setSelection( const SUIT_DataOwnerPtrList& theList )
+{
+ myView->clearSelected();
+
+ for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it ) {
+ const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
+ if ( owner )
+ if( !owner->IO().IsNull() ) {
+ const char* name = owner->IO()->getName();
+ const char* entry;
+ if( strcmp( owner->IO()->getComponentDataType(), "GEOM" ) != 0 )
+ return;
+
+ if( strcmp( name, "TEMP_IO_UNPUBLISHED" ) == 0 )
+ entry = owner->IO()->getEntry();
+ else {
+ GEOM::GEOM_Object_var geomObject = GEOMBase::ConvertIOinGEOMObject( owner->IO() );
+ if( geomObject->_is_nil() )
+ return;
+ entry = geomObject->GetEntry();
+ }
+ DependencyTree_Object* object = myView->getObjectByEntry( entry );
+ if( object ) {
+ myView->setSelected( object );
+ object->select( object->pos().x(), object->pos().y(), object->getRect() );
+ }
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_SELECTOR_H
+#define DEPENDENCYTREE_SELECTOR_H
+
+#include <LightApp_GVSelector.h>
+
+#include "DependencyTree.h"
+
+class DependencyTree_ViewModel;
+class DependencyTree_View;
+
+class DEPENDENCYTREE_EXPORT DependencyTree_Selector: public LightApp_GVSelector
+{
+
+public:
+
+ DependencyTree_Selector( DependencyTree_ViewModel*, SUIT_SelectionMgr* );
+ ~DependencyTree_Selector();
+
+protected:
+
+ virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
+ virtual void setSelection( const SUIT_DataOwnerPtrList& );
+
+private:
+
+ DependencyTree_View* myView;
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// Internal includes
+#include "DependencyTree_View.h"
+#include "DependencyTree_Object.h"
+#include "DependencyTree_Arrow.h"
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Study.h>
+#include <QtxActionToolMgr.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include <GEOMBase.h>
+
+// Qt includes
+#include <QApplication>
+#include <QWidgetAction>
+#include <QWheelEvent>
+
+DependencyTree_View::DependencyTree_View( QWidget* theParent )
+:GraphicsView_ViewPort( theParent ),
+myLevelsNumber(0),
+myMaxDownwardLevelsNumber(0),
+myMaxUpwardLevelsNumber(0),
+myIsUpdate( true )
+{
+ 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;
+
+ myMainEntries = new GEOM::string_array();
+
+ getNewTreeModel();
+}
+
+DependencyTree_View::~DependencyTree_View()
+{
+ clearView( true );
+}
+
+//=================================================================================
+// function : init()
+// purpose : this method is obligatory for initialize view frame actions
+//=================================================================================
+void DependencyTree_View::init( GraphicsView_ViewFrame* theViewFrame )
+{
+ myNodesMovable = new QCheckBox( tr( "MOVE_NODES" ) );
+ QWidgetAction* nodesMovableAction = new QWidgetAction( theViewFrame );
+ nodesMovableAction->setDefaultWidget( myNodesMovable );
+
+ myDisplayAscendants = new QCheckBox( tr( "DISPLAY_ASCENDANTS" ) );
+ QWidgetAction* displayAscendantsAction = new QWidgetAction( theViewFrame );
+ displayAscendantsAction->setDefaultWidget( myDisplayAscendants );
+
+ myDisplayDescendants = new QCheckBox(tr("DISPLAY_DESCENDANTS"));
+ QWidgetAction* displayDescendantsAction = new QWidgetAction( theViewFrame );
+ displayDescendantsAction->setDefaultWidget( myDisplayDescendants );
+
+ QLabel* hierarchyDepthLabel = new QLabel( tr( "HIERARCHY_DEPTH" ) );
+ QWidgetAction* hierarchyDepthLabelAction = new QWidgetAction( theViewFrame );
+ hierarchyDepthLabelAction->setDefaultWidget( hierarchyDepthLabel );
+
+ myLevelsNumber = checkMaxLevelsNumber();
+
+ myHierarchyDepth = new QSpinBox();
+ myHierarchyDepth->setRange( 0, checkMaxLevelsNumber() );
+ myHierarchyDepth->setSpecialValueText( tr( "SHOW_ALL" ) );
+ myHierarchyDepth->setValue( 0 );
+ QWidgetAction* hierarchyDepthAction = new QWidgetAction( theViewFrame );
+ hierarchyDepthAction->setDefaultWidget( myHierarchyDepth );
+
+ updateButton = new QPushButton( tr( "UPDATE" ) );
+ QWidgetAction* updateAction = new QWidgetAction( theViewFrame );
+ updateAction->setDefaultWidget( updateButton );
+
+ QAction* separator1 = theViewFrame->toolMgr()->separator( false );
+ QAction* separator2 = theViewFrame->toolMgr()->separator( false );
+
+ theViewFrame->toolMgr()->append( separator1, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( hierarchyDepthLabelAction, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( hierarchyDepthAction, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( displayAscendantsAction, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( displayDescendantsAction, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( nodesMovableAction, theViewFrame->getToolBarId() );
+
+ theViewFrame->toolMgr()->append( separator2, theViewFrame->getToolBarId() );
+ theViewFrame->toolMgr()->append( updateAction, theViewFrame->getToolBarId() );
+
+ connect( myNodesMovable, SIGNAL( toggled( bool ) ), this, SLOT( onMoveNodes( bool ) ) );
+ connect( myHierarchyDepth, SIGNAL( valueChanged ( int ) ), this, SLOT( onHierarchyType() ) );
+ connect( myDisplayAscendants , SIGNAL( toggled( bool ) ), this, SLOT( onHierarchyType() ) );
+ connect( myDisplayDescendants, SIGNAL( toggled( bool ) ), this, SLOT( onHierarchyType() ) );
+ connect( updateButton, SIGNAL( clicked() ), this, SLOT( onUpdateModel() ) );
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+ if ( aGeomGUI ) {
+ connect( aGeomGUI, SIGNAL( SignalDependencyTreeParamChanged( const QString&, const QString& ) ),
+ this, SLOT( onPreferenceChanged( const QString&, const QString& ) ) );
+ connect( aGeomGUI, SIGNAL( SignalDependencyTreeRenameObject( const QString& ) ),
+ this, SLOT( onRenameObject( const QString& ) ) );
+ }
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ setPrefBackgroundColor( resMgr->colorValue( "Geometry", "dependency_tree_background_color", QColor( 255, 255, 255 ) ) );
+ setNodesMovable( resMgr->booleanValue( "Geometry", "dependency_tree_move_nodes", true ) );
+ setHierarchyType( resMgr->integerValue( "Geometry", "dependency_tree_hierarchy_type", 0 ) );
+}
+
+//=================================================================================
+// function : updateModel()
+// purpose : run all stage of dependency tree creation
+//=================================================================================
+void DependencyTree_View::updateModel( bool theUseSelectedObject, bool theUseOB )
+{
+ getNewTreeModel( theUseSelectedObject, theUseOB );
+ onHierarchyType();
+}
+
+//=================================================================================
+// function : mouseMoveEvent()
+// purpose : make some actions when mouse was moved
+//=================================================================================
+void DependencyTree_View::mouseMoveEvent( QMouseEvent *event )
+{
+ QGraphicsView::mouseMoveEvent( event );
+ ArrowsInfo::const_iterator i;
+ for( i = myArrows.begin(); i != myArrows.end(); i++ ) {
+ if( DependencyTree_Arrow* arrow = myArrows[ i->first ] )
+ arrow->update();
+ }
+}
+
+//=================================================================================
+// function : wheelEvent()
+// purpose : add zoom action when wheel is spinning
+//=================================================================================
+void DependencyTree_View::wheelEvent( QWheelEvent* event )
+{
+ int inc = 10; // zoom coefficient
+ double cx = width() / 2;
+ double cy = height() / 2;
+ if( event->delta() > 0 )
+ zoom( cx, cy, cx + inc, cy + inc );
+ else
+ zoom( cx, cy, cx - inc, cy - inc );
+
+ QGraphicsView::wheelEvent( event );
+}
+
+//=================================================================================
+// function : getViewName()
+// purpose : return the name of current view
+//=================================================================================
+QString DependencyTree_View::getViewName() const
+{
+ 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
+//=================================================================================
+DependencyTree_Object* DependencyTree_View::getObjectByEntry( const std::string& theEntry )
+{
+ return myTreeMap[ theEntry ];
+}
+
+//=================================================================================
+// function : setHierarchyType()
+// purpose : set hierarchy type of dependency tree
+//=================================================================================
+void DependencyTree_View::setHierarchyType( const int theType )
+{
+ myIsUpdate = false;
+ switch( theType ) {
+ case 0:
+ myDisplayAscendants->setChecked( true );
+ myDisplayDescendants->setChecked( true );
+ break;
+ case 1:
+ myDisplayAscendants->setChecked( true );
+ myDisplayDescendants->setChecked( false );
+ break;
+ case 2:
+ myDisplayAscendants->setChecked( false );
+ myDisplayDescendants->setChecked( true );
+ break;
+ }
+ myIsUpdate = true;
+ myLevelsNumber = checkMaxLevelsNumber();
+ onHierarchyType();
+}
+
+//=================================================================================
+// function : setNodesMovable()
+// purpose : set possibility to move nodes or not
+//=================================================================================
+void DependencyTree_View::setNodesMovable( const bool theIsMovable )
+{
+ myNodesMovable->setChecked( theIsMovable );
+}
+
+//=================================================================================
+// function : setPrefBackgroundColor()
+// purpose : set background color from preferences
+//=================================================================================
+void DependencyTree_View::setPrefBackgroundColor( const QColor& theColor )
+{
+ if( isForegroundEnabled() )
+ {
+ setForegroundColor( theColor );
+ updateForeground();
+ }
+ else
+ setBackgroundColor( theColor );
+}
+
+//=================================================================================
+// function : setNodeColor()
+// purpose : set node color from preferences
+//=================================================================================
+void DependencyTree_View::setNodeColor( const QColor& theColor )
+{
+ EntryObjectMap::const_iterator i;
+ for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+ DependencyTree_Object* object = myTreeMap[ i->first ];
+ object->setColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setMainNodeColor()
+// purpose : set main node color from preferences
+//=================================================================================
+void DependencyTree_View::setMainNodeColor( const QColor& theColor )
+{
+ EntryObjectMap::const_iterator i;
+ for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+ DependencyTree_Object* object = myTreeMap[ i->first ];
+ object->setMainObjectColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setUnpublishNodeColor()
+// purpose : set unpublished node color from preferences
+//=================================================================================
+void DependencyTree_View::setUnpublishNodeColor( const QColor& theColor )
+{
+ EntryObjectMap::const_iterator i;
+ for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+ DependencyTree_Object* object = myTreeMap[ i->first ];
+ object->setUnpublishObjectColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setSelectNodeColor()
+// purpose : set selected node color from preferences
+//=================================================================================
+void DependencyTree_View::setSelectNodeColor( const QColor& theColor )
+{
+ EntryObjectMap::const_iterator i;
+ for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+ DependencyTree_Object* object = myTreeMap[ i->first ];
+ object->setSelectColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setArrowColor()
+// purpose : set arrow color from preferences
+//=================================================================================
+void DependencyTree_View::setArrowColor( const QColor& theColor )
+{
+ ArrowsInfo::const_iterator i;
+ for( i = myArrows.begin(); i != myArrows.end(); i++ ) {
+ DependencyTree_Arrow* arrow = myArrows[ i->first ];
+ arrow->setColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setHighlightArrowColor()
+// purpose : set highlighted arrow color from preferences
+//=================================================================================
+void DependencyTree_View::setHighlightArrowColor( const QColor& theColor )
+{
+ ArrowsInfo::const_iterator i;
+ for( i = myArrows.begin(); i != myArrows.end(); i++ ) {
+ DependencyTree_Arrow* arrow = myArrows[ i->first ];
+ arrow->setHighlightColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : setSelectArrowColor()
+// purpose : set selected arrow color from preferences
+//=================================================================================
+void DependencyTree_View::setSelectArrowColor( const QColor& theColor )
+{
+ ArrowsInfo::const_iterator i;
+ for( i = myArrows.begin(); i != myArrows.end(); i++ ) {
+ DependencyTree_Arrow* arrow = myArrows[ i->first ];
+ arrow->setSelectColor( theColor );
+ }
+}
+
+//=================================================================================
+// function : onRebuildModel()
+// purpose : slot for updating tree model using selected objects in viewer
+//=================================================================================
+void DependencyTree_View::onRebuildModel()
+{
+ updateModel( true, false );
+}
+
+//=================================================================================
+// function : onUpdateModel()
+// purpose : slot for updating tree model for main objects in viewer
+//=================================================================================
+void DependencyTree_View::onUpdateModel()
+{
+ updateModel( false );
+}
+
+//=================================================================================
+// function : onMoveNodes()
+// purpose : slot for setting the possibility to move nodes in viewer
+//=================================================================================
+void DependencyTree_View::onMoveNodes( bool theIsMoveNodes )
+{
+ EntryObjectMap::const_iterator i;
+ for( i = myTreeMap.begin(); i != myTreeMap.end(); i++ ) {
+ DependencyTree_Object* object = myTreeMap[ i->first ];
+ if( object )
+ object->setMovable( theIsMoveNodes );
+ }
+}
+
+//=================================================================================
+// function : onHierarchyType()
+// purpose : slot for setting the hierarchy type of tree
+//=================================================================================
+void DependencyTree_View::onHierarchyType()
+{
+ myHierarchyDepth->setRange( 0, checkMaxLevelsNumber() );
+ if( myHierarchyDepth->value() > checkMaxLevelsNumber() )
+ myHierarchyDepth->setValue( checkMaxLevelsNumber() );
+
+ if( myHierarchyDepth->value() == 0 )
+ myLevelsNumber = myHierarchyDepth->maximum();
+ else
+ myLevelsNumber = myHierarchyDepth->value();
+
+ updateView();
+}
+
+//=================================================================================
+// function : onPreferencesChanged()
+// purpose : slot for changing tree parameters from preferences
+//=================================================================================
+void DependencyTree_View::onPreferenceChanged( const QString& section, const QString& param )
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ if( param == QString("dependency_tree_hierarchy_type") ) {
+ int hierarchyType = resMgr->integerValue( section, param, 0);
+ setHierarchyType( hierarchyType );
+ }
+ else if( param == QString("dependency_tree_move_nodes") ) {
+ bool isNodesMovable = resMgr->booleanValue( section, param, true);
+ setNodesMovable( isNodesMovable );
+ }
+ else if( param == QString("dependency_tree_background_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 255, 255, 255 ) );
+ setPrefBackgroundColor( c );
+ }
+ else if( param == QString("dependency_tree_node_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 62, 180, 238 ) );
+ setNodeColor( c );
+ }
+ else if( param == QString("dependency_tree_main_node_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 238, 90, 125 ) );
+ setMainNodeColor( c );
+ }
+ else if( param == QString("dependency_tree_unpublish_node_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 255, 255, 255 ) );
+ setUnpublishNodeColor( c );
+ }
+ else if( param == QString("dependency_tree_select_node_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 237, 243, 58 ) );
+ setSelectNodeColor( c );
+ }
+ else if( param == QString("dependency_tree_arrow_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 0, 0, 130 ) );
+ setArrowColor( c );
+ }
+ else if( param == QString("dependency_tree_highlight_arrow_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 0, 0, 255 ) );
+ setHighlightArrowColor( c );
+ }
+ else if( param == QString("dependency_tree_select_arrow_color") ) {
+ QColor c = resMgr->colorValue( section, param, QColor( 255, 0, 0 ) );
+ setSelectArrowColor( c );
+ }
+}
+
+//=================================================================================
+// function : onRenameObject()
+// purpose : update object name, having edited it in Object Browser
+//=================================================================================
+void DependencyTree_View::onRenameObject( const QString& theEntry )
+{
+ if( DependencyTree_Object* object = getObjectByEntry( theEntry.toStdString() ) )
+ object->updateName();
+}
+
+//=================================================================================
+// function : parseTree()
+// purpose : parse created model to initialize all nodes and arrows
+//=================================================================================
+void DependencyTree_View::parseTree()
+{
+ GEOMUtils::TreeModel::const_iterator i;
+ for( i = myTreeModel.begin(); i != myTreeModel.end(); i++ ) {
+ std::string objectEntry = i->first;
+ addNode( objectEntry );
+ parseTreeWard( i->second.first );
+ if( i->second.first.size() > myMaxUpwardLevelsNumber )
+ myMaxUpwardLevelsNumber = i->second.first.size();
+ parseTreeWard( i->second.second );
+ if( i->second.second.size() > myMaxDownwardLevelsNumber )
+ myMaxDownwardLevelsNumber = i->second.second.size();
+ }
+
+ for( i = myTreeModel.begin(); i != myTreeModel.end(); i++ ) {
+ DependencyTree_Object* Main_object = myTreeMap[ i->first ];
+ if( i->second.first.size() > 0 ) {
+ GEOMUtils::LevelInfo Levelup = i->second.first.at(0);
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = Levelup.begin(); node != Levelup.end(); node++ ) {
+ DependencyTree_Object* object = myTreeMap[ node->first ];
+ addArrow( Main_object, object );
+ }
+ }
+ parseTreeWardArrow( i->second.first );
+ parseTreeWardArrow( i->second.second );
+ }
+}
+
+//=================================================================================
+// function : parseTreeWard()
+// purpose : parse tree ward to initialize all nodes of current ward
+//=================================================================================
+void DependencyTree_View::parseTreeWard( const GEOMUtils::LevelsList& theWard )
+{
+ int levelsNumber = theWard.size();
+ for( int level = 0; level < levelsNumber; level++ ) {
+ GEOMUtils::LevelInfo levelInfo = theWard[ level ];
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = levelInfo.begin(); node != levelInfo.end(); node++ )
+ addNode( node->first );
+ }
+}
+
+//=================================================================================
+// function : parseTreeWardArrow()
+// purpose : parse tree ward to initialize all arrows of current ward
+//=================================================================================
+void DependencyTree_View::parseTreeWardArrow( const GEOMUtils::LevelsList& theWard)
+{
+ for( int j = 0; j < theWard.size(); j++ ) {
+ GEOMUtils::LevelInfo Level = theWard.at(j);
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = Level.begin(); node != Level.end(); node++ ) {
+ DependencyTree_Object* object = myTreeMap[ node->first ];
+ std::vector<std::string> Links = node->second;
+ for( int link = 0; link < Links.size(); link++ ) {
+ DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
+ if( object && LinkObject )
+ addArrow( object, LinkObject );
+ }
+ }
+ }
+}
+
+//=================================================================================
+// function : addNode()
+// purpose : add node to viewer
+//=================================================================================
+void DependencyTree_View::addNode( const std::string& theEntry )
+{
+ if( !myTreeMap[theEntry] )
+ myTreeMap[theEntry] = new DependencyTree_Object( theEntry );
+}
+
+//=================================================================================
+// function : addArrow()
+// purpose : add arrow to viewer
+//=================================================================================
+void DependencyTree_View::addArrow( DependencyTree_Object* startItem, DependencyTree_Object* endItem )
+{
+ bool isFind = false;
+
+ ArrowsInfo::const_iterator i;
+ for( i = myArrows.begin(); i != myArrows.end(); i++ ) {
+ DependencyTree_Arrow* arrow = i->second;
+ if( arrow->getStartItem() == startItem && arrow->getEndItem() == endItem )
+ isFind = true;
+ else if( arrow->getStartItem() == endItem && arrow->getEndItem() == startItem ) {
+ arrow->setIsBiLink( true );
+ isFind = true;
+ }
+ }
+ if( !isFind ) {
+ DependencyTree_Arrow *arrow = new DependencyTree_Arrow( startItem, endItem );
+ myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( startItem, endItem ) ] = arrow;
+ }
+}
+
+//=================================================================================
+// function : drawTree()
+// purpose : redraw dependency tree using existing model
+//=================================================================================
+void DependencyTree_View::drawTree()
+{
+ clearView( false );
+ clearSelected();
+
+ // draw nodes on scene
+ std::map< std::string, int > entryLevelMap;
+ std::map< int, std::vector< std::string > > levelObjects;
+ int currentLevel;
+ int horDistance, verDistance;
+ GEOMUtils::TreeModel::const_reverse_iterator i;
+ for( i = myTreeModel.rbegin(); i != myTreeModel.rend(); i++ ) {
+ currentLevel = 0;
+ std::string objectEntry = i->first;
+ DependencyTree_Object* objectItem = myTreeMap[ objectEntry ];
+ horDistance = 100 + int( objectItem->boundingRect().width() );
+ verDistance = 3 * int( objectItem->boundingRect().height() );
+ if( isItemAdded( objectItem ) )
+ currentLevel = entryLevelMap[ objectEntry ];
+ else {
+ addItem( objectItem );
+ objectItem->unselect();
+ entryLevelMap[ objectEntry ] = currentLevel;
+ levelObjects[ currentLevel ].push_back( objectEntry );
+ }
+ objectItem->setIsMainObject( true );
+
+ if( myDisplayAscendants->isChecked() )
+ drawWard( i->second.first, entryLevelMap, levelObjects, currentLevel, -1 );
+ if( myDisplayDescendants->isChecked() )
+ drawWard( i->second.second, entryLevelMap, levelObjects, currentLevel, 1 );
+ }
+
+ std::map< int, std::vector< std::string > >::const_iterator level;
+ for( level = levelObjects.begin(); level != levelObjects.end(); level++ ) {
+ int step = -horDistance * ( int(level->second.size()) - 1 ) / 2;
+ for( int objIter = 0; objIter < level->second.size(); objIter++ ) {
+ DependencyTree_Object* anObject = myTreeMap[ level->second.at( objIter ) ];
+ anObject->setPos( step, verDistance * level->first );
+ step += horDistance;
+ }
+ }
+
+ // draw arrows on scene
+ GEOMUtils::TreeModel::const_iterator j;
+ for( j = myTreeModel.begin(); j != myTreeModel.end(); j++ ) {
+ DependencyTree_Object* Main_object = myTreeMap[ j->first ];
+ if( j->second.first.size() > 0 ) {
+ GEOMUtils::LevelInfo Levelup = j->second.first.at(0);
+ if( myDisplayAscendants ->isChecked() ) {
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = Levelup.begin(); node != Levelup.end(); node++ ) {
+ DependencyTree_Object* object = myTreeMap[ node->first ];
+ DependencyTree_Arrow* arrow =
+ myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( Main_object, object )];
+ if( arrow && !isItemAdded( arrow ) )
+ addItem( arrow );
+ }
+ }
+ }
+ if( myDisplayAscendants->isChecked() )
+ drawWardArrows( j->second.first );
+ if( myDisplayDescendants->isChecked() )
+ drawWardArrows( j->second.second );
+ }
+}
+
+//=================================================================================
+// function : drawWard()
+// purpose : draw nodes of dependency tree ward (ascendant or descendant)
+//=================================================================================
+void DependencyTree_View::drawWard( const GEOMUtils::LevelsList& theWard,
+ std::map< std::string, int >& theEntryLevelMap,
+ std::map< int, std::vector< std::string > >& theLevelObjects,
+ int theCurrentLevel, const int theLevelStep )
+{
+ for( int level = 0; level < theWard.size(); level++ ) {
+ if( level >= myLevelsNumber )
+ return;
+ theCurrentLevel += theLevelStep;
+ GEOMUtils::LevelInfo levelInfo = theWard.at( level );
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = levelInfo.begin(); node != levelInfo.end(); node++ ) {
+ DependencyTree_Object* object = myTreeMap[ node->first ];
+ if( object && !isItemAdded( object ) ) {
+ addItem( object );
+ object->unselect();
+ theEntryLevelMap[ node->first ] = theCurrentLevel;
+ theLevelObjects[ theCurrentLevel ].push_back( node->first );
+ }
+ }
+ }
+}
+
+//=================================================================================
+// function : drawWardArrows()
+// purpose : draw arrows of dependency tree ward (ascendant or descendant)
+//=================================================================================
+void DependencyTree_View::drawWardArrows( const GEOMUtils::LevelsList& theWard )
+{
+ for( int j = 0; j < theWard.size(); j++ ) {
+ if( j >= myLevelsNumber )
+ break;
+ GEOMUtils::LevelInfo Level = theWard.at(j);
+ GEOMUtils::LevelInfo::const_iterator node;
+ for( node = Level.begin(); node != Level.end(); node++ ) {
+ DependencyTree_Object* object = myTreeMap[ node->first ];
+ GEOMUtils::NodeLinks Links = node->second;
+ for( int link = 0; link < Links.size(); link++ ) {
+ DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
+ if( isItemAdded( object ) && isItemAdded( LinkObject ) ) {
+ DependencyTree_Arrow* arrow = myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( object, LinkObject ) ];
+ if( arrow && !isItemAdded( arrow ) )
+ addItem( arrow );
+ }
+ }
+ }
+ }
+}
+
+//=================================================================================
+// function : updateView()
+// purpose : update viewer using created dependency tree model
+//=================================================================================
+void DependencyTree_View::updateView()
+{
+ if( !myIsUpdate )
+ return;
+
+ drawTree();
+ fitAll();
+}
+
+//=================================================================================
+// function : clearView()
+// purpose : clear viewer and initialize all variables
+//=================================================================================
+void DependencyTree_View::clearView( bool isClearModel )
+{
+ EntryObjectMap::const_iterator objectIter;
+ for( objectIter = myTreeMap.begin(); objectIter != myTreeMap.end(); objectIter++ ) {
+ if( DependencyTree_Object* object = objectIter->second )
+ if( isItemAdded( object ) )
+ removeItem( object );
+ }
+
+ ArrowsInfo::const_iterator arrowIter;
+ for( arrowIter = myArrows.begin(); arrowIter != myArrows.end(); arrowIter++ ) {
+ if( DependencyTree_Arrow* arrow = arrowIter->second )
+ if( isItemAdded( arrow ) )
+ removeItem( arrow );
+ }
+
+ if( isClearModel ) {
+ EntryObjectMap::const_iterator objectIter;
+ for( objectIter = myTreeMap.begin(); objectIter != myTreeMap.end(); objectIter++ ) {
+ if( DependencyTree_Object* object = objectIter->second )
+ delete object;
+ }
+
+ ArrowsInfo::const_iterator arrowIter;
+ for( arrowIter = myArrows.begin(); arrowIter != myArrows.end(); arrowIter++ ) {
+ if( DependencyTree_Arrow* arrow = arrowIter->second )
+ delete arrow;
+ }
+ myTreeMap.clear();
+ myArrows.clear();
+ myTreeModel.clear();
+ myLevelsNumber = 0;
+ myMaxDownwardLevelsNumber = 0;
+ myMaxUpwardLevelsNumber = 0;
+ myIsUpdate = true;
+ }
+}
+
+//=================================================================================
+// function : getNewTreeModel()
+// purpose : get dependency tree model from engine
+//=================================================================================
+void DependencyTree_View::getNewTreeModel( bool theUseSelectedObject, bool theUseOB )
+{
+ GEOM::string_array_var objectsEntry = new GEOM::string_array();
+ int iter = 0;
+
+ if( theUseSelectedObject ) {
+ if( theUseOB ) {
+ SALOME_ListIO mainObjects;
+ mySelectionMgr->selectedObjects( mainObjects );
+ // create a list of selected object entry
+ objectsEntry->length( mainObjects.Extent() );
+ for ( SALOME_ListIteratorOfListIO It( mainObjects ); It.More(); It.Next(), iter++ ) {
+ Handle( SALOME_InteractiveObject ) io = It.Value();
+ if( !io->hasEntry() )
+ continue;
+ GEOM::GEOM_Object_var geomObject = GEOM::GEOM_Object::_nil();
+ geomObject = GEOMBase::ConvertIOinGEOMObject( io );
+ QString entry = geomObject->GetEntry();
+ objectsEntry[ iter ] = entry.toLatin1().constData();
+ }
+ }
+ else {
+ objectsEntry->length( nbSelected() );
+ for( initSelected(); moreSelected(); nextSelected(), iter++ )
+ if( DependencyTree_Object* treeObject = dynamic_cast<DependencyTree_Object*>( selectedObject() ) )
+ objectsEntry[ iter ] = treeObject->getEntry().c_str();
+ }
+ myMainEntries = objectsEntry;
+ }
+
+ // get string which describes dependency tree structure
+ SALOMEDS::TMPFile_var SeqFile =
+ GeometryGUI::GetGeomGen()->GetDependencyTree( myStudy, myMainEntries );
+ char* buf = (char*)&SeqFile[0];
+
+ clearView( true );
+ mySelectionMgr->clearSelected();
+
+ // get dependency tree structure
+ GEOMUtils::ConvertStringToTree( buf, myTreeModel );
+
+ parseTree();
+}
+
+//=================================================================================
+// function : checkMaxLevelsNumber()
+// purpose : calculate max levels number
+//=================================================================================
+int DependencyTree_View::checkMaxLevelsNumber()
+{
+ if( myDisplayAscendants->isChecked() && myDisplayDescendants->isChecked() )
+ return myMaxUpwardLevelsNumber > myMaxDownwardLevelsNumber ?
+ myMaxUpwardLevelsNumber : myMaxDownwardLevelsNumber;
+ else if( myDisplayAscendants ->isChecked() )
+ return myMaxUpwardLevelsNumber;
+ else if( myDisplayDescendants->isChecked() )
+ return myMaxDownwardLevelsNumber;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_VIEW_H
+#define DEPENDENCYTREE_VIEW_H
+
+// GEOM includes
+#include <GEOMUtils.hxx>
+#include <GeometryGUI.h>
+
+// GUI includes
+#include <GraphicsView_ViewPort.h>
+#include <GraphicsView_ViewFrame.h>
+
+#include <SalomeApp_Application.h>
+
+// QT includes
+#include <QPushButton>
+#include <QSpinBox>
+#include <QCheckBox>
+
+#include "DependencyTree.h"
+
+class DependencyTree_Object;
+class DependencyTree_Arrow;
+class DependencyTree_View;
+
+typedef std::map<std::string,DependencyTree_Object*> EntryObjectMap;
+typedef std::map<std::pair<DependencyTree_Object*,DependencyTree_Object*>,DependencyTree_Arrow*> ArrowsInfo;
+
+class DEPENDENCYTREE_EXPORT DependencyTree_View: public GraphicsView_ViewPort
+{
+ Q_OBJECT
+
+public:
+
+ DependencyTree_View( QWidget* = 0 );
+ ~DependencyTree_View();
+
+ void init( GraphicsView_ViewFrame* );
+ void updateModel( bool = true, bool = true );
+
+ void mouseMoveEvent(QMouseEvent* event);
+ void wheelEvent( QWheelEvent* event );
+
+ QString getViewName() const;
+ int getStudyId() const;
+
+ DependencyTree_Object* getObjectByEntry( const std::string& );
+
+public slots:
+
+ void onRebuildModel();
+
+private slots:
+
+ void onUpdateModel();
+ void onMoveNodes( bool );
+ void onHierarchyType();
+ void onPreferenceChanged( const QString&, const QString& );
+ void onRenameObject( const QString& theEntry );
+
+private:
+
+ void parseTree();
+ void parseTreeWard( const GEOMUtils::LevelsList& );
+ void parseTreeWardArrow( const GEOMUtils::LevelsList& );
+
+ void addNode( const std::string& );
+ void addArrow( DependencyTree_Object*, DependencyTree_Object* );
+
+ void drawTree();
+ void drawWard( const GEOMUtils::LevelsList&, std::map< std::string, int >&,
+ std::map< int, std::vector< std::string > >&, int, const int );
+ void drawWardArrows( const GEOMUtils::LevelsList& );
+
+ void updateView();
+ void clearView( bool );
+
+ int checkMaxLevelsNumber();
+
+ void getNewTreeModel( bool = true, bool = true );
+
+ void setHierarchyType( const int );
+ void setNodesMovable( const bool );
+ void setPrefBackgroundColor( const QColor& );
+ void setNodeColor( const QColor& );
+ void setMainNodeColor( const QColor& );
+ void setUnpublishNodeColor( const QColor& );
+ void setSelectNodeColor( const QColor& );
+ void setArrowColor( const QColor& );
+ void setHighlightArrowColor( const QColor& );
+ void setSelectArrowColor( const QColor& );
+
+ GEOMUtils::TreeModel myTreeModel;
+
+ EntryObjectMap myTreeMap;
+ ArrowsInfo myArrows;
+
+ int myLevelsNumber;
+ int myMaxDownwardLevelsNumber;
+ int myMaxUpwardLevelsNumber;
+
+ QCheckBox* myNodesMovable;
+ QSpinBox* myHierarchyDepth;
+ QCheckBox* myDisplayAscendants;
+ QCheckBox* myDisplayDescendants;
+ QPushButton* updateButton;
+
+ SALOMEDS::Study_var myStudy;
+ LightApp_SelectionMgr* mySelectionMgr;
+ GEOM::string_array_var myMainEntries;
+
+ bool myIsUpdate;
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "DependencyTree_ViewModel.h"
+#include "DependencyTree_View.h"
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SalomeApp_Study.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <OCCViewer_ViewManager.h>
+
+// GEOM includes
+#include <GEOM_Displayer.h>
+#include <GeometryGUI_Operations.h>
+
+// QT includes
+#include <QMenu>
+
+DependencyTree_ViewModel::DependencyTree_ViewModel( const QString& title )
+: GraphicsView_Viewer( title )
+{
+}
+
+DependencyTree_ViewModel::DependencyTree_ViewModel( const QString& title, QWidget* w )
+: GraphicsView_Viewer( title, w )
+{
+}
+
+DependencyTree_ViewModel::~DependencyTree_ViewModel()
+{
+}
+
+//=================================================================================
+// function : onShowSelected()
+// purpose : slot for showing selected objects in OCC Viewer
+//=================================================================================
+void DependencyTree_ViewModel::onShowSelected()
+{
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( !app ) return;
+
+ app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
+
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ if ( !aSelMgr ) return;
+
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ GEOM_Displayer disp( appStudy );
+
+ OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
+
+ if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+ if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
+ SALOME_ListIteratorOfListIO Iter( aSelList );
+ for ( ; Iter.More(); Iter.Next() )
+ disp.Display( Iter.Value(), false, viewFrame );
+ viewFrame->Repaint();
+ }
+ }
+}
+
+//=================================================================================
+// function : onShowOnlySelected()
+// purpose : slot for showing only selected objects in OCC Viewer
+//=================================================================================
+void DependencyTree_ViewModel::onShowOnlySelected()
+{
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( !app ) return;
+
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ if ( !aSelMgr ) return;
+
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects( aSelList );
+
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ GEOM_Displayer disp( appStudy );
+
+ OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
+
+ if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+ if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
+ disp.EraseAll( true, false, viewFrame );
+ SALOME_ListIteratorOfListIO Iter( aSelList );
+ for ( ; Iter.More(); Iter.Next() )
+ disp.Display( Iter.Value(), false, viewFrame );
+ viewFrame->Repaint();
+ }
+ }
+}
+
+//=================================================================================
+// function : contextMenuPopup()
+// purpose : process calling of context menu popup
+//=================================================================================
+void DependencyTree_ViewModel::contextMenuPopup( QMenu* theMenu )
+{
+ GraphicsView_Viewer::contextMenuPopup( theMenu );
+
+ if( DependencyTree_View* viewPort = dynamic_cast<DependencyTree_View*>( getActiveViewPort() ) )
+ {
+ int aNbSelected = viewPort->nbSelected();
+ if( aNbSelected > 0 ) {
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+ theMenu->clear();
+ theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) );
+ theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) );
+ theMenu->addAction( tr( "MEN_REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) );
+ theMenu->addSeparator();
+ theMenu->addAction( aGeomGUI->action( GEOMOp::OpReduceStudy ) );
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef DEPENDENCYTREE_VIEWMODEL_H
+#define DEPENDENCYTREE_VIEWMODEL_H
+
+#include <GraphicsView_Viewer.h>
+
+#include "DependencyTree.h"
+
+class DEPENDENCYTREE_EXPORT DependencyTree_ViewModel: public GraphicsView_Viewer
+{
+
+ Q_OBJECT
+
+public:
+
+ DependencyTree_ViewModel( const QString& title );
+ DependencyTree_ViewModel( const QString& title, QWidget* w );
+ ~DependencyTree_ViewModel();
+
+ virtual void contextMenuPopup( QMenu* );
+
+private slots:
+
+ void onShowSelected();
+ void onShowOnlySelected();
+
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>DependencyTree_View</name>
+ <message>
+ <source>DEPENDENCY_TREE</source>
+ <translation>Dependency Tree</translation>
+ </message>
+ <message>
+ <source>MOVE_NODES</source>
+ <translation>Move nodes</translation>
+ </message>
+ <message>
+ <source>HIERARCHY_DEPTH</source>
+ <translation>Hierarchy depth </translation>
+ </message>
+ <message>
+ <source>DISPLAY_ASCENDANTS</source>
+ <translation>Display ascendants</translation>
+ </message>
+ <message>
+ <source>DISPLAY_DESCENDANTS</source>
+ <translation>Display descendants</translation>
+ </message>
+ <message>
+ <source>SHOW_ALL</source>
+ <translation>Show all</translation>
+ </message>
+ <message>
+ <source>UPDATE</source>
+ <translation>Update</translation>
+ </message>
+ <name>DependencyTree_ViewModel</name>
+ <message>
+ <source>MEN_REBUILD_THE_TREE</source>
+ <translation>Rebuild the tree</translation>
+ </message>
+ <message>
+ <source>MEN_REDUCE_STUDY</source>
+ <translation>Reduce study</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>DependencyTree_View</name>
+ <message>
+ <source>DEPENDENCY_TREE</source>
+ <translation type="unfinished">Dependency Tree</translation>
+ </message>
+ <message>
+ <source>MOVE_NODES</source>
+ <translation type="unfinished">Move nodes</translation>
+ </message>
+ <message>
+ <source>HIERARCHY_DEPTH</source>
+ <translation type="unfinished">Hierarchy depth </translation>
+ </message>
+ <message>
+ <source>DISPLAY_ASCENDANTS</source>
+ <translation type="unfinished">Display ascendants</translation>
+ </message>
+ <message>
+ <source>DISPLAY_DESCENDANTS</source>
+ <translation type="unfinished">Display descendants</translation>
+ </message>
+ <message>
+ <source>SHOW_ALL</source>
+ <translation type="unfinished">Show all</translation>
+ </message>
+ <message>
+ <source>UPDATE</source>
+ <translation type="unfinished">Update</translation>
+ </message>
+ <name>DependencyTree_ViewModel</name>
+ <message>
+ <source>MEN_REBUILD_THE_TREE</source>
+ <translation type="unfinished">Rebuild the tree</translation>
+ </message>
+ <message>
+ <source>MEN_REDUCE_STUDY</source>
+ <translation type="unfinished">Reduce study</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS>
+<context>
+ <name>DependencyTree_View</name>
+ <message>
+ <source>DEPENDENCY_TREE</source>
+ <translation type="unfinished">Dependency Tree</translation>
+ </message>
+ <message>
+ <source>MOVE_NODES</source>
+ <translation type="unfinished">Move nodes</translation>
+ </message>
+ <message>
+ <source>HIERARCHY_DEPTH</source>
+ <translation type="unfinished">Hierarchy depth </translation>
+ </message>
+ <message>
+ <source>DISPLAY_ASCENDANTS</source>
+ <translation type="unfinished">Display ascendants</translation>
+ </message>
+ <message>
+ <source>DISPLAY_DESCENDANTS</source>
+ <translation type="unfinished">Display descendants</translation>
+ </message>
+ <message>
+ <source>SHOW_ALL</source>
+ <translation type="unfinished">Show all</translation>
+ </message>
+ <message>
+ <source>UPDATE</source>
+ <translation type="unfinished">Update</translation>
+ </message>
+ <name>DependencyTree_ViewModel</name>
+ <message>
+ <source>MEN_REBUILD_THE_TREE</source>
+ <translation type="unfinished">Rebuild the tree</translation>
+ </message>
+ <message>
+ <source>MEN_REDUCE_STUDY</source>
+ <translation type="unfinished">Reduce study</translation>
+ </message>
+</context>
+</TS>
\ No newline at end of file
#include <OCCViewer_ViewModel.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SVTK_ViewWindow.h>
#include <SVTK_View.h>
( GetVectorMode() ? tr("MEN_VECTOR_MODE_ON") : tr( "MEN_VECTOR_MODE_OFF" ) );
getGeometryGUI()->menuMgr()->update();
break;
+ case GEOMOp::OpSwitchVertices: // MENU VIEW - DISPLAY MODE - SHOW/HIDE VERTICES
+ SetVerticesMode(!GetVerticesMode());
+ getGeometryGUI()->action( GEOMOp::OpSwitchVertices )->setText
+ ( GetVerticesMode() ? tr("MEN_VERTICES_MODE_ON") : tr( "MEN_VERTICES_MODE_OFF" ) );
+ getGeometryGUI()->menuMgr()->update();
+ break;
case GEOMOp::OpWireframe: // POPUP MENU - DISPLAY MODE - WIREFRAME
ChangeDisplayMode( 0 );
break;
case GEOMOp::OpVectors: // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
ChangeDisplayMode( 4 );
break;
+ case GEOMOp::OpVertices: // POPUP MENU - DISPLAY MODE - SHOW VERTICES
+ ChangeDisplayMode( 5 );
+ break;
default:
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
return viewWindow->property( "VectorsMode" ).toBool();
}
+//=====================================================================================
+// function : DisplayGUI::SetVerticesMode()
+// purpose : Set vertices mode for the viewer
+//=====================================================================================
+void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow )
+{
+ SUIT_OverrideCursor();
+
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if ( !app ) return;
+
+ SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+ if ( !aStudy ) return;
+
+ if ( !viewWindow )
+ viewWindow = app->desktop()->activeWindow();
+
+ GEOM_Displayer displayer( aStudy );
+
+ viewWindow->setProperty( "VerticesMode", mode );
+
+ int aMgrId = viewWindow->getViewManager()->getGlobalId();
+
+ SALOME_ListIO anIOlst;
+ displayer.GetActiveView()->GetVisible( anIOlst );
+
+ for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
+ Handle( SALOME_InteractiveObject ) io = It.Value();
+ aStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::Vertices ), mode );
+ displayer.Redisplay( io, false );
+ }
+ displayer.UpdateViewer();
+ GeometryGUI::Modified();
+}
+
+//=====================================================================================
+// function : DisplayGUI::GetVerticesMode()
+// purpose : Get the "show vertices" mode of the viewer
+//=====================================================================================
+int DisplayGUI::GetVerticesMode( SUIT_ViewWindow* viewWindow )
+{
+ if ( !viewWindow )
+ viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
+ return viewWindow->property( "VerticesMode" ).toBool();
+}
+
//=====================================================================================
// function : DisplayGUI::ChangeDisplayMode()
// purpose : Set display mode for selected objects in the viewer given
QVariant v = aStudy->getObjectProperty( mgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::EdgesDirection ), QVariant() );
bool vectorMode = v.isValid() ? !v.toBool() : false;
+ v = aStudy->getObjectProperty( mgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::Vertices ), QVariant() );
+ bool verticesMode = v.isValid() ? !v.toBool() : false;
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
Handle( SALOME_InteractiveObject ) io = It.Value();
else if ( mode == 4 ) {
aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::EdgesDirection ), vectorMode );
}
+ else if ( mode == 5 ) {
+ aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::Vertices ), verticesMode );
+ }
displayer.Redisplay( io, false );
}
displayer.UpdateViewer();
int GetVectorMode( SUIT_ViewWindow* = 0 );
// Invert vector mode ( shadin <-> wireframe ) for the viewer
+ // VERTICES MODE methods
+ // Set vertices mode for the viewer
+ void SetVerticesMode( const bool, SUIT_ViewWindow* = 0 );
+ // Get vertices mode of the viewer
+ int GetVerticesMode( SUIT_ViewWindow* = 0 );
+
// Set display mode for selected objects in the viewer given
// (current viewer if <viewWindow> = 0 )
void ChangeDisplayMode( const int, SUIT_ViewWindow* = 0 );
DlgRef_2Sel2Spin_QTD.ui
DlgRef_2Sel3Spin2Rb_QTD.ui
DlgRef_2Sel3Spin_QTD.ui
+ DlgRef_2Sel3Spin1Check_QTD.ui
DlgRef_2SelExt_QTD.ui
DlgRef_2Sel_QTD.ui
DlgRef_2Spin_QTD.ui
DlgRef_3Sel4Spin2Check_QTD.ui
DlgRef_3Sel_QTD.ui
DlgRef_3Spin1Check_QTD.ui
+ DlgRef_3Spin1CheckCyl_QTD.ui
DlgRef_3Spin_QTD.ui
DlgRef_4Sel1List1Check_QTD.ui
DlgRef_4Sel1List_QTD.ui
DlgRef_4Sel1Spin3Check_QTD.ui
DlgRef_4Spin_QTD.ui
DlgRef_6Sel_QTD.ui
- DlgRef_Skeleton_QTD.ui
)
# --- headers ---
{
}
+//////////////////////////////////////////
+// DlgRef_2Sel3Spin1Check
+//////////////////////////////////////////
+
+DlgRef_2Sel3Spin1Check::DlgRef_2Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_2Sel3Spin1Check::~DlgRef_2Sel3Spin1Check()
+{
+}
+
//////////////////////////////////////////
// DlgRef_2Sel3Spin2Rb
//////////////////////////////////////////
{
}
+//////////////////////////////////////////
+// DlgRef_3Spin1CheckCyl
+//////////////////////////////////////////
+
+DlgRef_3Spin1CheckCyl::DlgRef_3Spin1CheckCyl( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_3Spin1CheckCyl::~DlgRef_3Spin1CheckCyl()
+{
+}
+
//////////////////////////////////////////
// DlgRef_3Spin
//////////////////////////////////////////
{
}
-//////////////////////////////////////////
-// DlgRef_Skeleton
-//////////////////////////////////////////
-
-DlgRef_Skeleton::DlgRef_Skeleton( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
- setupUi( this );
-}
-
-DlgRef_Skeleton::~DlgRef_Skeleton()
-{
-}
-
//////////////////////////////////////////
// Utility functions
//////////////////////////////////////////
~DlgRef_2Sel2Spin2Push();
};
+//////////////////////////////////////////
+// DlgRef_2Sel3Spin1Check
+//////////////////////////////////////////
+
+#include "ui_DlgRef_2Sel3Spin1Check_QTD.h"
+
+class DLGREF_EXPORT DlgRef_2Sel3Spin1Check : public QWidget,
+ public Ui::DlgRef_2Sel3Spin1Check_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_2Sel3Spin1Check( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_2Sel3Spin1Check();
+};
+
//////////////////////////////////////////
// DlgRef_2Sel3Spin2Rb
//////////////////////////////////////////
~DlgRef_3Spin1Check();
};
+//////////////////////////////////////////
+// DlgRef_3Spin1CheckCyl
+//////////////////////////////////////////
+
+#include "ui_DlgRef_3Spin1CheckCyl_QTD.h"
+
+class DLGREF_EXPORT DlgRef_3Spin1CheckCyl : public QWidget,
+ public Ui::DlgRef_3Spin1CheckCyl_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_3Spin1CheckCyl( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_3Spin1CheckCyl();
+};
+
//////////////////////////////////////////
// DlgRef_3Spin
//////////////////////////////////////////
~DlgRef_6Sel();
};
-//////////////////////////////////////////
-// DlgRef_Skeleton
-//////////////////////////////////////////
-
-#include "ui_DlgRef_Skeleton_QTD.h"
-
-class DLGREF_EXPORT DlgRef_Skeleton : public QWidget,
- public Ui::DlgRef_Skeleton_QTD
-{
- Q_OBJECT
-
-public:
- DlgRef_Skeleton( QWidget* = 0, Qt::WindowFlags = 0 );
- ~DlgRef_Skeleton();
-};
-
//////////////////////////////////////////
// Utility functions
//////////////////////////////////////////
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DlgRef_2Sel3Spin1Check_QTD</class>
+ <widget class="QWidget" name="DlgRef_2Sel3Spin1Check_QTD">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>323</width>
+ <height>223</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string/>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="GroupBox1">
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>9</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="5" column="1">
+ <widget class="QLabel" name="TextLabel4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL4</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="TextLabel3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="TextLabel1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLineEdit" name="LineEdit1"/>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="TextLabel2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="PushButton1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLineEdit" name="LineEdit2"/>
+ </item>
+ <item row="2" column="2">
+ <widget class="QPushButton" name="PushButton2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" colspan="2">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX"/>
+ </item>
+ <item row="6" column="2" colspan="2">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ"/>
+ </item>
+ <item row="5" column="2" colspan="2">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY"/>
+ </item>
+ <item row="6" column="1">
+ <widget class="QLabel" name="TextLabel5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL5</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="checkBox">
+ <property name="text">
+ <string>CB</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global">SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>LineEdit1</tabstop>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>LineEdit2</tabstop>
+ <tabstop>SpinBox_DX</tabstop>
+ <tabstop>SpinBox_DY</tabstop>
+ <tabstop>SpinBox_DZ</tabstop>
+ <tabstop>checkBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DlgRef_3Spin1CheckCyl_QTD</class>
+ <widget class="QWidget" name="DlgRef_3Spin1CheckCyl_QTD">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>611</width>
+ <height>154</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string/>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="GroupBox1">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QGridLayout" columnstretch="0,0,0,0" columnminimumwidth="0,0,0,280">
+ <property name="margin">
+ <number>9</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="2" column="1">
+ <widget class="QLabel" name="TextLabel3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL3</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="TextLabel2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL2</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="TextLabel1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX"/>
+ </item>
+ <item row="1" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY"/>
+ </item>
+ <item row="2" column="3">
+ <widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="checkBox">
+ <property name="text">
+ <string>CB</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>SalomeApp_DoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global">SalomeApp_DoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>SpinBox_DX</tabstop>
+ <tabstop>SpinBox_DY</tabstop>
+ <tabstop>SpinBox_DZ</tabstop>
+ <tabstop>checkBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
${PROJECT_SOURCE_DIR}/src/GEOMGUI
${PROJECT_SOURCE_DIR}/src/GEOMBase
${PROJECT_SOURCE_DIR}/src/SKETCHER
+ ${PROJECT_SOURCE_DIR}/src/CurveCreator
${PROJECT_SOURCE_DIR}/src/ShapeRecognition
${PROJECT_SOURCE_DIR}/src/DlgRef
${PROJECT_BINARY_DIR}/src/DlgRef
GEOM
DlgRef
GEOMSketcher
+ CurveCreator
)
# optional sources
EntityGUI.h
EntityGUI_Widgets.h
EntityGUI_SketcherDlg.h
+ EntityGUI_PolylineDlg.h
EntityGUI_3DSketcherDlg.h
EntityGUI_IsolineDlg.h
EntityGUI_SubShapeDlg.h
EntityGUI_Widgets.h
EntityGUI_FieldDlg.h
EntityGUI_SketcherDlg.h
+ EntityGUI_PolylineDlg.h
EntityGUI_3DSketcherDlg.h
EntityGUI_IsolineDlg.h
EntityGUI_SubShapeDlg.h
EntityGUI_Widgets.cxx
EntityGUI_FieldDlg.cxx
EntityGUI_SketcherDlg.cxx
+ EntityGUI_PolylineDlg.cxx
EntityGUI_3DSketcherDlg.cxx
EntityGUI_IsolineDlg.cxx
EntityGUI_SubShapeDlg.cxx
#include <OCCViewer_ViewModel.h>
#include <OCCViewer_ViewPort3d.h>
#include <OCCViewer_ViewWindow.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Session.h>
#include "EntityGUI_FeatureDetectorDlg.h" // Feature Detection
#include "EntityGUI_PictureImportDlg.h" // Import Picture in viewer
#include "EntityGUI_FieldDlg.h" // Create/Edit Field
+#include "EntityGUI_PolylineDlg.h" // Create/Edit 2d polyline
#include "GEOMImpl_Types.hxx"
SUIT_MessageBox::warning(parent, tr("WRN_WARNING"), tr("NO_FIELD"));
break;
}
+ case GEOMOp::Op2dPolylineEditor: // POLYLINE EDITOR
+ getGeometryGUI()->ActiveWorkingPlane();
+ aDlg = new EntityGUI_PolylineDlg( getGeometryGUI(), parent );
+ break;
default:
app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break;
try {
if ( !S1.IsNull() ) {
/* erase any previous */
-#if OCC_VERSION_LARGE <= 0x06060000
- ic->Erase( mySimulationShape1, Standard_True, Standard_False );
-#else
ic->Erase( mySimulationShape1, Standard_True );
-#endif
ic->ClearPrs( mySimulationShape1 );
mySimulationShape1 = new AIS_Shape( TopoDS_Shape() );
mySimulationShape1->UnsetColor();
}
if ( !S2.IsNull() ) {
-#if OCC_VERSION_LARGE <= 0x06060000
- ic->Erase( mySimulationShape2, Standard_True, Standard_False );
-#else
ic->Erase( mySimulationShape2, Standard_True );
-#endif
ic->ClearPrs( mySimulationShape2 );
mySimulationShape2 = new AIS_Shape( TopoDS_Shape() );
if ( vw->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ( (OCCViewer_ViewManager*)( vw->getViewManager() ) )->getOCCViewer();
Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
-#if OCC_VERSION_LARGE <= 0x06060000
- ic->Erase( mySimulationShape1, Standard_True, Standard_False );
- ic->Erase( mySimulationShape2, Standard_True, Standard_False );
-#else
ic->Erase( mySimulationShape1, Standard_True );
ic->Erase( mySimulationShape2, Standard_True );
-#endif
ic->ClearPrs( mySimulationShape1 );
ic->ClearPrs( mySimulationShape2 );
ic->UpdateCurrentViewer();
#include <gce_MakePln.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
-#if OCC_VERSION_LARGE > 0x06050300
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Text.hxx>
#include <Graphic3d_HorizontalTextAlignment.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Font_FontAspect.hxx>
-#endif // OCC_VERSION_LARGE > 0x06050300
// This include must be *AFTER* SOCC_ViewModel.h because
// of the constant ROTATE which is a #define in
bool& myLock;
};
-#if OCC_VERSION_LARGE > 0x06050300
DEFINE_STANDARD_HANDLE(AIS_Text, AIS_InteractiveObject)
class AIS_Text:public AIS_InteractiveObject
asp->Aspect()->SetTextFontAspect(aFontAspect);
Prs3d_Text::Draw(aPresentation, asp, aText, aPosition);
};
-#endif // OCC_VERSION_LARGE > 0x06050300
bool isSame (double d1, double d2)
{
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
myAnglePrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
myLengthPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
-#if OCC_VERSION_LARGE > 0x06050300
myTextPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
-#endif // OCC_VERSION_LARGE > 0x06050300
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
gp_Pnt P,
bool store )
{
-#if OCC_VERSION_LARGE > 0x06050300
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
Handle(AIS_Text) anIO = new AIS_Text(TCollection_ExtendedString(theText.c_str()), P);
GEOMBase_Helper::displayPreview(aSPrs, true, true);
}
}
-#endif // OCC_VERSION_LARGE > 0x06050300
+
}
//================================================================
Handle(AIS_AngleDimension) anIO = new AIS_AngleDimension( P1, P0, P2 );
- anIO->SetCustomValue( theAngle );
+ //anIO->SetCustomValue( theAngle );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
int w = resMgr->integerValue( "Geometry", "measures_line_width", 1 );
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SalomeApp_Study.h>
LINES
};
-enum {
- RADIO_BUTTONS,
- MSG,
- PUSH_BUTTON,
-};
-
enum {
KERNEL_SIZE,
FIND_CONTOURS_METHOD,
double u_v_det = (it->x - it_previous->x) * (it_next->y - it->y) -
(it->y - it_previous->y) * (it_next->x - it->x);
- double norme_u = sqrt ( (it->x - it_previous->x)*(it->x - it_previous->x) +
- (it->y - it_previous->y)*(it->y - it_previous->y) );
+ double norme_u = sqrt ( double(it->x - it_previous->x) * double(it->x - it_previous->x) +
+ double(it->y - it_previous->y) * double(it->y - it_previous->y) );
- double norme_v = sqrt ( (it->x - it_next->x)*(it->x - it_next->x) +
- (it->y - it_next->y)*(it->y - it_next->y) );
+ double norme_v = sqrt ( double(it->x - it_next->x) * double(it->x - it_next->x) +
+ double(it->y - it_next->y) * double(it->y - it_next->y) );
double u_v_sinus = u_v_det / (norme_u * norme_v);
#include <OCCViewer_ViewManager.h>
#include <SVTK_ViewModel.h>
#include <SALOME_Prs.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "EntityGUI_PolylineDlg.h"
+#include <CurveCreator_Curve.hxx>
+#include <CurveCreator_Utils.hxx>
+#include <CurveCreator_Widget.h>
+#include <DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+
+#include <OCCViewer_ViewManager.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+#include <BRep_Tool.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomLib_IsPlanarSurface.hxx>
+#include <TopoDS.hxx>
+
+#include <QGroupBox>
+#include <QVBoxLayout>
+
+//#define SET_PLANE
+
+//=================================================================================
+// function : Constructor
+// purpose :
+//=================================================================================
+EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
+ (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
+ : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ),
+ myCurve (0),
+ myEditorWidget (0),
+ myAddElementBox (0),
+ myPlnComboBox (0),
+ myPlnButton (0),
+ myPlnSelButton (0),
+ myWPlaneLineEdit (0),
+ myPolylineSelButton (0),
+ myPolylineEdit (0),
+ myEditCurrentArgument (0)
+{
+ QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
+ QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+ setWindowTitle(tr("POLYLINE_DLG_TITLE"));
+
+ /***************************************************************/
+ mainFrame()->GroupConstructors->setTitle(tr("POLYLINE_TITLE"));
+ mainFrame()->RadioButton1->setIcon(image0);
+ mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ mainFrame()->RadioButton3->close();
+
+ QGroupBox *aGroupBox1 = new QGroupBox(tr("GEOM_CS"), this);
+ QGridLayout *aPlaneLayout = new QGridLayout(aGroupBox1);
+
+ aPlaneLayout->setSpacing(6);
+ aPlaneLayout->setMargin(11);
+
+ myPlnComboBox = new QComboBox(aGroupBox1);
+ aPlaneLayout->addWidget(myPlnComboBox, 0, 0, 1, 3);
+
+ myPlnButton = new QPushButton (aGroupBox1);
+ myPlnButton->setText( tr( "GEOM_SKETCHER_RESTORE" ) );
+ aPlaneLayout->addWidget(myPlnButton, 0, 3);
+
+#ifdef SET_PLANE
+ QLabel *aPlaneLbl = new QLabel(tr("GEOM_PLANE"), aGroupBox1);
+
+ myPlnSelButton = new QPushButton (aGroupBox1);
+ myPlnSelButton->setIcon(image1);
+ myWPlaneLineEdit = new QLineEdit (aGroupBox1);
+ myWPlaneLineEdit->setReadOnly(true);
+#endif
+
+ QLabel *aPolylineLbl = new QLabel(tr("POLYLINE_IMPORT"), aGroupBox1);
+
+ myPolylineSelButton = new QPushButton (aGroupBox1);
+ myPolylineSelButton->setIcon(image1);
+ myPolylineEdit = new QLineEdit (aGroupBox1);
+ myPolylineEdit->setReadOnly(true);
+
+#ifdef SET_PLANE
+ aPlaneLayout->addWidget(aPlaneLbl, 1, 0);
+ aPlaneLayout->addWidget(myPlnSelButton, 1, 1);
+ aPlaneLayout->addWidget(myWPlaneLineEdit, 1, 2, 1, 2);
+#endif
+ aPlaneLayout->addWidget(aPolylineLbl, 2, 0);
+ aPlaneLayout->addWidget(myPolylineSelButton, 2, 1);
+ aPlaneLayout->addWidget(myPolylineEdit, 2, 2, 1, 2);
+
+ aPlaneLayout->setColumnStretch(2, 1);
+
+ myCurve = new CurveCreator_Curve( CurveCreator::Dim2d );
+ myEditorWidget = new CurveCreator_Widget (centralWidget(), myCurve);
+ myAddElementBox = new QGroupBox (tr("POLYLINE_ADD_SECTION"), centralWidget());
+
+ QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox );
+
+ anAddElementLayout->setMargin( 0 );
+ anAddElementLayout->setSpacing( 6 );
+
+ QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+
+ layout->setMargin( 0 );
+ layout->setSpacing( 6 );
+ layout->addWidget( aGroupBox1 );
+ layout->addWidget( myEditorWidget );
+ layout->addWidget( myAddElementBox );
+
+ /***************************************************************/
+
+ setHelpFileName( "create_polyline_page.html" );
+
+ /* Initialisations */
+ Init();
+}
+
+//=================================================================================
+// function : Destructor
+// purpose :
+//=================================================================================
+EntityGUI_PolylineDlg::~EntityGUI_PolylineDlg()
+{
+ delete myCurve;
+}
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::Init()
+{
+ initName(tr("POLYLINE_NAME"));
+
+ SalomeApp_Application *anApp = myGeomGUI->getApp();
+ OCCViewer_ViewManager *aViewManager = dynamic_cast<OCCViewer_ViewManager*>
+ (anApp->getViewManager(OCCViewer_Viewer::Type(), true));
+ LightApp_SelectionMgr *aSelMgr = myGeomGUI->getApp()->selectionMgr();
+
+ myEditorWidget->setOCCViewer(aViewManager ? aViewManager->getOCCViewer() : 0);
+
+ // Init the list of local coordinate system
+ gp_Pnt aPnt(0., 0., 0.);
+ gp_Dir aDirN(0., 0., 1.);
+ gp_Dir aDirX(1., 0., 0.);
+ gp_Ax3 aLCS(aPnt, aDirN, aDirX);
+
+ //add Global CS
+ myPlnComboBox->addItem(tr("GEOM_GCS"), false);
+ myWPlaneList.push_back(GEOM::GeomObjPtr());
+ myLCSList.push_back(aLCS);
+
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
+#ifdef SET_PLANE
+ connect(myPlnSelButton, SIGNAL(clicked()),
+ this, SLOT(SetEditCurrentArgument()));
+#endif
+ connect(myPolylineSelButton, SIGNAL(clicked()),
+ this, SLOT(SetEditCurrentArgument()));
+ connect(aSelMgr, SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+ connect(myEditorWidget, SIGNAL(subOperationStarted(QWidget*, bool)),
+ this, SLOT(processStartedSubOperation(QWidget*, bool)));
+ connect(myEditorWidget, SIGNAL(subOperationFinished(QWidget*)),
+ this, SLOT(processFinishedSubOperation(QWidget*)));
+ connect(myEditorWidget, SIGNAL(curveModified()),
+ this, SLOT(onUpdatePreview()));
+#ifdef SET_PLANE
+ connect(myPlnComboBox, SIGNAL(activated(int)),
+ this, SLOT(ActivateLocalCS()));
+ connect(myPlnButton, SIGNAL(clicked()),
+ this, SLOT(ActivateLocalCS()));
+#endif
+ connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+ myAddElementBox->hide();
+ myPolylineSelButton->click();
+ SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : Clear
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::Clear()
+{
+ delete myCurve;
+
+ myCurve = new CurveCreator_Curve( CurveCreator::Dim2d );
+ myEditorWidget->setCurve(myCurve);
+}
+
+//=================================================================================
+// function : GetCurveParams
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::GetCurveParams(GEOM::ListOfListOfDouble &theCoords,
+ GEOM::string_array &theNames,
+ GEOM::short_array &theTypes,
+ GEOM::ListOfBool &theCloseds)
+{
+ const int aNbSec = myCurve->getNbSections();
+ int i;
+ int j;
+
+ theCoords.length(aNbSec);
+ theNames.length(aNbSec);
+ theTypes.length(aNbSec);
+ theCloseds.length(aNbSec);
+
+ for (i = 0; i < aNbSec; ++i) {
+ // Set coordinates
+ CurveCreator::Coordinates aCoords = myCurve->getPoints(i);
+ const int aNbPoints = aCoords.size();
+
+ theCoords[i].length(aNbPoints);
+
+ for (j = 0; j < aNbPoints; ++j) {
+ theCoords[i][j] = aCoords[j];
+ }
+
+ // Set section type
+ const CurveCreator::SectionType aType = myCurve->getSectionType(i);
+
+ switch (aType) {
+ case CurveCreator::Spline:
+ theTypes[i] = GEOM::Interpolation;
+ break;
+ case CurveCreator::Polyline:
+ default:
+ theTypes[i] = GEOM::Polyline;
+ break;
+ }
+
+ // Set section names and closed flags.
+ theNames[i] = CORBA::string_dup(myCurve->getSectionName(i).c_str());
+ theCloseds[i] = myCurve->isClosed(i);
+ }
+}
+
+//=================================================================================
+// function : createOperation
+// purpose :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr EntityGUI_PolylineDlg::createOperation()
+{
+ return getGeomEngine()->GetICurvesOperations( getStudyId() );
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool EntityGUI_PolylineDlg::isValid( QString& msg )
+{
+ return true;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool EntityGUI_PolylineDlg::execute( ObjectList& objects )
+{
+ GEOM::GEOM_ICurvesOperations_var anOper =
+ GEOM::GEOM_ICurvesOperations::_narrow(getOperation());
+
+ // Get the polyline creation parameters.
+ GEOM::ListOfListOfDouble aCoords;
+ GEOM::string_array aNames;
+ GEOM::short_array aTypes;
+ GEOM::ListOfBool aCloseds;
+
+ GetCurveParams(aCoords, aNames, aTypes, aCloseds);
+
+ // Get Working Plane.
+ int ind = myPlnComboBox->currentIndex();
+
+ if (ind != -1) {
+ bool isPlane = myPlnComboBox->itemData(ind).toBool();
+ GEOM::GEOM_Object_var anObj;
+
+ // Perform operation
+ if (isPlane) {
+ anObj = anOper->MakePolyline2DOnPlane
+ (aCoords, aNames, aTypes, aCloseds, myWPlaneList.at(ind).get());
+ } else {
+ gp_Ax3 anAxis = myLCSList.at(ind);
+ GEOM::ListOfDouble aPlane;
+
+ aPlane.length(9);
+ aPlane[0] = anAxis.Location().X();
+ aPlane[1] = anAxis.Location().Y();
+ aPlane[2] = anAxis.Location().Z();
+ aPlane[3] = anAxis.Direction().X();
+ aPlane[4] = anAxis.Direction().Y();
+ aPlane[5] = anAxis.Direction().Z();
+ aPlane[6] = anAxis.XDirection().X();
+ aPlane[7] = anAxis.XDirection().Y();
+ aPlane[8] = anAxis.XDirection().Z();
+
+ anObj = anOper->MakePolyline2D
+ (aCoords, aNames, aTypes, aCloseds, aPlane);
+ }
+
+ if (!anObj->_is_nil()) {
+ objects.push_back(anObj._retn());
+ }
+ }
+
+ return true;
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::ClickOnOk()
+{
+ setIsApplyAndClose( true );
+
+ if (ClickOnApply())
+ ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+bool EntityGUI_PolylineDlg::ClickOnApply()
+{
+ if (!onAccept())
+ return false;
+
+ initName();
+
+ return true;
+}
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::ClickOnCancel()
+{
+ myEditorWidget->SetViewer2DMode(false);
+ GEOMBase_Skeleton::ClickOnCancel();
+}
+
+//=================================================================================
+// function : processStartedSubOperation
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget, bool theIsEdit )
+{
+ myEditorWidget->setEnabled( false );
+
+ myAddElementBox->setTitle( theIsEdit ? tr( "POLYLINE_EDIT_SECTION" ) : tr( "POLYLINE_ADD_SECTION" ) );
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->addWidget( theWidget );
+
+ theWidget->show();
+ myAddElementBox->show();
+}
+
+
+//=================================================================================
+// function : processFinishedSubOperation
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+ myEditorWidget->setEnabled( true );
+
+ QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+ anAddElementLayout->removeWidget( theWidget );
+
+ theWidget->hide();
+ myAddElementBox->hide();
+}
+
+//=================================================================================
+// function : deleteSelected
+// purpose : Redirect the delete action to editor widget
+//=================================================================================
+void EntityGUI_PolylineDlg::deleteSelected()
+{
+ myEditorWidget->removeSelected();
+}
+
+//=================================================================================
+// function : deleteEnabled
+// purpose : Checks whether there are some to delete
+//=================================================================================
+bool EntityGUI_PolylineDlg::deleteEnabled()
+{
+ return myEditorWidget->removeEnabled();
+}
+
+//=================================================================================
+// function : SelectionIntoArgument
+// purpose : Called when selection is changed
+//=================================================================================
+void EntityGUI_PolylineDlg::SelectionIntoArgument()
+{
+ bool isModified = false;
+ GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_SHAPE);
+ TopoDS_Shape aShape;
+
+ if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) &&
+ !aShape.IsNull()) {
+ QString aName = GEOMBase::GetName(aSelectedObject.get());
+
+ if (myEditCurrentArgument == myPolylineEdit) {
+ // Import a curve
+ CurveCreator_Curve *aNewCurve =
+ new CurveCreator_Curve(CurveCreator::Dim2d);
+ gp_Ax3 aLocalCS;
+
+ if (CurveCreator_Utils::constructCurve(aShape, aNewCurve, aLocalCS)) {
+ // Change the current curve be the new one.
+ myEditorWidget->setCurve(aNewCurve);
+ delete myCurve;
+ myCurve = aNewCurve;
+ isModified = true;
+ myPolylineEdit->setText(aName);
+#ifdef SET_PLANE
+ AddLocalCS(aSelectedObject.get(), false, aLocalCS);
+ myWPlaneLineEdit->clear();
+ myPlnSelButton->setDown(false);
+#endif
+ myPolylineSelButton->setDown(true);
+ } else {
+ // Does nothing, just clears selection.
+ delete aNewCurve;
+ }
+#ifdef SET_PLANE
+ } else if (myEditCurrentArgument == myWPlaneLineEdit) {
+ // Import planar face.
+ if (aShape.ShapeType() == TopAbs_FACE) {
+ // Check if the face is planar
+ Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aShape));
+ GeomLib_IsPlanarSurface aPlanarCheck(aSurf, Precision::Confusion());
+
+ if (aPlanarCheck.IsPlanar()) {
+ myWPlaneLineEdit->setText(aName);
+ myPolylineEdit->clear();
+ AddLocalCS(aSelectedObject.get(), true,
+ WPlaneToLCS(aSelectedObject.get()));
+ isModified = true;
+ myPlnSelButton->setDown(true);
+ myPolylineSelButton->setDown(false);
+ }
+ }
+
+ if (!isModified) {
+ myEditCurrentArgument->setText(tr("GEOM_SKETCHER_WPLANE"));
+ }
+#endif
+ }
+ }
+
+ if (!isModified) {
+ // Does nothing, just clears selection.
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+ myGeomGUI->getApp()->selectionMgr()->clearSelected();
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+ }
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::SetEditCurrentArgument()
+{
+ if (sender() == myPlnSelButton) {
+#ifdef SET_PLANE
+ myEditCurrentArgument = myWPlaneLineEdit;
+ myEditCurrentArgument->setFocus();
+ myPlnSelButton->setDown(true);
+ myPolylineSelButton->setDown(false);
+#endif
+ } else if (sender() == myPolylineSelButton) {
+ myEditCurrentArgument = myPolylineEdit;
+ myEditCurrentArgument->setFocus();
+#ifdef SET_PLANE
+ myPlnSelButton->setDown(false);
+#endif
+ myPolylineSelButton->setDown(true);
+ }
+}
+
+//=================================================================================
+// function : ActivateThisDialog
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::enterEvent (QEvent*)
+{
+ if (!mainFrame()->GroupConstructors->isEnabled())
+ ActivateThisDialog();
+}
+
+//=================================================================================
+// function : onUpdatePreview
+// purpose :
+//=================================================================================
+void EntityGUI_PolylineDlg::onUpdatePreview()
+{
+ displayPreview(true);
+}
+
+//=================================================================================
+// function : ActivateLocalCS
+// purpose : Activate & Fit Working plane
+//=================================================================================
+void EntityGUI_PolylineDlg::ActivateLocalCS()
+{
+ const int ind = myPlnComboBox->currentIndex();
+
+ if (ind == 0) {
+ // Default plane
+#ifdef SET_PLANE
+ myWPlaneLineEdit->clear();
+#endif
+ myPolylineEdit->clear();
+ } else if (ind > 0) { // Skip 0 as it is default
+ // Update text on line edits.
+ QString aName = GEOMBase::GetName(GetActiveWPlane().get());
+ bool isPlane = myPlnComboBox->itemData(ind).toBool();
+
+ if (isPlane) {
+#ifdef SET_PLANE
+ myWPlaneLineEdit->setText(aName);
+#endif
+ myPolylineEdit->clear();
+ } else {
+ myPolylineEdit->setText(aName);
+#ifdef SET_PLANE
+ myWPlaneLineEdit->clear();
+#endif
+ }
+ }
+
+ gp_Ax3 anAxis = GetActiveLocalCS();
+
+ myGeomGUI->SetWorkingPlane(anAxis);
+ myGeomGUI->ActiveWorkingPlane();
+}
+
+//=================================================================================
+// function : GetActiveLocalCS
+// purpose : Get Working plane
+//=================================================================================
+gp_Ax3 EntityGUI_PolylineDlg::GetActiveLocalCS()
+{
+ const int ind = myPlnComboBox->currentIndex();
+
+ return ind >= 0 ? myLCSList.at(ind) : myGeomGUI->GetWorkingPlane();
+}
+
+//=================================================================================
+// function : GetActiveWPlane
+// purpose : Get Working plane
+//=================================================================================
+GEOM::GeomObjPtr EntityGUI_PolylineDlg::GetActiveWPlane()
+{
+ const int ind = myPlnComboBox->currentIndex();
+
+ return ind >= 0 ? myWPlaneList.at(ind) : GEOM::GeomObjPtr();
+}
+
+//=================================================================================
+// function : AddLocalCS()
+// purpose : Add All Coordinates systems in study
+//=================================================================================
+void EntityGUI_PolylineDlg::AddLocalCS(GEOM::GeomObjPtr theSelectedObject,
+ const bool IsPlane,
+ const gp_Ax3 &theLCS)
+{
+ QString aName = GEOMBase::GetName(theSelectedObject.get());
+
+ int index = myPlnComboBox->findText(aName, Qt::MatchExactly);
+
+ if (index == -1) { // If the working plane hasn't been added yet
+ myWPlaneList.push_back(theSelectedObject);
+ myLCSList.push_back(theLCS);
+ myPlnComboBox->addItem(aName, QVariant(IsPlane));
+ index = myPlnComboBox->count();
+ myPlnComboBox->setCurrentIndex(index - 1);
+ } else {
+ myPlnComboBox->setCurrentIndex(index);
+ }
+ ActivateLocalCS();
+}
+
+//=================================================================================
+// function : WPlaneToLCS ( aWPlane )
+// purpose :
+//=================================================================================
+gp_Ax3 EntityGUI_PolylineDlg::WPlaneToLCS(GEOM::GeomObjPtr theGeomObj)
+{
+ TopoDS_Shape aShape =
+ GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), theGeomObj.get());
+ gp_Ax3 aLCS;
+
+ if (theGeomObj || aShape.IsNull()) {
+ MESSAGE("CORBA::is_nil(theGeomObj) || aShape.IsNull()")
+ }
+
+ aLCS.Transform(aShape.Location().Transformation());
+
+ if (aShape.ShapeType() == TopAbs_FACE) {
+ GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
+ myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId());
+ double Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz;
+
+ aMeasureOp->GetPosition(theGeomObj.get(), Ox, Oy, Oz, Zx, Zy, Zz, Xx, Xy, Xz);
+
+ if (aMeasureOp->IsDone()) {
+ gp_Pnt aPnt (Ox, Oy, Oz);
+ gp_Dir aDirN (Zx, Zy, Zz);
+ gp_Dir aDirX (Xx, Xy, Xz);
+ aLCS = gp_Ax3(aPnt, aDirN, aDirX);
+ }
+ }
+
+ return aLCS;
+}
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef ENTITYGUI_POLYLINEDLG_H
+#define ENTITYGUI_POLYLINEDLG_H
+
+
+#include <GEOMBase_Skeleton.h>
+
+class CurveCreator_Curve;
+class CurveCreator_Widget;
+class QGroupBox;
+class QComboBox;
+
+
+//=================================================================================
+// class : EntityGUI_PolylineDlg
+// purpose :
+//=================================================================================
+class EntityGUI_PolylineDlg : public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+
+ EntityGUI_PolylineDlg (GeometryGUI*, QWidget* = 0,
+ bool = false, Qt::WindowFlags = 0);
+
+ virtual ~EntityGUI_PolylineDlg();
+
+ void deleteSelected();
+ bool deleteEnabled();
+
+protected:
+
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute( ObjectList& );
+
+private:
+
+ void Init();
+ void Clear();
+ void enterEvent(QEvent *);
+
+ /**
+ * This method converts the curve into curve parameters required to
+ * construct an object using the interface
+ * GEOM_ICurvesOperations::MakePolyline2DOnPlane.
+ *
+ * \param theCurve a curve object, that contains data.
+ * \param theCoordsList the list of coordinates list. theCoordsList[0]
+ * is the coordinates list of the first section. theCoordsList[1]
+ * is for the second section etc. Output parameter.
+ * \param theNamesList the list of names. The order corresponds to
+ * theCoordsList. Output parameter.
+ * \param theTypesList the list of curve types. The order corresponds to
+ * theCoordsList. Output parameter.
+ * \param theClosedList the list of Closed flags. The order corresponds to
+ * theCoordsList. Output parameter.
+ */
+ void GetCurveParams(GEOM::ListOfListOfDouble &theCoords,
+ GEOM::string_array &theNames,
+ GEOM::short_array &theTypes,
+ GEOM::ListOfBool &theCloseds);
+
+ /**
+ * This method returns the current local coordinate system.
+ *
+ * \return local coordinate system.
+ */
+ gp_Ax3 GetActiveLocalCS();
+
+ /**
+ * This method returns the current working plane. Can be null.
+ *
+ * \return the current working plane.
+ */
+ GEOM::GeomObjPtr GetActiveWPlane();
+
+ /**
+ * This method add a local coordinate system of the selected object.
+ *
+ * \param theSelectedObject the selected object. It can be a planar face
+ * or an inported polyline.
+ * \param IsPlane true for planar face; false for imported polyline.
+ * \param theLCS the local coordinate system.
+ */
+ void AddLocalCS(GEOM::GeomObjPtr theSelectedObject,
+ const bool IsPlane,
+ const gp_Ax3 &theLCS);
+
+ /**
+ * This method converts the working plane object into
+ * the local coordinate system of the polyline.
+ *
+ * \param theGeomObj the working plane
+ * \return the local coordinate system
+ */
+ gp_Ax3 WPlaneToLCS(GEOM::GeomObjPtr theGeomObj);
+
+protected slots:
+
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ClickOnCancel();
+ void processStartedSubOperation( QWidget*, bool );
+ void processFinishedSubOperation( QWidget* );
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void ActivateThisDialog();
+ void onUpdatePreview();
+ void ActivateLocalCS();
+
+private:
+
+ CurveCreator_Curve *myCurve;
+ CurveCreator_Widget *myEditorWidget;
+ QGroupBox *myAddElementBox;
+ QComboBox *myPlnComboBox;
+ QPushButton *myPlnButton;
+ QPushButton *myPlnSelButton;
+ QPushButton *myPolylineSelButton;
+ QLineEdit *myWPlaneLineEdit;
+ QLineEdit *myPolylineEdit;
+ QLineEdit *myEditCurrentArgument; /* Current LineEdit */
+ QList<gp_Ax3> myLCSList;
+ QList<GEOM::GeomObjPtr> myWPlaneList;
+
+};
+
+#endif // ENTITYGUI_POLYLINEDLG_H
#include <SalomeApp_Study.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
SET(GEOM_HEADERS
GEOM_Application.hxx
- GEOM_Application.ixx
- GEOM_Application.jxx
- Handle_GEOM_Application.hxx
GEOM_Engine.hxx
GEOM_Function.hxx
GEOM_Object.hxx
GEOM_ISubShape.hxx
GEOM_Solver.hxx
GEOM_PythonDump.hxx
- GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx
- GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx
GEOM_DataMapOfAsciiStringTransient.hxx
- Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx
+ GEOM_BaseObject.hxx
)
# --- sources ---
GEOM_BaseDriver.cxx
GEOM_SubShapeDriver.cxx
GEOM_PythonDump.cxx
- GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_0.cxx
- GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient_0.cxx
- GEOM_DataMapOfAsciiStringTransient_0.cxx
)
# --- rules ---
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Standard_Stream.hxx>
-#include <GEOM_Application.ixx>
+#include <GEOM_Application.hxx>
+
+#include <TColStd_SequenceOfExtendedString.hxx>
+
+IMPLEMENT_STANDARD_HANDLE (GEOM_Application, TDocStd_Application)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_Application, TDocStd_Application)
//=======================================================================
//function : GEOM_Application
{
}
+//=======================================================================
+//function : ~GEOM_Application
+//purpose :
+//=======================================================================
+
+GEOM_Application::~GEOM_Application()
+{
+}
//=======================================================================
//function : Formats
{
return Standard_CString ("GEOMDS_Resources");
}
-
-
-
-
-
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File : GEOM_Application.hxx
-// Module : GEOM
-//
#ifndef _GEOM_Application_HeaderFile
#define _GEOM_Application_HeaderFile
-#ifndef _Standard_HeaderFile
+#include <TDocStd_Application.hxx>
#include <Standard.hxx>
-#endif
-#ifndef _Handle_GEOM_Application_HeaderFile
-#include <Handle_GEOM_Application.hxx>
-#endif
+#include <Standard_DefineHandle.hxx>
-#ifndef _TDocStd_Application_HeaderFile
-#include <TDocStd_Application.hxx>
-#endif
-#ifndef _Standard_CString_HeaderFile
-#include <Standard_CString.hxx>
-#endif
class TColStd_SequenceOfExtendedString;
-
-class GEOM_Application : public TDocStd_Application {
-
+class GEOM_Application : public TDocStd_Application
+{
public:
+ Standard_EXPORT GEOM_Application();
+ Standard_EXPORT ~GEOM_Application();
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- // Methods PUBLIC
- //
-Standard_EXPORT GEOM_Application();
-Standard_EXPORT virtual void Formats(TColStd_SequenceOfExtendedString& Formats) ;
-Standard_EXPORT Standard_CString ResourcesName() ;
-Standard_EXPORT ~GEOM_Application();
-
-
-
-
- // Type management
- //
- Standard_EXPORT friend Handle_Standard_Type& GEOM_Application_Type_();
- Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
-
-
-private:
-
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
-
+ Standard_EXPORT virtual void Formats(TColStd_SequenceOfExtendedString& Formats);
+ Standard_EXPORT Standard_CString ResourcesName();
+public:
+ DEFINE_STANDARD_RTTI(GEOM_Application);
};
-
-
-
-
-// other inline functions and methods (like "C++: function call" methods)
-//
-
+DEFINE_STANDARD_HANDLE(GEOM_Application, TDocStd_Application)
#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : GEOM_Application.ixx
-// Module : GEOM
-//
-#include "GEOM_Application.jxx"
-
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-GEOM_Application::~GEOM_Application() {}
-
-
-
-Standard_EXPORT Handle_Standard_Type& GEOM_Application_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(TDocStd_Application);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TDocStd_Application);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(CDF_Application);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(CDF_Application);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(CDM_Application);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(CDM_Application);
- static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
- if ( aType4.IsNull()) aType4 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_Application",
- sizeof(GEOM_Application),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-// DownCast method
-// allow safe downcasting
-
-
-const Handle(GEOM_Application) Handle(GEOM_Application)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_Application) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_Application))) {
- _anOtherObject = Handle(GEOM_Application)((Handle(GEOM_Application)&)AnObject);
- }
- }
-
- return _anOtherObject ;
-}
-
-
-const Handle(Standard_Type)& GEOM_Application::DynamicType() const
-{
- return STANDARD_TYPE(GEOM_Application) ;
-}
-Standard_Boolean GEOM_Application::IsKind(const Handle(Standard_Type)& AType) const
-{
- return (STANDARD_TYPE(GEOM_Application) == AType || TDocStd_Application::IsKind(AType));
-}
-Handle_GEOM_Application::~Handle_GEOM_Application() {}
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : GEOM_Application.jxx
-// Module : GEOM
-//
-#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
-#include <TColStd_SequenceOfExtendedString.hxx>
-#endif
-#ifndef _GEOM_Application_HeaderFile
-#include "GEOM_Application.hxx"
-#endif
#include "GEOM_Function.hxx"
#include "GEOM_Object.hxx"
+#include "GEOM_Engine.hxx"
#include <TColStd_HArray1OfInteger.hxx>
#include <TDataStd_Name.hxx>
+#include <TDocStd_Owner.hxx>
IMPLEMENT_STANDARD_HANDLE (GEOM_BaseDriver,TFunction_Driver);
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;
+}
//================================================================================
/*!
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
// this method in derived drivers)
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient_HeaderFile
-#define _GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient_HeaderFile
-
-#ifndef _TCollection_BasicMapIterator_HeaderFile
-#include <TCollection_BasicMapIterator.hxx>
-#endif
-#ifndef _Handle_Standard_Transient_HeaderFile
-#include <Handle_Standard_Transient.hxx>
-#endif
-#ifndef _Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#include <Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#endif
-class Standard_NoSuchObject;
-class TCollection_AsciiString;
-class Standard_Transient;
-class GEOM_DataMapOfAsciiStringTransient;
-class GEOM_DataMapNodeOfDataMapOfAsciiStringTransient;
-
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
-class GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient : public TCollection_BasicMapIterator {
-
-public:
-
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
- // Methods PUBLIC
- //
-Standard_EXPORT GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient();
-Standard_EXPORT GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient(const GEOM_DataMapOfAsciiStringTransient& aMap);
-Standard_EXPORT void Initialize(const GEOM_DataMapOfAsciiStringTransient& aMap) ;
-Standard_EXPORT const TCollection_AsciiString& Key() const;
-Standard_EXPORT const Handle_Standard_Transient& Value() const;
-
-
-
-
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
-
-
-private:
-
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
-
-
-};
-
-
-
-
-
-// other Inline functions and methods (like "C++: function call" methods)
-//
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-
-#ifndef _Standard_NoSuchObject_HeaderFile
-#include <Standard_NoSuchObject.hxx>
-#endif
-#ifndef _TCollection_AsciiString_HeaderFile
-#include <TCollection_AsciiString.hxx>
-#endif
-#ifndef _Standard_Transient_HeaderFile
-#include <Standard_Transient.hxx>
-#endif
-#ifndef _GEOM_DataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapOfAsciiStringTransient.hxx>
-#endif
-#ifndef _GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#endif
-
-
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define TheItem Handle_Standard_Transient
-#define TheItem_hxx <Standard_Transient.hxx>
-#define Hasher TCollection_AsciiString
-#define Hasher_hxx <TCollection_AsciiString.hxx>
-#define TCollection_DataMapNode GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_hxx <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#define TCollection_DataMapIterator GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapIterator_hxx <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#define Handle_TCollection_DataMapNode Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_Type_() GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_()
-#define TCollection_DataMap GEOM_DataMapOfAsciiStringTransient
-#define TCollection_DataMap_hxx <GEOM_DataMapOfAsciiStringTransient.hxx>
-#include <TCollection_DataMapIterator.gxx>
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#define _GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#include <Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#endif
-
-#ifndef _TCollection_AsciiString_HeaderFile
-#include <TCollection_AsciiString.hxx>
-#endif
-#ifndef _Handle_Standard_Transient_HeaderFile
-#include <Handle_Standard_Transient.hxx>
-#endif
-#ifndef _TCollection_MapNode_HeaderFile
-#include <TCollection_MapNode.hxx>
-#endif
-#ifndef _TCollection_MapNodePtr_HeaderFile
-#include <TCollection_MapNodePtr.hxx>
-#endif
-class Standard_Transient;
-class TCollection_AsciiString;
-class GEOM_DataMapOfAsciiStringTransient;
-class GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient;
-
-
-class GEOM_DataMapNodeOfDataMapOfAsciiStringTransient : public TCollection_MapNode {
-
-public:
-
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
- // Methods PUBLIC
- //
-GEOM_DataMapNodeOfDataMapOfAsciiStringTransient(const TCollection_AsciiString& K,const Handle(Standard_Transient)& I,const TCollection_MapNodePtr& n);
- TCollection_AsciiString& Key() const;
- Handle_Standard_Transient& Value() const;
-Standard_EXPORT ~GEOM_DataMapNodeOfDataMapOfAsciiStringTransient();
-
-
-
-
- // Type management
- //
- Standard_EXPORT friend Handle_Standard_Type& GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_();
- Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
-
-
-private:
-
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
-TCollection_AsciiString myKey;
-Handle_Standard_Transient myValue;
-
-
-};
-
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define TheItem Handle_Standard_Transient
-#define TheItem_hxx <Standard_Transient.hxx>
-#define Hasher TCollection_AsciiString
-#define Hasher_hxx <TCollection_AsciiString.hxx>
-#define TCollection_DataMapNode GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_hxx <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#define TCollection_DataMapIterator GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapIterator_hxx <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#define Handle_TCollection_DataMapNode Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_Type_() GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_()
-#define TCollection_DataMap GEOM_DataMapOfAsciiStringTransient
-#define TCollection_DataMap_hxx <GEOM_DataMapOfAsciiStringTransient.hxx>
-
-#include <TCollection_DataMapNode.lxx>
-
-#undef TheKey
-#undef TheKey_hxx
-#undef TheItem
-#undef TheItem_hxx
-#undef Hasher
-#undef Hasher_hxx
-#undef TCollection_DataMapNode
-#undef TCollection_DataMapNode_hxx
-#undef TCollection_DataMapIterator
-#undef TCollection_DataMapIterator_hxx
-#undef Handle_TCollection_DataMapNode
-#undef TCollection_DataMapNode_Type_
-#undef TCollection_DataMap
-#undef TCollection_DataMap_hxx
-
-
-// other Inline functions and methods (like "C++: function call" methods)
-//
-
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-#ifndef _Standard_Transient_HeaderFile
-#include <Standard_Transient.hxx>
-#endif
-#ifndef _TCollection_AsciiString_HeaderFile
-#include <TCollection_AsciiString.hxx>
-#endif
-#ifndef _GEOM_DataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapOfAsciiStringTransient.hxx>
-#endif
-#ifndef _GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#endif
-GEOM_DataMapNodeOfDataMapOfAsciiStringTransient::~GEOM_DataMapNodeOfDataMapOfAsciiStringTransient() {}
-
-
-
-Standard_EXPORT Handle_Standard_Type& GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TCollection_MapNode);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_DataMapNodeOfDataMapOfAsciiStringTransient",
- sizeof(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-
-// DownCast method
-// allow safe downcasting
-//
-const Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient))) {
- _anOtherObject = Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)((Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)&)AnObject);
- }
- }
-
- return _anOtherObject ;
-}
-const Handle(Standard_Type)& GEOM_DataMapNodeOfDataMapOfAsciiStringTransient::DynamicType() const
-{
- return STANDARD_TYPE(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) ;
-}
-Standard_Boolean GEOM_DataMapNodeOfDataMapOfAsciiStringTransient::IsKind(const Handle(Standard_Type)& AType) const
-{
- return (STANDARD_TYPE(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) == AType || TCollection_MapNode::IsKind(AType));
-}
-Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient::~Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient() {}
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define TheItem Handle_Standard_Transient
-#define TheItem_hxx <Standard_Transient.hxx>
-#define Hasher TCollection_AsciiString
-#define Hasher_hxx <TCollection_AsciiString.hxx>
-#define TCollection_DataMapNode GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_hxx <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#define TCollection_DataMapIterator GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapIterator_hxx <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#define Handle_TCollection_DataMapNode Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_Type_() GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_()
-#define TCollection_DataMap GEOM_DataMapOfAsciiStringTransient
-#define TCollection_DataMap_hxx <GEOM_DataMapOfAsciiStringTransient.hxx>
-#include <TCollection_DataMapNode.gxx>
-
#ifndef _GEOM_DataMapOfAsciiStringTransient_HeaderFile
#define _GEOM_DataMapOfAsciiStringTransient_HeaderFile
-#ifndef _TCollection_BasicMap_HeaderFile
-#include <TCollection_BasicMap.hxx>
-#endif
-#ifndef _Handle_Standard_Transient_HeaderFile
-#include <Handle_Standard_Transient.hxx>
-#endif
-#ifndef _Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#include <Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#endif
-#ifndef _Standard_Integer_HeaderFile
-#include <Standard_Integer.hxx>
-#endif
-#ifndef _Standard_Boolean_HeaderFile
-#include <Standard_Boolean.hxx>
-#endif
+#include <NCollection_DataMap.hxx>
+#include <Standard_Transient.hxx>
+#include <TCollection_AsciiString.hxx>
-class Standard_DomainError;
-class Standard_NoSuchObject;
-class TCollection_AsciiString;
-class Standard_Transient;
-class GEOM_DataMapNodeOfDataMapOfAsciiStringTransient;
-class GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient;
+typedef NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> GEOM_DataMapOfAsciiStringTransient;
+typedef GEOM_DataMapOfAsciiStringTransient::Iterator GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient;
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
-#include <Basics_OCCTVersion.hxx>
-
-class GEOM_DataMapOfAsciiStringTransient : public TCollection_BasicMap {
-
-public:
-
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-
- // Methods PUBLIC
- //
-Standard_EXPORT GEOM_DataMapOfAsciiStringTransient(const Standard_Integer NbBuckets = 1);
-Standard_EXPORT GEOM_DataMapOfAsciiStringTransient& Assign(const GEOM_DataMapOfAsciiStringTransient& Other) ;
- GEOM_DataMapOfAsciiStringTransient& operator =(const GEOM_DataMapOfAsciiStringTransient& Other)
-{
- return Assign(Other);
-}
-
-Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
-Standard_EXPORT void Clear() ;
-~GEOM_DataMapOfAsciiStringTransient()
-{
- Clear();
-}
-
-Standard_EXPORT Standard_Boolean Bind(const TCollection_AsciiString& K,const Handle(Standard_Transient)& I) ;
-Standard_EXPORT Standard_Boolean IsBound(const TCollection_AsciiString& K) const;
-Standard_EXPORT Standard_Boolean UnBind(const TCollection_AsciiString& K) ;
-Standard_EXPORT const Handle_Standard_Transient& Find(const TCollection_AsciiString& K) const;
- const Handle_Standard_Transient& operator()(const TCollection_AsciiString& K) const
-{
- return Find(K);
-}
-
-Standard_EXPORT Handle_Standard_Transient& ChangeFind(const TCollection_AsciiString& K) ;
- Handle_Standard_Transient& operator()(const TCollection_AsciiString& K)
-{
- return ChangeFind(K);
-}
-
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
- Standard_EXPORT Standard_Address Find1 (const TCollection_AsciiString& K) const;
- Standard_EXPORT Standard_Address ChangeFind1 (const TCollection_AsciiString& K);
-#endif
-
-private:
- // Methods PRIVATE
- //
-Standard_EXPORT GEOM_DataMapOfAsciiStringTransient(const GEOM_DataMapOfAsciiStringTransient& Other);
-};
-
-// other Inline functions and methods (like "C++: function call" methods)
-//
-
-#endif
+#endif // _GEOM_DataMapOfAsciiStringTransient_HeaderFile
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GEOM_DataMapOfAsciiStringTransient.hxx>
-
-#ifndef _Standard_DomainError_HeaderFile
-#include <Standard_DomainError.hxx>
-#endif
-#ifndef _Standard_NoSuchObject_HeaderFile
-#include <Standard_NoSuchObject.hxx>
-#endif
-#ifndef _TCollection_AsciiString_HeaderFile
-#include <TCollection_AsciiString.hxx>
-#endif
-#ifndef _Standard_Transient_HeaderFile
-#include <Standard_Transient.hxx>
-#endif
-#ifndef _GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#endif
-#ifndef _GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient_HeaderFile
-#include <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#endif
-
-
-#define TheKey TCollection_AsciiString
-#define TheKey_hxx <TCollection_AsciiString.hxx>
-#define TheItem Handle_Standard_Transient
-#define TheItem_hxx <Standard_Transient.hxx>
-#define Hasher TCollection_AsciiString
-#define Hasher_hxx <TCollection_AsciiString.hxx>
-#define TCollection_DataMapNode GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_hxx <GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx>
-#define TCollection_DataMapIterator GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapIterator_hxx <GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx>
-#define Handle_TCollection_DataMapNode Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient
-#define TCollection_DataMapNode_Type_() GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_Type_()
-#define TCollection_DataMap GEOM_DataMapOfAsciiStringTransient
-#define TCollection_DataMap_hxx <GEOM_DataMapOfAsciiStringTransient.hxx>
-#include <TCollection_DataMap.gxx>
-
#include "GEOM_Engine.hxx"
-#include "GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient.hxx"
#include "GEOM_Field.hxx"
#include "GEOM_Function.hxx"
#include "GEOM_ISubShape.hxx"
TFunction_DriverTable::Get()->AddDriver(GEOM_Object::GetSubShapeID(), new GEOM_SubShapeDriver());
_OCAFApp = new GEOM_Application();
- _UndoLimit = 10;
+ _UndoLimit = 0;
}
/*!
aSSI.SetIndices(theIndices);
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GEOM_Solver aSolver (GEOM_Engine::GetEngine());
if (!aSolver.ComputeFunction(aFunction)) {
MESSAGE("GEOM_Engine::AddSubShape Error: Can't build a sub shape");
#define TEXTURE_LABEL_DATA 5
int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight,
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
const Handle(TColStd_HArray1OfByte)& theTexture,
-#else
- const Handle(TDataStd_HArray1OfByte)& theTexture,
-#endif
const TCollection_AsciiString& theFileName)
{
Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
return aTextureID;
}
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID,
-#else
-Handle(TDataStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID,
-#endif
int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName)
{
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) anArray;
-#else
- Handle(TDataStd_HArray1OfByte) anArray;
-#endif
theWidth = theHeight = 0;
Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
}
}
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
static TCollection_AsciiString pack_data (const Handle(TColStd_HArray1OfByte)& aData)
-#else
-static TCollection_AsciiString pack_data (const Handle(TDataStd_HArray1OfByte)& aData)
-#endif
{
TCollection_AsciiString stream;
if (!aData.IsNull()) {
if (*it <= 0) continue;
Standard_Integer aWidth, aHeight;
TCollection_AsciiString aFileName;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture =
-#else
- Handle(TDataStd_HArray1OfByte) aTexture =
-#endif
engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName);
if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) {
TCollection_AsciiString aCommand = "\n\t";
#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_DataMapOfIntegerTransient.hxx>
-#else
-#include <Interface_DataMapOfIntegerTransient.hxx>
-#endif
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
#include <TDocStd_Document.hxx>
bool _unpublished;
};
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
class Handle_TColStd_HArray1OfByte;
-#else
-class Handle_TDataStd_HArray1OfByte;
-#endif
struct TVariable{
TCollection_AsciiString myVariable;
#include <TDF_Data.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_Reference.hxx>
+#include <TDataStd_BooleanArray.hxx>
+#include <TDataStd_ByteArray.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_Real.hxx>
if (!isResult) {
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GEOM_Solver aSolver(GEOM_Engine::GetEngine());
if (!aSolver.ComputeFunction(this)) {
MESSAGE("GEOM_Object::GetValue Error : Can't build a sub-shape");
return anIntegerArray->Array();
}
+//=============================================================================
+/*!
+ * SetByteArray
+ */
+//=============================================================================
+void GEOM_Function::SetByteArray (int thePosition,
+ const Handle(TColStd_HArray1OfByte)& theArray)
+{
+ _isDone = false;
+ if(thePosition <= 0) return;
+ TDF_Label anArgLabel = ARGUMENT(thePosition);
+ Handle(TDataStd_ByteArray) anAttr =
+ TDataStd_ByteArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
+ anAttr->ChangeArray(theArray);
+ _isDone = true;
+}
+
+//=============================================================================
+/*!
+ * GetByteArray
+ */
+//=============================================================================
+Handle(TColStd_HArray1OfByte) GEOM_Function::GetByteArray(int thePosition)
+{
+ _isDone = false;
+ if(thePosition <= 0) return 0;
+ Handle(TDataStd_ByteArray) aByteArray;
+ TDF_Label anArgLabel = ARGUMENT(thePosition);
+ if(!anArgLabel.FindAttribute(TDataStd_ByteArray::GetID(), aByteArray)) return 0;
+
+ _isDone = true;
+ return aByteArray->InternalArray();
+}
+
+//=============================================================================
+/*!
+ * SetBooleanArray
+ */
+//=============================================================================
+void GEOM_Function::SetBooleanArray (int thePosition,
+ const Handle(TColStd_HArray1OfByte)& theArray)
+{
+ _isDone = false;
+ if(thePosition <= 0) return;
+ TDF_Label anArgLabel = ARGUMENT(thePosition);
+ Handle(TDataStd_BooleanArray) anAttr =
+ TDataStd_BooleanArray::Set(anArgLabel, theArray->Lower(), theArray->Upper());
+ anAttr->SetInternalArray(theArray);
+ _isDone = true;
+}
+
+//=============================================================================
+/*!
+ * GetBooleanArray
+ */
+//=============================================================================
+Handle(TColStd_HArray1OfByte) GEOM_Function::GetBooleanArray(int thePosition)
+{
+ _isDone = false;
+ if(thePosition <= 0) return 0;
+ Handle(TDataStd_BooleanArray) aBooleanArray;
+ TDF_Label anArgLabel = ARGUMENT(thePosition);
+ if(!anArgLabel.FindAttribute(TDataStd_BooleanArray::GetID(), aBooleanArray)) return 0;
+
+ _isDone = true;
+ return aBooleanArray->InternalArray();
+}
+
//=============================================================================
/*!
* SetString
#include <TDataStd_ListOfExtendedString.hxx>
#include <TopoDS_Shape.hxx>
+class Handle_TColStd_HArray1OfByte;
class Handle_TColStd_HArray1OfReal;
class Handle_TColStd_HArray1OfInteger;
class Handle_TColStd_HSequenceOfTransient;
//Returns an integer array argument at position thePosition
Standard_EXPORT Handle(TColStd_HArray1OfInteger) GetIntegerArray(int thePosition);
+ //Sets a byte array argument at position thePosition
+ Standard_EXPORT void SetByteArray(int thePosition, const Handle(TColStd_HArray1OfByte)& theArray);
+
+ //Returns a byte array argument at position thePosition
+ Standard_EXPORT Handle(TColStd_HArray1OfByte) GetByteArray(int thePosition);
+
+ //Sets a boolean array argument at position thePosition
+ Standard_EXPORT void SetBooleanArray(int thePosition, const Handle(TColStd_HArray1OfByte)& theArray);
+
+ //Returns a boolean array argument at position thePosition
+ Standard_EXPORT Handle(TColStd_HArray1OfByte) GetBooleanArray(int thePosition);
+
//Sets a reference to other function argument at position thePosition
Standard_EXPORT void SetReference(int thePosition, Handle(GEOM_Function) theReference);
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : Handle_GEOM_Application.hxx
-// Module : GEOM
-//
-#ifndef _Handle_GEOM_Application_HeaderFile
-#define _Handle_GEOM_Application_HeaderFile
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Handle_TDocStd_Application_HeaderFile
-#include <Handle_TDocStd_Application.hxx>
-#endif
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(TDocStd_Application);
-class GEOM_Application;
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SimpleOCAF_Application);
-
-class Handle(GEOM_Application) : public Handle(TDocStd_Application) {
- public:
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- Handle(GEOM_Application)():Handle(TDocStd_Application)() {}
- Handle(GEOM_Application)(const Handle(GEOM_Application)& aHandle) : Handle(TDocStd_Application)(aHandle)
- {
- }
-
- Handle(GEOM_Application)(const GEOM_Application* anItem) : Handle(TDocStd_Application)((TDocStd_Application *)anItem)
- {
- }
-
- Handle(GEOM_Application)& operator=(const Handle(GEOM_Application)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOM_Application)& operator=(const GEOM_Application* anItem)
- {
- Assign((Standard_Transient *)anItem);
- return *this;
- }
-
- GEOM_Application* operator->()
- {
- return (GEOM_Application *)ControlAccess();
- }
-
- GEOM_Application* operator->() const
- {
- return (GEOM_Application *)ControlAccess();
- }
-
- Standard_EXPORT ~Handle(GEOM_Application)();
-
- Standard_EXPORT static const Handle(GEOM_Application) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient.hxx
-// Module : GEOM
-//
-#ifndef _Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-#define _Handle_GEOM_DataMapNodeOfDataMapOfAsciiStringTransient_HeaderFile
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Handle_TCollection_MapNode_HeaderFile
-#include <Handle_TCollection_MapNode.hxx>
-#endif
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(TCollection_MapNode);
-class GEOM_DataMapNodeOfDataMapOfAsciiStringTransient;
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient);
-
-class Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) : public Handle(TCollection_MapNode) {
- public:
- void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)():Handle(TCollection_MapNode)() {}
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)(const Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)& aHandle) : Handle(TCollection_MapNode)(aHandle)
- {
- }
-
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)(const GEOM_DataMapNodeOfDataMapOfAsciiStringTransient* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
- {
- }
-
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)& operator=(const Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)& operator=(const GEOM_DataMapNodeOfDataMapOfAsciiStringTransient* anItem)
- {
- Assign((Standard_Transient *)anItem);
- return *this;
- }
-
- GEOM_DataMapNodeOfDataMapOfAsciiStringTransient* operator->()
- {
- return (GEOM_DataMapNodeOfDataMapOfAsciiStringTransient *)ControlAccess();
- }
-
- GEOM_DataMapNodeOfDataMapOfAsciiStringTransient* operator->() const
- {
- return (GEOM_DataMapNodeOfDataMapOfAsciiStringTransient *)ControlAccess();
- }
-
- Standard_EXPORT ~Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient)();
-
- Standard_EXPORT static const Handle(GEOM_DataMapNodeOfDataMapOfAsciiStringTransient) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-#endif
#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
#include <Precision.hxx>
-#endif
#include <gp_Pnt.hxx>
//
// Argument 1
if (!myIsAnalytic) {
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
aMF.Init(mySurface, Standard_True, Precision::Confusion());
-#else
- aMF.Init(mySurface, Standard_True);
-#endif
aFErr=aMF.Error();
if (aFErr!=BRepLib_FaceDone) {
}
else if (aNbPB==1) {
const Handle(BOPDS_PaveBlock)& aPB=aLPB.First();
-#if OCC_VERSION_LARGE > 0x06060000 // Porting to OCCT higher 6.6.0 version
if (pDS->IsCommonBlock(aPB)) {
-#else
- if (aPB->IsCommonBlock()) {
-#endif
aState=TopAbs_ON;
}
else{
SET(GEOMBase_HEADERS
GEOMBase.h
GEOMBase_Skeleton.h
+ GEOMBase_DlgSkeleton.h
GEOMBase_Helper.h
GEOM_Operation.h
GEOM_GEOMBase.hxx
# header files / to be processed by moc
SET(_moc_HEADERS
GEOMBase_Skeleton.h
+ GEOMBase_DlgSkeleton.h
)
# --- sources ---
GEOMBase_Helper.cxx
GEOM_Operation.cxx
GEOM_GenericObjPtr.cxx
+ GEOMBase_DlgSkeleton.cxx
${_moc_SOURCES}
)
#include <SOCC_Prs.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
AIS_ListOfInteractive displayed;
ic->DisplayedObjects( displayed );
-#if OCC_VERSION_LARGE <= 0x06060000
- ic->ObjectsInCollector( displayed );
-#endif
AIS_ListIteratorOfListOfInteractive it( displayed );
while ( it.More() && shape.IsNull() ) {
if ( it.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File : GEOMBase_DlgSkeleton.cxx
+// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
+
+#include "GEOMBase_DlgSkeleton.h"
+
+//Qt includes
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QLabel>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QPushButton>
+
+
+/*!
+ Constructor.
+*/
+GEOMBase_DlgSkeleton::GEOMBase_DlgSkeleton( QWidget* parent, Qt::WindowFlags flags ) :
+ QWidget(parent,flags)
+{
+ init();
+}
+
+/*!
+ Destructor.
+*/
+GEOMBase_DlgSkeleton::~GEOMBase_DlgSkeleton( ) {
+
+}
+
+/*!
+ Initialize the widget
+*/
+void GEOMBase_DlgSkeleton::init( ) {
+ // Main layout
+ gridLayout = new QGridLayout(this);
+
+ //Constructors group
+ GroupConstructors = new QGroupBox(this);
+ GroupConstructors->setObjectName(QString::fromUtf8("GroupConstructors"));
+ QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ sizePolicy.setHorizontalStretch(0);
+ sizePolicy.setVerticalStretch(0);
+ sizePolicy.setHeightForWidth(GroupConstructors->sizePolicy().hasHeightForWidth());
+ GroupConstructors->setSizePolicy(sizePolicy);
+ hboxLayout = new QHBoxLayout(GroupConstructors);
+
+ RadioButton1 = new QRadioButton(GroupConstructors);
+ hboxLayout->addWidget(RadioButton1);
+
+ RadioButton2 = new QRadioButton(GroupConstructors);
+ hboxLayout->addWidget(RadioButton2);
+
+ RadioButton3 = new QRadioButton(GroupConstructors);
+ hboxLayout->addWidget(RadioButton3);
+
+ RadioButton4 = new QRadioButton(GroupConstructors);
+ hboxLayout->addWidget(RadioButton4);
+
+ RadioButton5 = new QRadioButton(GroupConstructors);
+ hboxLayout->addWidget(RadioButton5);
+ gridLayout->addWidget(GroupConstructors, 0, 0, 1, 1);
+
+ //Name group
+ GroupBoxName = new QGroupBox(this);
+ sizePolicy.setHeightForWidth(GroupBoxName->sizePolicy().hasHeightForWidth());
+ GroupBoxName->setSizePolicy(sizePolicy);
+ hboxLayout1 = new QHBoxLayout(GroupBoxName);
+ hboxLayout1->setContentsMargins(9, 9, 9, 9);
+
+ NameLabel = new QLabel(GroupBoxName);
+ NameLabel->setWordWrap(false);
+ hboxLayout1->addWidget(NameLabel);
+
+ ResultName = new QLineEdit(GroupBoxName);
+ hboxLayout1->addWidget(ResultName);
+ gridLayout->addWidget(GroupBoxName, 1, 0, 1, 1);
+
+ //Group box with the check-boxes
+ GroupMedium = new QWidget(this);
+ QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(0);
+ sizePolicy1.setHeightForWidth(GroupMedium->sizePolicy().hasHeightForWidth());
+ GroupMedium->setSizePolicy(sizePolicy1);
+
+ gridLayout->addWidget(GroupMedium, 2, 0, 1, 1);
+ GroupBoxPublish = new QGroupBox(this);
+ vboxLayout = new QVBoxLayout(GroupBoxPublish);
+
+ CheckBoxRestoreSS = new QCheckBox(GroupBoxPublish);
+ vboxLayout->addWidget(CheckBoxRestoreSS);
+
+ CheckBoxAddPrefix = new QCheckBox(GroupBoxPublish);
+ vboxLayout->addWidget(CheckBoxAddPrefix);
+
+ CheckBoxPreview = new QCheckBox(GroupBoxPublish);
+ vboxLayout->addWidget(CheckBoxPreview);
+ gridLayout->addWidget(GroupBoxPublish, 3, 0, 1, 1);
+
+ //Group with buttons
+ GroupButtons = new QGroupBox(this);
+
+ QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ sizePolicy2.setHorizontalStretch(0);
+ sizePolicy2.setVerticalStretch(0);
+ sizePolicy2.setHeightForWidth(GroupButtons->sizePolicy().hasHeightForWidth());
+ GroupButtons->setSizePolicy(sizePolicy2);
+
+ hboxLayout2 = new QHBoxLayout(GroupButtons);
+ hboxLayout2->setContentsMargins(9, 9, 9, 9);
+ buttonOk = new QPushButton(GroupButtons);
+ hboxLayout2->addWidget(buttonOk);
+
+ buttonApply = new QPushButton(GroupButtons);
+ hboxLayout2->addWidget(buttonApply);
+
+ QSpacerItem* spacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ hboxLayout2->addItem(spacerItem);
+
+ buttonCancel = new QPushButton(GroupButtons);
+ hboxLayout2->addWidget(buttonCancel);
+
+ buttonHelp = new QPushButton(GroupButtons);
+
+ hboxLayout2->addWidget(buttonHelp);
+
+ gridLayout->addWidget(GroupButtons, 4, 0, 1, 1);
+
+ setTabOrder(CheckBoxRestoreSS, CheckBoxAddPrefix);
+ setTabOrder(CheckBoxAddPrefix, CheckBoxPreview);
+ setTabOrder(CheckBoxPreview, buttonOk);
+ setTabOrder(buttonOk, buttonApply);
+ setTabOrder(buttonApply, buttonCancel);
+ setTabOrder(buttonCancel, buttonHelp);
+ setTabOrder(buttonHelp, RadioButton1);
+ setTabOrder(RadioButton1, RadioButton2);
+ setTabOrder(RadioButton2, RadioButton3);
+ setTabOrder(RadioButton3, RadioButton4);
+ setTabOrder(RadioButton4, RadioButton5);
+ setTabOrder(RadioButton5, ResultName);
+
+ buttonOk->setText(tr("A&pply and Close"));
+ buttonApply->setText("&Apply");
+ buttonCancel->setText("&Close");
+ buttonHelp->setText("&Help");
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File : GEOMBase_DlgSkeleton.h
+// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
+
+#ifndef GEOMBASE_DLGSKELETON_N
+#define GEOMBASE_DLGSKELETON_N
+
+#include <QWidget>
+#include "GEOM_GEOMBase.hxx"
+
+class QGridLayout;
+class QGroupBox;
+class QHBoxLayout;
+class QVBoxLayout;
+class QRadioButton;
+class QLabel;
+class QLineEdit;
+class QCheckBox;
+class QPushButton;
+
+class GEOMBASE_EXPORT GEOMBase_DlgSkeleton : public QWidget
+{
+ Q_OBJECT
+ public:
+ GEOMBase_DlgSkeleton( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~GEOMBase_DlgSkeleton();
+ private:
+ void init();
+ public:
+ QGridLayout *gridLayout;
+ QGroupBox *GroupConstructors;
+ QHBoxLayout *hboxLayout;
+ QRadioButton *RadioButton1;
+ QRadioButton *RadioButton2;
+ QRadioButton *RadioButton3;
+ QRadioButton *RadioButton4;
+ QRadioButton *RadioButton5;
+ QGroupBox *GroupBoxName;
+ QHBoxLayout *hboxLayout1;
+ QLabel *NameLabel;
+ QLineEdit *ResultName;
+ QWidget *GroupMedium;
+ QGroupBox *GroupBoxPublish;
+ QVBoxLayout *vboxLayout;
+ QCheckBox *CheckBoxRestoreSS;
+ QCheckBox *CheckBoxAddPrefix;
+ QCheckBox *CheckBoxPreview;
+ QGroupBox *GroupButtons;
+ QHBoxLayout *hboxLayout2;
+ QPushButton *buttonOk;
+ QPushButton *buttonApply;
+ QPushButton *buttonCancel;
+ QPushButton *buttonHelp;
+};
+
+#endif //GEOMBASE_DLGSKELETON_N
#include <LightApp_SelectionMgr.h>
#include <LightApp_DataOwner.h>
#include <SalomeApp_Tools.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SALOME_Prs.h>
SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
if (aView)
- aView->Display( prs );
+ aView->Display( getDisplayer(), prs );
}
// Add prs to the preview list
// check view frame where the preview was displayed
bool vfOK = checkViewWindow() && myViewWindow;
// Iterate through presentations and delete them
- for ( PrsList::iterator anIter = myPreview.begin(); anIter != myPreview.end(); ++anIter ) {
+ for ( PrsList::iterator anIter = myPreview.begin(); anIter != myPreview.end(); ++anIter )
+ {
if ( vfOK )
+ {
+ SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
+ if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
+ aViewManager->getType() == SVTK_Viewer::Type() )
{
- SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
- if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
- aViewManager->getType() == SVTK_Viewer::Type() )
- {
- SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
- SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
- if (aView)
- aView->Erase( *anIter, true );
- }
+ SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
+ SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
+ if (aView)
+ aView->Erase( getDisplayer(), *anIter, true );
}
+ }
delete *anIter;
}
myPreview.clear();
// Author : Damien COQUERET, Open CASCADE S.A.S.
#include "GEOMBase_Skeleton.h"
+#include "GEOMBase_DlgSkeleton.h"
#include "GEOMBase.h"
#include <DlgRef.h>
setModal( modal );
- myMainFrame = new DlgRef_Skeleton( this );
+ myMainFrame = new GEOMBase_DlgSkeleton( this );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 0 ); topLayout->setSpacing( 0 );
topLayout->addWidget( myMainFrame );
void GEOMBase_Skeleton::ClickOnHelp()
{
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
+
+ QString context;
+ if(myHelpContext.isEmpty()) {
+ context = myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString("");
+ } else {
+ context = myHelpContext;
+ }
if ( app )
- app->onHelpContextModule( myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString(""), myHelpFileName );
+ app->onHelpContextModule( context , myHelpFileName );
else {
QString platform;
#ifdef WIN32
myHelpFileName = theName;
}
-DlgRef_Skeleton* GEOMBase_Skeleton::mainFrame()
+GEOMBase_DlgSkeleton* GEOMBase_Skeleton::mainFrame()
{
return myMainFrame;
}
#define GEOMBASE_SKELETON_H
#include "GEOM_GEOMBase.hxx"
+#include "GEOMBase_DlgSkeleton.h"
#include "GEOMBase_Helper.h"
#include <QDialog>
class SalomeApp_DoubleSpinBox;
class GeometryGUI;
-class DlgRef_Skeleton;
+class GEOMBase_DlgSkeleton;
class QSpinBox;
class QDoubleSpinBox;
class QLineEdit;
void setHelpFileName( const QString& );
- DlgRef_Skeleton* mainFrame();
+ GEOMBase_DlgSkeleton* mainFrame();
QWidget* centralWidget();
QPushButton* buttonCancel() const;
QPushButton* buttonOk() const;
QString myHelpFileName; //!< Associated HTML help file name
QButtonGroup* myRBGroup; //!< radio button group
- DlgRef_Skeleton* myMainFrame; //!< dialog box's mainframe widgetx
+ GEOMBase_DlgSkeleton* myMainFrame; //!< dialog box's mainframe widget
+ QString myHelpContext; //!< Help context, needed for the customization
+ //!< path where located plugins help HTML pages
protected slots:
virtual void ClickOnCancel();
void LineEditReturnPressed();
void DeactivateActiveDialog();
void ActivateThisDialog();
- void ClickOnHelp();
+ virtual void ClickOnHelp();
signals:
void constructorsClicked( int );
typedef GenericObjPtr<GEOM::GEOM_IInsertOperations> InsertOpPtr;
typedef GenericObjPtr<GEOM::GEOM_IMeasureOperations> MeasureOpPtr;
typedef GenericObjPtr<GEOM::GEOM_IGroupOperations> GroupOpPtr;
- typedef GenericObjPtr<GEOM::GEOM_IAdvancedOperations> AdvancedOpPtr;
template<> bool GEOMBASE_EXPORT GenericObjPtr<GEOM::GEOM_Object>::isSame( GEOM::GEOM_Object_ptr theLeft, GEOM::GEOM_Object_ptr theRight );
}
${KERNEL_SalomeDS}
${KERNEL_SalomeDSClient}
${GUI_SalomeApp}
- ${QT_QTXML_LIBRARY}
)
# --- headers ---
GeometryGUI_Operations.h
GEOMGUI.h
GEOMPluginGUI.h
- GEOMGUI_XmlHandler.h
GEOM_Displayer.h
GEOMGUI_OCCSelector.h
GEOMGUI_Selection.h
GeometryGUI.cxx
GEOMGUI.cxx
GEOMPluginGUI.cxx
- GEOMGUI_XmlHandler.cxx
GEOM_Displayer.cxx
GEOMGUI_OCCSelector.cxx
GEOMGUI_Selection.cxx
GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
//:QWidget( app->desktop() )
{
- setWindowTitle(tr("CREATION_INFO_TITLE"));
+ setWindowTitle( tr( "CREATION_INFO_TITLE" ) );
+ setObjectName( "geomCreationInformation" );
QFrame* frame = new QFrame( this );
{
myIconLbl->setPixmap( icon );
myOperaionLnEd->setText( name );
- myParamsTreeWd->clear();
if ( name.isEmpty() )
myOperaionLnEd->setText( tr("NO_INFO"));
v = isAutoColor( idx );
else if ( p == "isVectorsMode" )
v = isVectorsMode( idx );
+ else if ( p == "isVerticesMode" )
+ v = isVerticesMode( idx );
else if ( p == "topLevel" )
v = topLevel( idx );
else if ( p == "autoBringToFront" )
bool GEOMGUI_Selection::autoBringToFront( const int /*index*/ ) const
{
- return SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front" );
+ return SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front", "false" );
}
bool GEOMGUI_Selection::isVectorsMode( const int index ) const
return res;
}
+bool GEOMGUI_Selection::isVerticesMode( const int index ) const
+{
+#ifdef USE_VISUAL_PROP_MAP
+ QVariant v = visibleProperty( entry( index ), GEOM::propertyName( GEOM::Vertices ) );
+ if ( v.canConvert( QVariant::Bool ) )
+ return v.toBool();
+#endif
+
+ bool res = false;
+
+ SALOME_View* view = GEOM_Displayer::GetActiveView();
+ QString viewType = activeViewType();
+ if ( view && ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ if ( prs ) {
+ if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
+ SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+ AIS_ListOfInteractive lst;
+ occPrs->GetObjects( lst );
+ if ( lst.Extent() ) {
+ Handle(AIS_InteractiveObject) io = lst.First();
+ if ( !io.IsNull() ) {
+ Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
+ if ( !aSh.IsNull() )
+ res = aSh->isShowVertices();
+ }
+ }
+ }
+ else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+ vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+ if ( lst ) {
+ lst->InitTraversal();
+ vtkActor* actor = lst->GetNextActor();
+ if ( actor ) {
+ GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
+ if ( aGeomActor )
+ res = aGeomActor->GetVerticesMode();
+ }
+ }
+ }
+ }
+ }
+
+ return res;
+}
+
bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj )
{
if ( obj ) {
GEOM_Actor* aGeomGActor = GEOM_Actor::SafeDownCast( actor );
if ( aGeomGActor ) {
GEOM_VTKPropertyMaterial* mat = GEOM_VTKPropertyMaterial::SafeDownCast(aGeomGActor->GetProperty());
- res = mat->GetPhysical();
+ if ( mat )
+ res = mat->GetPhysical();
} // if ( salome actor )
} // if ( actor )
} // if ( lst == vtkPrs->GetObjects() )
QString displayMode( const int ) const;
QString selectionMode() const;
bool isVectorsMode( const int ) const;
+ bool isVerticesMode( const int ) const;
bool hasChildren( const int ) const;
int nbChildren( const int ) const;
bool hasConcealedChildren( const int ) const;
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM GEOMGUI : reading of xml file with list of available plugin actions
-// File : GEOMGUI_XmlHandler.cxx
-// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-
-#include "GEOMGUI_XmlHandler.h"
-
-#include "GEOMGUI.h"
-
-// SALOME KERNEL includes
-#include <utilities.h>
-
-/*!
- * Constructor
- */
-GEOMGUI_XmlHandler::GEOMGUI_XmlHandler()
-{
-}
-
-/*!
- * Destructor
- */
-GEOMGUI_XmlHandler::~GEOMGUI_XmlHandler()
-{
-}
-
-/*!
- * Starts parsing of document. Does some initialization
- *
- * Reimplemented from QXmlDefaultHandler.
- */
-bool GEOMGUI_XmlHandler::startDocument()
-{
- myErrorProt = "";
- return true;
-}
-
-/*!
- * Does different actions depending on the name of the tag and the
- * state you are in document.
- *
- * Reimplemented from QXmlDefaultHandler.
- */
-bool GEOMGUI_XmlHandler::startElement (const QString&, const QString&,
- const QString& qName,
- const QXmlAttributes& atts)
-{
- if (qName == "geom-plugins") { // set of plugins
- //myHypothesesMap.clear();
- //myAlgorithmsMap.clear();
- }
- else if (qName == "geom-plugin") { // group of actions
- myPluginData.myName = atts.value("name");
- myPluginData.myServerLib = atts.value("server-lib");
- myPluginData.myClientLib = atts.value("gui-lib");
-
- //QString aResName = atts.value("resources");
- //if (aResName != "") {
- // SUIT_ResourceMgr* resMgr = GEOMGUI::resourceMgr();
- // QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
- // resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
- // resMgr->loadTranslator( "resources", QString( "%1_images.qm" ).arg( aResName, lang ) );
- //}
- }
- else if (qName == "actions") { // group of actions
- }
- else if (qName == "action") { // an action
- GEOMGUI_ActionData aData;
- aData.myLabel = atts.value("label");
- aData.myIcon = atts.value("icon");
- aData.myMenu = atts.value("menu");
- aData.myTooltip = atts.value("tooltip");
- aData.myStatusBar = atts.value("status-bar");
-
- myPluginData.myListOfActions.append(aData);
- }
- else {
- // error
- return false;
- }
- return true;
-}
-
-/*!
- * Reimplemented from QXmlDefaultHandler.
- */
-bool GEOMGUI_XmlHandler::endElement (const QString&, const QString&, const QString&)
-{
- return true;
-}
-
-/*!
- * Reimplemented from QXmlDefaultHandler.
- */
-bool GEOMGUI_XmlHandler::characters (const QString& ch)
-{
- // we are not interested in whitespaces
- //QString ch_simplified = ch.simplified();
- //if ( ch_simplified.isEmpty() )
- // return true;
- return true;
-}
-
-/*!
- * Returns the default error string.
- *
- * Reimplemented from QXmlDefaultHandler.
- */
-QString GEOMGUI_XmlHandler::errorString()
-{
- return "the document is not in the quote file format";
-}
-
-/*!
- * Returns the error protocol if parsing failed
- *
- * Reimplemented from QXmlDefaultHandler.
- */
-QString GEOMGUI_XmlHandler::errorProtocol()
-{
- return myErrorProt;
-}
-
-/*!
- * Returns exception
- *
- * Reimplemented from QXmlDefaultHandler.
- */
-bool GEOMGUI_XmlHandler::fatalError (const QXmlParseException& exception)
-{
- myErrorProt += QString("fatal parsing error: %1 in line %2, column %3\n")
- .arg(exception.message())
- .arg(exception.lineNumber())
- .arg(exception.columnNumber());
-
- return QXmlDefaultHandler::fatalError( exception );
-}
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM GEOMGUI : reading of xml file with list of available plugin actions
-// File : GEOMGUI_XmlHandler.h
-// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-
-#ifndef GEOMGUI_XMLHANDLER_H
-#define GEOMGUI_XMLHANDLER_H
-
-// GEOM includes
-#include "GEOMGUI.h"
-
-// Qt includes
-#include <QXmlDefaultHandler>
-#include <QMap>
-#include <QList>
-
-//GUI includes
-#include <QtxMap.h>
-
-//class HypothesisData;
-//class HypothesesSet;
-
-struct GEOMGUI_ActionData
-{
- QString myLabel; // unique ID
- QString myIcon;
- QString myMenu;
- QString myTooltip;
- QString myStatusBar;
-
- //int myAccel;
- //bool myToggle;
- //QString myShortcut;
-};
-
-struct GEOMGUI_PluginData
-{
- QString myName;
- QString myServerLib;
- QString myClientLib;
-
- //QList<GEOMGUI_ActionData*> myListOfActions;
- QList<GEOMGUI_ActionData> myListOfActions;
-};
-
-class GEOMGUI_EXPORT GEOMGUI_XmlHandler : public QXmlDefaultHandler
-{
-public:
- GEOMGUI_XmlHandler();
- virtual ~GEOMGUI_XmlHandler();
-
- bool startDocument();
- bool startElement( const QString&, const QString&,
- const QString&, const QXmlAttributes& );
- bool endElement( const QString&, const QString&, const QString& );
- bool characters( const QString& );
-
- QString errorString();
- QString errorProtocol();
- bool fatalError( const QXmlParseException& );
-
-public:
- GEOMGUI_PluginData myPluginData;
-
-private:
- QString myErrorProt;
-};
-
-#endif // GEOMGUI_XMLHANDLER_H
#include <SalomeApp_TypeFilter.h>
#include <SalomeApp_Tools.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
#include <SALOME_Prs.h>
#include <OCCViewer_ViewWindow.h>
#include <OCCViewer_ViewPort3d.h>
+#include <OCCViewer_Utilities.h>
// OCCT Includes
#include <AIS_Drawer.hxx>
#include <GEOMImpl_Types.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
-#else
-#include <Graphic3d_HArray1OfBytes.hxx>
-#endif
// If the next macro is defined, autocolor feature works for all sub-shapes;
// if it is undefined, autocolor feature works for groups only
// Hard-coded value of shape deflection coefficient for VTK viewer
const double VTK_MIN_DEFLECTION = 0.001;
-#if OCC_VERSION_LARGE > 0x06070000
// Pixmap caching support
namespace
{
return aMap;
}
- //===========================================================================
- // Function : imageToPixmap
- // Purpose : Concert QImage to OCCT pixmap
- //===========================================================================
- static inline Handle(Image_PixMap) imageToPixmap( const QImage& anImage )
- {
- Handle(Image_PixMap) aPixmap = new Image_PixMap();
- if ( !anImage.isNull() ) {
- aPixmap->InitTrash( Image_PixMap::ImgBGRA, anImage.width(), anImage.height() );
- aPixmap->SetTopDown( Standard_True );
-
- const uchar* aImageBytes = anImage.bits();
-
- for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) {
-#if OCC_VERSION_LARGE > 0x06070100
- // convert pixels from ARGB to renderer-compatible RGBA
- for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
- Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue<Image_ColorBGRA>(aLine, aByte);
-
- aPixmapBytes.b() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes.g() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes.r() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes.a() = (Standard_Byte) *aImageBytes++;
- }
-#else
- Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
-
- // convert pixels from ARGB to renderer-compatible RGBA
- for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
- aPixmapBytes->b() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->g() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->r() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes->a() = (Standard_Byte) *aImageBytes++;
- aPixmapBytes++;
- }
-#endif
- }
- }
- return aPixmap;
- }
-
//===========================================================================
// Function : getDefaultTexture
// Purpose : Get default texture
if ( aPixmap.IsNull() ) {
QPixmap px(":images/default_texture.png");
if ( !px.isNull() )
- aPixmap = imageToPixmap( px.toImage() );
+ aPixmap = OCCViewer_Utilities::imageToPixmap( px.toImage() );
}
return aPixmap;
}
if ( anImage.isNull() )
return NULL;
- aPixmap = imageToPixmap( anImage );
+ aPixmap = OCCViewer_Utilities::imageToPixmap( anImage );
aPixmapCacheMap.insert( thePath, aPixmap );
if ( aAISShape.IsNull() )
continue;
+#ifdef USE_TEXTURED_SHAPE
const Handle(Image_PixMap)& aPixmap = aAISShape->TexturePixMap();
if ( aPixmap.IsNull() )
continue;
aPixmapUsersMap.UnBind( aPixmap );
aPixmapCacheMap.remove( aPixmapCacheMap.key( aPixmap ) );
}
+#endif
}
}
}
-#endif
//================================================================
// Function : getActiveStudy
int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
myWidth = resMgr->integerValue("Geometry", "edge_width", -1);
myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1);
+
+ myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
+ myHasTransparency = false;
myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
myWidth = -1;
myType = -1;
- myTransparency = -1.0;
myToActivate = true;
// This parameter is used for activisation/deactivisation of objects to be displayed
- #if OCC_VERSION_LARGE > 0x06050100 // Functionnality available only in OCCT 6.5.2
// Activate parallel vizualisation only for testing purpose
// and if the corresponding env variable is set to 1
char* parallel_visu = getenv("PARALLEL_VISU");
MESSAGE("Parallel visualisation on");
BRepMesh_IncrementalMesh::SetParallelDefault(Standard_True);
}
- #endif
myViewFrame = 0;
if ( prs )
{
vf->BeforeDisplay( this, prs );
- vf->Display( prs );
+ vf->Display( this, prs );
vf->AfterDisplay( this, prs );
if ( updateViewer )
vf->Repaint();
- int aMgrId = getViewManagerId(vf);
- SalomeApp_Study* aStudy = getStudy();
- aStudy->setObjectProperty(aMgrId, theIO->getEntry(), GEOM::propertyName( GEOM::Visibility ), 1 );
-
- setVisibilityState(theIO->getEntry(), Qtx::ShownState);
-
delete prs; // delete presentation because displayer is its owner
}
}
SALOME_Prs* prs = vf->CreatePrs( theIO->getEntry() );
if ( prs ) {
vf->BeforeErase( this, prs );
- vf->Erase( prs, forced );
+ vf->Erase( this, prs, forced );
vf->AfterErase( this, prs );
if ( updateViewer )
vf->Repaint();
delete prs; // delete presentation because displayer is its owner
-
- int aMgrId = getViewManagerId(vf);
- SalomeApp_Study* aStudy = getStudy();
- aStudy->setObjectProperty(aMgrId, theIO->getEntry(), GEOM::propertyName( GEOM::Visibility ), 0 );
-
- setVisibilityState(theIO->getEntry(), Qtx::HiddenState);
}
}
}
UpdateViewer();
}
+void GEOM_Displayer::UpdateVisibility( SALOME_View* v, const SALOME_Prs* p, bool on )
+{
+ SalomeApp_Study* aStudy = getStudy();
+ int vId = -1;
+ if ( v ) vId = getViewManagerId( v );
+
+ if ( p ) {
+ QString entry = p->GetEntry();
+ if ( !entry.isEmpty() ) {
+ if ( vId != -1 )
+ aStudy->setObjectProperty( vId, entry, GEOM::propertyName( GEOM::Visibility ), on );
+ setVisibilityState( entry, on ? Qtx::ShownState : Qtx::HiddenState );
+ }
+ }
+ else {
+ if ( vId != -1 ) {
+ aStudy->setObjectProperty( vId, GEOM::propertyName( GEOM::Visibility ), on );
+ }
+ }
+}
+
Quantity_Color GEOM_Displayer::qColorFromResources( const QString& property, const QColor& defColor )
{
// VSR: this method can be improved in future:
// - color for edges in shading+edges mode
AISShape->SetEdgesInShadingColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
-
- // ???
- AISShape->storeBoundaryColors();
// set display mode
AISShape->SetDisplayMode( HasDisplayMode() ?
// display mode from properties
propMap.value( GEOM::propertyName( GEOM::DisplayMode ) ).toInt() );
+ // - face boundaries color
+ if( AISShape->DisplayMode() == GEOM_AISShape::ShadingWithEdges )
+ AISShape->Attributes()->SetFaceBoundaryDraw( Standard_True );
+ anAspect = AISShape->Attributes()->FaceBoundaryAspect();
+ anAspect->SetColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
+ AISShape->Attributes()->SetFaceBoundaryAspect( anAspect );
+
// set display vectors flag
AISShape->SetDisplayVectors( propMap.value( GEOM::propertyName( GEOM::EdgesDirection ) ).toBool() );
+ // set display vertices flag
+ bool isVerticesMode = propMap.value( GEOM::propertyName( GEOM::Vertices ) ).toBool();
+ AISShape->SetDisplayVertices( isVerticesMode );
+
// set transparency
if( HasTransparency() ) {
AISShape->SetTransparency( GetTransparency() );
aImagePath = propMap.value( GEOM::propertyName( GEOM::Texture ) ).toString();
}
-#if OCC_VERSION_LARGE > 0x06070000
+#ifdef USE_TEXTURED_SHAPE
Handle(Image_PixMap) aPixmap;
if ( !aImagePath.isEmpty() )
aPixmap = cacheTextureFor( aImagePath, AISShape );
else {
AISShape->SetTextureMapOff();
}
-#else
- if ( !aImagePath.isEmpty() ) {
- AISShape->SetTextureFileName( TCollection_AsciiString( aImagePath.toUtf8().constData() ) );
- AISShape->SetTextureMapOn();
- AISShape->DisableTextureModulate();
- }
#endif
// set line width
AISShape->setTopLevel( propMap.value( GEOM::propertyName( GEOM::TopLevel ) ).toBool() );
// set point marker (for vertex / compound of vertices only)
- if ( onlyVertex ) {
+ if ( onlyVertex || isVerticesMode ) {
QStringList aList = propMap.value( GEOM::propertyName( GEOM::PointMarker ) ).toString().split( GEOM::subSectionSeparator() );
if ( aList.size() == 2 ) {
// standard marker string contains "TypeOfMarker:ScaleOfMarker"
// custom marker string contains "IdOfTexture"
int textureId = aList[0].toInt();
Standard_Integer aWidth, aHeight;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture =
-#else
- Handle(Graphic3d_HArray1OfBytes) aTexture =
-#endif
GeometryGUI::getTexture( study, textureId, aWidth, aHeight );
if ( !aTexture.IsNull() ) {
-#if OCC_VERSION_LARGE > 0x06060000 // Porting to OCCT higher 6.6.0 version
Handle(Prs3d_PointAspect) aTextureAspect =
new Prs3d_PointAspect( HasColor() ?
// predefined color, manually set to displayer via GEOM_Displayer::SetColor() function
SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::PointColor ) ).value<QColor>() ),
aWidth, aHeight,
aTexture );
-#else
- int TextureId = 0;
- Handle(Prs3d_PointAspect) aTextureAspect =
- new Prs3d_PointAspect( HasColor() ?
- // predefined color, manually set to displayer via GEOM_Displayer::SetColor() function
- (Quantity_NameOfColor)GetColor() :
- // color from properties
- SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::PointColor ) ).value<QColor>() ),
- ++TextureId,
- aWidth, aHeight,
- aTexture );
-#endif
AISShape->Attributes()->SetPointAspect( aTextureAspect );
}
}
if ( create && !isTemporary && aMgrId != -1 ) {
// set properties to the study
- study->setObjectPropMap( aMgrId, entry, propMap );
+ study->setObjectProperties( aMgrId, entry, propMap );
}
// AISShape->SetName(???); ??? necessary to set name ???
// set display vectors flag
actor->SetVectorMode( propMap.value( GEOM::propertyName( GEOM::EdgesDirection ) ).toBool() );
+ // set display vertices flag
+ actor->SetVerticesMode( propMap.value( GEOM::propertyName( GEOM::Vertices ) ).toBool() );
+
// set display mode
int displayMode = HasDisplayMode() ?
// predefined display mode, manually set to displayer via GEOM_Displayer::SetDisplayMode() function
if ( create && !isTemporary && aMgrId != -1 ) {
// set properties to the study
- study->setObjectPropMap( aMgrId, entry, propMap );
+ study->setObjectProperties( aMgrId, entry, propMap );
}
}
UpdateColorScale(false,false);
}
-#if OCC_VERSION_LARGE > 0x06070000
void GEOM_Displayer::BeforeErase( SALOME_View* v, const SALOME_OCCPrs* p )
{
LightApp_Displayer::BeforeErase( v, p );
releaseTextures( p );
}
-#endif
void GEOM_Displayer::AfterErase( SALOME_View* v, const SALOME_OCCPrs* p )
{
* Set transparency for shape displaying.
*/
//=================================================================
-void GEOM_Displayer::SetTransparency( const double transparency )
+double GEOM_Displayer::SetTransparency( const double transparency )
{
- myTransparency = transparency;
+ double aPrevTransparency = myTransparency;
+ if ( transparency < 0 ) {
+ UnsetTransparency();
+ }
+ else {
+ myTransparency = transparency;
+ myHasTransparency = true;
+ }
+ return aPrevTransparency;
}
+//=================================================================
+/*!
+ * GEOM_Displayer::GetTransparency
+ * Get transparency for shape displaying.
+ */
+//=================================================================
double GEOM_Displayer::GetTransparency() const
{
return myTransparency;
}
+//=================================================================
+/*!
+ * GEOM_Displayer::HasTransparency
+ * Check if transparency for shape displaying is set.
+ */
+//=================================================================
bool GEOM_Displayer::HasTransparency() const
{
- return myTransparency != -1.0;
+ return myHasTransparency;
}
-void GEOM_Displayer::UnsetTransparency()
+//=================================================================
+/*!
+ * GEOM_Displayer::UnsetTransparency
+ * Unset transparency for shape displaying.
+ */
+//=================================================================
+double GEOM_Displayer::UnsetTransparency()
{
- myTransparency = -1.0;
+ double aPrevTransparency = myTransparency;
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
+ myHasTransparency = false;
+ return aPrevTransparency;
}
if ( viewModel && viewId != -1 ) {
// get properties from the study
- PropMap storedMap = study->getObjectPropMap( viewId, entry );
+ PropMap storedMap = study->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 ) ) )
arg( resMgr->integerValue( "Geometry", "iso_number_v", 1 ) ) );
// - transparency (opacity = 1-transparency)
- propMap.insert( GEOM::propertyName( GEOM::Transparency ), 0.0 );
+ propMap.insert( GEOM::propertyName( GEOM::Transparency ),
+ resMgr->integerValue( "Geometry", "transparency", 0 ) / 100. );
// - display mode (take default value from preferences)
propMap.insert( GEOM::propertyName( GEOM::DisplayMode ),
// - show edges direction flag (false by default)
propMap.insert( GEOM::propertyName( GEOM::EdgesDirection ), false );
+ // - show vertices flag (false by default)
+ propMap.insert( GEOM::propertyName( GEOM::Vertices ), false );
+
// - shading color (take default value from preferences)
propMap.insert( GEOM::propertyName( GEOM::ShadingColor ),
colorFromResources( "shading_color", QColor( 255, 255, 0 ) ) );
{
if( SUIT_ViewManager* aViewManager = *vmIt )
{
- const ObjMap anObjects = aStudy->getObjectMap( aViewManager->getGlobalId() );
+ const ObjMap& anObjects = aStudy->getObjectProperties( aViewManager->getGlobalId() );
for( ObjMap::ConstIterator objIt = anObjects.begin(); objIt != anObjects.end(); objIt++ )
{
_PTR(SObject) aSObj( aStudyDS->FindObjectID( objIt.key().toLatin1().constData() ) );
const bool theUpdateViewer,
SALOME_View* theViewFrame );
+ /* Update visibility state */
+ void UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool );
+
/* build presentation accordint to the current viewer type*/
SALOME_Prs* BuildPrs ( GEOM::GEOM_Object_ptr );
SALOME_Prs* BuildPrs ( const TopoDS_Shape& );
int GetColor () const;
bool HasColor () const;
- void SetTransparency ( const double );
- void UnsetTransparency();
+ double SetTransparency ( const double );
+ double UnsetTransparency();
double GetTransparency () const;
bool HasTransparency () const;
virtual void Update( SALOME_VTKPrs* );
virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* );
virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* );
-#if OCC_VERSION_LARGE > 0x06070000
virtual void BeforeErase ( SALOME_View*, const SALOME_OCCPrs* );
-#endif
virtual void AfterErase ( SALOME_View*, const SALOME_OCCPrs* );
/* This methos is used for activisation/deactivisation of objects to be displayed*/
Aspect_TypeOfMarker myTypeOfMarker;
double myScaleOfMarker;
double myTransparency;
+ bool myHasTransparency;
private:
SalomeApp_Application* myApp;
<source>ICO_SHELL_SEL_ONLY</source>
<translation>build_shell.png</translation>
</message>
+ <message>
+ <source>ICO_CURVE_CREATOR</source>
+ <translation>polyline.png</translation>
+ </message>
<message>
<source>ICO_SKETCH</source>
<translation>sketch.png</translation>
<source>ICON_DLG_SCALE_ALONG_AXES</source>
<translation>scale_along_axes.png</translation>
</message>
- <message>
- <source>ICON_DLG_EXPORTXAO</source>
- <translation>exportxao.png</translation>
- </message>
- <message>
- <source>ICO_EXPORTXAO</source>
- <translation>exportxao.png</translation>
- </message>
- <message>
- <source>ICON_DLG_IMPORTXAO</source>
- <translation>importxao.png</translation>
- </message>
- <message>
- <source>ICO_IMPORTXAO</source>
- <translation>importxao.png</translation>
- </message>
- <message>
- <source>ICON_OBJBROWSER_IMPORTEXPORT_204</source>
- <translation>tree_exportxao.png</translation>
- </message>
<!-- @@ insert new functions before this line @@ do not remove this line @@ -->
</context>
</TS>
<source>GEOM_CYLINDER_TITLE</source>
<translation>Cylinder Construction</translation>
</message>
+ <message>
+ <source>GEOM_CYLINDER_ANGLE_ERR</source>
+ <translation>Angle values 0 and 360 are unsafe to build proper volumes. Please uncheck the "Angle" box to use the regular cylinder constructor.</translation>
+ </message>
<message>
<source>GEOM_D1</source>
<translation>D1 :</translation>
<source>GEOM_INERTIA_CONSTR</source>
<translation>Matrix And Moments Of Inertia</translation>
</message>
- <message>
- <source>GEOM_INERTIA_I</source>
- <translation>%1:1 :</translation>
- </message>
- <message>
- <source>GEOM_INERTIA_IXYZ</source>
- <translation>IX & IY & IZ :</translation>
- </message>
<message>
<source>GEOM_INERTIA_TITLE</source>
<translation>Calculs Of Inertia</translation>
<source>GEOM_MEN_ENTER_ANGLE</source>
<translation>Enter An Angle In Degrees</translation>
</message>
- <message>
- <source>GEOM_MEN_EXPORT</source>
- <translation>Export</translation>
- </message>
- <message>
- <source>GEOM_MEN_IMPORT</source>
- <translation>Import</translation>
- </message>
<message>
<source>GEOM_MEN_ISOS</source>
<translation>Select Number Of Isos</translation>
</message>
<message>
<source>GEOM_VERTEXES</source>
- <translation>Vertexes</translation>
+ <translation>Vertices</translation>
</message>
<message>
<source>GEOM_WATER_DENSITY</source>
</message>
<message>
<source>MEN_CURVE_CREATOR</source>
- <translation>Curve creator</translation>
+ <translation>2D Polyline</translation>
+ </message>
+ <message>
+ <source>TOP_CURVE_CREATOR</source>
+ <translation>Create 2D polyline</translation>
+ </message>
+ <message>
+ <source>STB_CURVE_CREATOR</source>
+ <translation>Create 2D polyline</translation>
</message>
<message>
<source>MEN_ALL_SEL_ONLY</source>
</message>
<message>
<source>MEN_EXPORT</source>
- <translation>Export...</translation>
+ <translation>Export</translation>
</message>
<message>
<source>MEN_EXTRUSION</source>
</message>
<message>
<source>MEN_IMPORT</source>
- <translation>Import...</translation>
+ <translation>Import</translation>
</message>
<message>
<source>MEN_INERTIA</source>
<source>MEN_POP_VECTORS</source>
<translation>Show Edge Direction</translation>
</message>
+ <message>
+ <source>MEN_POP_VERTICES</source>
+ <translation>Show Vertices</translation>
+ </message>
<message>
<source>MEN_PREFERENCES</source>
<translation>Preferences</translation>
<source>MEN_VECTOR_MODE_OFF</source>
<translation>Hide Edge Direction</translation>
</message>
+ <message>
+ <source>MEN_VERTICES_MODE_ON</source>
+ <translation>Show Vertices</translation>
+ </message>
+ <message>
+ <source>MEN_VERTICES_MODE_OFF</source>
+ <translation>Hide Vertices</translation>
+ </message>
<message>
<source>MEN_WIREFRAME</source>
<translation>Wireframe</translation>
<source>PREF_DISPLAY_MODE</source>
<translation>Default display mode</translation>
</message>
+ <message>
+ <source>PREF_TRANSPARENCY</source>
+ <translation>Transparency</translation>
+ </message>
<message>
<source>PREF_FREE_BOUND_COLOR</source>
<translation>Color of free boundaries</translation>
<source>STB_EXPLODE_BLOCKS</source>
<translation>Explode on Blocks</translation>
</message>
- <message>
- <source>STB_EXPORT</source>
- <translation>Export geometry to BREP file</translation>
- </message>
<message>
<source>STB_EXTRUSION</source>
<translation>Create an extrusion</translation>
<source>STB_HEX_SOLID</source>
<translation>Hexahedral Solid</translation>
</message>
- <message>
- <source>STB_IMPORT</source>
- <translation>Import geometry from BREP file</translation>
- </message>
<message>
<source>STB_INERTIA</source>
<translation>Compute moments of intertia of the shape</translation>
<source>STB_POP_VECTORS</source>
<translation>Show Edge Direction</translation>
</message>
+ <message>
+ <source>STB_POP_VERTICES</source>
+ <translation>Show Vertices</translation>
+ </message>
<message>
<source>STB_POP_SETTEXTURE</source>
<translation>Add a texture</translation>
<source>TOM_X</source>
<translation>X</translation>
</message>
- <message>
- <source>TOOL_BASIC</source>
- <translation>Basic</translation>
- </message>
- <message>
- <source>TOOL_BLOCKS</source>
- <translation>Blocks</translation>
- </message>
- <message>
- <source>TOOL_BOOLEAN</source>
- <translation>Boolean operations</translation>
- </message>
- <message>
- <source>TOOL_FEATURES</source>
- <translation>Modification</translation>
- </message>
- <message>
- <source>TOOL_GENERATION</source>
- <translation>Generation</translation>
- </message>
- <message>
- <source>TOOL_PRIMITIVES</source>
- <translation>Primitives</translation>
- </message>
- <message>
- <source>TOOL_TRANSFORMATION</source>
- <translation>Transformation</translation>
- </message>
- <message>
- <source>TOOL_BUILD</source>
- <translation>Build</translation>
- </message>
- <message>
- <source>TOOL_OPERATIONS</source>
- <translation>Operations</translation>
- </message>
- <message>
- <source>TOOL_PICTURES</source>
- <translation>Pictures</translation>
- </message>
- <message>
- <source>TOOL_ADVANCED</source>
- <translation>Advanced</translation>
- </message>
- <message>
- <source>TOOL_MEASURES</source>
- <translation>Measures</translation>
- </message>
<message>
<source>TOP_ARC</source>
<translation>Create an arc</translation>
<source>TOP_EXPLODE_BLOCKS</source>
<translation>Explode on Blocks</translation>
</message>
- <message>
- <source>TOP_EXPORT</source>
- <translation>Export geometry to BREP file</translation>
- </message>
<message>
<source>TOP_EXTRUSION</source>
<translation>Create an extrusion</translation>
<source>TOP_HEX_SOLID</source>
<translation>Hexahedral Solid</translation>
</message>
- <message>
- <source>TOP_IMPORT</source>
- <translation>Import geometry from BREP file</translation>
- </message>
<message>
<source>TOP_INERTIA</source>
<translation>Moments of intertia</translation>
<source>STB_MANAGE_DIMENSIONS</source>
<translation>Manage measurement dimensions of an object</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+ <translation>Show dependency tree</translation>
+ </message>
+ <message>
+ <source>MEN_POP_REDUCE_STUDY</source>
+ <translation>Reduce study</translation>
+ </message>
<message>
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
<translation>Show all dimensions</translation>
<source>GEOM_PREVIEW</source>
<translation>Preview</translation>
</message>
+ <message>
+ <source>PREF_TAB_DEPENDENCY_VIEW</source>
+ <translation>Dependency Tree</translation>
+ </message>
+ <message>
+ <source>PREF_HIERARCHY_TYPE</source>
+ <translation>Hierarchy type</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_ASCENDANTS</source>
+ <translation>Display only ascendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_DESCENDANTS</source>
+ <translation>Display only descendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+ <translation>Display both ascendants and descendants trees</translation>
+ </message>
+ <message>
+ <source>GEOM_MOVE_POSSIBILITY</source>
+ <translation>Possibility to move nodes</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+ <translation>Background color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+ <translation>Default node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+ <translation>Main node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+ <translation>Unpublished node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+ <translation>Selected node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+ <translation>Default arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+ <translation>Highlighted arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+ <translation>Selected arrow color</translation>
+ </message>
<message>
<source>GEOM_ALL_IMPORT_FILES</source>
<translation>All supported formats ( %1 )</translation>
<source>GEOM_PUBLISH_NAMED_SHAPES</source>
<translation>Create groups for named shapes (if there are any)?</translation>
</message>
- <message>
- <source>GEOM_SCALE_DIMENSIONS</source>
- <translation>Take into account the units (%1) embedded to the file?
-Ignoring units will cause model scaling (as dimensions are supposed to be specified in meters).</translation>
- </message>
<message>
<source>GEOM_PRECISION_HINT</source>
<translation>Input value precision can be adjusted using
<translation>Select image...</translation>
</message>
<message>
- <source>MEN_IMPORTEXPORT</source>
- <translation>Import / Export XAO</translation>
+ <source>CC_PNT_ITEM_X_Y</source>
+ <translation>X=%1, Y=%2</translation>
</message>
<message>
- <source>TOOL_IMPORTEXPORT</source>
- <translation>Import / Export XAO</translation>
+ <source>CC_PNT_ITEM_X_Y_Z</source>
+ <translation>X=%1, Y=%2, Z=%3</translation>
+ </message>
+</context>
+<context>
+ <name>GeometryGUI</name>
+ <message>
+ <source>TOOL_BASIC</source>
+ <translation>Basic</translation>
+ </message>
+ <message>
+ <source>TOOL_BLOCKS</source>
+ <translation>Blocks</translation>
</message>
<message>
- <source>TOP_EXPORTXAO</source>
- <translation>Export to XAO</translation>
+ <source>TOOL_BOOLEAN</source>
+ <translation>Boolean operations</translation>
+ </message>
+ <message>
+ <source>TOOL_FEATURES</source>
+ <translation>Modification</translation>
+ </message>
+ <message>
+ <source>TOOL_GENERATION</source>
+ <translation>Generation</translation>
</message>
<message>
- <source>MEN_EXPORTXAO</source>
- <translation>Export XAO</translation>
+ <source>TOOL_PRIMITIVES</source>
+ <translation>Primitives</translation>
</message>
<message>
- <source>STB_EXPORTXAO</source>
- <translation>Export shape to XAO format</translation>
+ <source>TOOL_TRANSFORMATION</source>
+ <translation>Transformation</translation>
</message>
<message>
- <source>TOP_IMPORTXAO</source>
- <translation>Import from XAO</translation>
+ <source>TOOL_BUILD</source>
+ <translation>Build</translation>
</message>
<message>
- <source>MEN_IMPORTXAO</source>
- <translation>Import XAO</translation>
+ <source>TOOL_OPERATIONS</source>
+ <translation>Operations</translation>
</message>
<message>
- <source>STB_IMPORTXAO</source>
- <translation>Import shape from XAO format</translation>
+ <source>TOOL_PICTURES</source>
+ <translation>Pictures</translation>
</message>
<message>
- <source>GEOM_IMPORTEXPORT_204</source>
- <translation>Export XAO</translation>
+ <source>TOOL_ADVANCED</source>
+ <translation>Advanced</translation>
</message>
<message>
- <source>GEOM_SELECT_IMPORT_XAO</source>
- <translation>Import from XAO</translation>
+ <source>TOOL_MEASURES</source>
+ <translation>Measures</translation>
</message>
<message>
- <source>GEOM_SELECT_EXPORT_XAO</source>
- <translation>Export to XAO</translation>
+ <source>TOOL_IMPORTEXPORT</source>
+ <translation>Import / Export XAO</translation>
</message>
<message>
- <source>XAO_FILES</source>
- <translation>XAO files (*.xao)</translation>
+ <source>TABLE_SECTION</source>
+ <translation>Section</translation>
</message>
<message>
- <source>TOOLS_IMPORTEXPORT</source>
- <translation>Import / Export</translation>
+ <source>TABLE_INDEX</source>
+ <translation>Index</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y</source>
- <translation>X=%1, Y=%2</translation>
+ <source>TABLE_X</source>
+ <translation>X</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y_Z</source>
- <translation>X=%1, Y=%2, Z=%3</translation>
+ <source>TABLE_Y</source>
+ <translation>Y</translation>
</message>
</context>
<context>
<translation>Face 2 V</translation>
</message>
</context>
-<context>
- <name>CurveCreator_NewPointDlg</name>
- <message>
- <source>ADD_NEW_POINT</source>
- <translation>Add new points</translation>
- </message>
- <message>
- <source>X_COORD</source>
- <translation>X</translation>
- </message>
- <message>
- <source>Y_COORD</source>
- <translation>Y</translation>
- </message>
- <message>
- <source>Z_COORD</source>
- <translation>Z</translation>
- </message>
- <message>
- <source>ADD_BTN</source>
- <translation>Add</translation>
- </message>
- <message>
- <source>ADD_CONTINUE_BTN</source>
- <translation>Add and continue</translation>
- </message>
- <message>
- <source>ADD_NEW_POINT_TO_%1</source>
- <translation>Add new point to %1</translation>
- </message>
- <message>
- <source>SET_POINT_COORDINATES</source>
- <translation>Set point coordinates</translation>
- </message>
-</context>
<context>
<name>CurveCreator_NewSectionDlg</name>
<message>
- <source>NAME</source>
+ <source>SECTION_NAME</source>
<translation>Name</translation>
</message>
<message>
- <source>LINE_TYPE</source>
+ <source>SECTION_LINE_TYPE</source>
<translation>Type</translation>
</message>
<message>
- <source>POLYLINE_TYPE</source>
+ <source>SECTION_POLYLINE_TYPE</source>
<translation>Polyline</translation>
</message>
<message>
- <source>SPLINE_TYPE</source>
+ <source>SECTION_SPLINE_TYPE</source>
<translation>Spline</translation>
</message>
<message>
- <source>LINE_CLOSED</source>
+ <source>SECTION_LINE_CLOSED</source>
<translation>Closed</translation>
</message>
<message>
- <source>OK</source>
- <translation>Ok</translation>
+ <source>SECTION_ADD_BTN</source>
+ <translation>Add</translation>
</message>
<message>
- <source>ADD_BTN</source>
- <translation>Add</translation>
+ <source>SECTION_OK_BTN</source>
+ <translation>Ok</translation>
</message>
<message>
- <source>ADD_CONTINUE_BTN</source>
- <translation>Add and continue</translation>
+ <source>SECTION_CANCEL_BTN</source>
+ <translation>Cancel</translation>
</message>
<message>
<source>ADD_NEW_SECTION</source>
<context>
<name>CurveCreator_Widget</name>
<message>
- <source>CURVE_NAME_TLT</source>
- <translation>Name</translation>
- </message>
- <message>
- <source>SECTION_GROUP_TLT</source>
+ <source>SECTION_GROUP_TITLE</source>
<translation>Sections</translation>
</message>
<message>
<source>NEW_SECTION_TLT</source>
<translation>Insert new section</translation>
</message>
- <message>
- <source>INSERT_SECTION_BEFORE</source>
- <translation>Insert section before</translation>
- </message>
- <message>
- <source>INSERT_SECTION_BEFORE_TLT</source>
- <translation>Insert section before</translation>
- </message>
- <message>
- <source>INSERT_SECTION_AFTER</source>
- <translation>Insert section after</translation>
- </message>
- <message>
- <source>INSERT_SECTION_AFTER_TLT</source>
- <translation>Insert section after</translation>
- </message>
<message>
<source>ADDITION_MODE</source>
<translation>Addition mode</translation>
<source>DETECTION_MODE_TLT</source>
<translation>Detection mode</translation>
</message>
- <message>
- <source>INSERT_POINT_BEFORE</source>
- <translation>Insert point before</translation>
- </message>
- <message>
- <source>INSERT_POINT_BEFORE_TLT</source>
- <translation>Insert point before</translation>
- </message>
- <message>
- <source>INSERT_POINT_AFTER</source>
- <translation>Insert point after</translation>
- </message>
<message>
<source>CLOSE_SECTIONS</source>
<translation>Set closed</translation>
<source>JOIN_TLT</source>
<translation>Join selected sections</translation>
</message>
- <message>
- <source>STEP_UP</source>
- <translation>Move up</translation>
- </message>
- <message>
- <source>STEP_UP_TLT</source>
- <translation>Move selected objects up</translation>
- </message>
- <message>
- <source>STEP_DOWN</source>
- <translation>Move down</translation>
- </message>
- <message>
- <source>STEP_DOWN_TLT</source>
- <translation>Move selected objects down</translation>
- </message>
<message>
<source>CLEAR_ALL</source>
<translation>Clear all</translation>
<translation>Join all sections</translation>
</message>
</context>
+<context>
+ <name>EntityGUI_PolylineDlg</name>
+ <message>
+ <source>POLYLINE_DLG_TITLE</source>
+ <translation>Polyline Construction</translation>
+ </message>
+ <message>
+ <source>POLYLINE_TITLE</source>
+ <translation>Polyline</translation>
+ </message>
+ <message>
+ <source>POLYLINE_NAME</source>
+ <translation>Polyline</translation>
+ </message>
+ <message>
+ <source>POLYLINE_IMPORT</source>
+ <translation>Import polyline</translation>
+ </message>
+ <message>
+ <source>POLYLINE_ADD_SECTION</source>
+ <translation>Add section</translation>
+ </message>
+ <message>
+ <source>POLYLINE_EDIT_SECTION</source>
+ <translation>Edit section</translation>
+ </message>
+</context>
<context>
<name>EntityGUI_SketcherDlg</name>
<message>
</message>
</context>
<context>
- <name>RepairGUI_UnionFacesDlg</name>
+ <name>GEOMToolsGUI_ReduceStudyDlg</name>
<message>
- <source>GEOM_UNION_FACES_TITLE</source>
- <translation>Union faces</translation>
+ <source>GEOM_REDUCE_STUDY_TITLE</source>
+ <translation>Reduce study</translation>
</message>
<message>
- <source>GEOM_UNION_FACES</source>
- <translation>Object to unite faces</translation>
+ <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
+ <translation>Objects to be kept</translation>
</message>
<message>
- <source>UNION_FACES_NEW_OBJ_NAME</source>
- <translation>UnionFaces</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
+ <translation>Objects to be removed</translation>
</message>
-</context>
-<context>
- <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>CREATION_INFO_TITLE</source>
- <translation>Information</translation>
+ <source>GEOM_REDUCE_STUDY_NAME</source>
+ <translation>Name</translation>
</message>
<message>
- <source>OPERATION</source>
- <translation>Creation operation</translation>
+ <source>GEOM_REDUCE_STUDY_OPTIONS</source>
+ <translation>Options</translation>
</message>
<message>
- <source>PARAMETER</source>
- <translation>Parameter</translation>
+ <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
+ <translation>Intermediate objects</translation>
</message>
<message>
- <source>VALUE</source>
- <translation>Value</translation>
+ <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
+ <translation>Sub-objects</translation>
</message>
<message>
- <source>NO_INFO</source>
- <translation>(No info available)</translation>
+ <source>GEOM_REDUCE_STUDY_KEEP</source>
+ <translation>Keep</translation>
</message>
-</context>
-<context>
- <name>ImportExportGUI_ExportXAODlg</name>
<message>
- <source>GEOM_EXPORTXAO_TITLE</source>
- <translation>Export XAO</translation>
+ <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
+ <translation>Unpublish</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO</source>
- <translation>Export XAO</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE</source>
+ <translation>Remove</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_EXPORTINGSHAPE</source>
- <translation>Shape</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
+ <translation>Remove empty folders</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_FILENAME</source>
- <translation>File Name</translation>
+ <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
+ <translation>Soft removal</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_AUTHOR</source>
- <translation>Author</translation>
+ <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
+ <translation>Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
</message>
+</context>
+<context>
+ <name>RepairGUI_UnionFacesDlg</name>
<message>
- <source>GEOM_EXPORTXAO_LGROUPS</source>
- <translation>Groups</translation>
+ <source>GEOM_UNION_FACES_TITLE</source>
+ <translation>Union faces</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_LFIELDS</source>
- <translation>Fields</translation>
+ <source>GEOM_UNION_FACES</source>
+ <translation>Object to unite faces</translation>
</message>
<message>
- <source>EXPORT_DLG_ACCEPT</source>
- <translation>OK</translation>
+ <source>UNION_FACES_NEW_OBJ_NAME</source>
+ <translation>UnionFaces</translation>
</message>
</context>
<context>
- <name>ImportExportGUI_ImportXAODlg</name>
- <message>
- <source>GEOM_IMPORTXAO_TITLE</source>
- <translation>Import XAO</translation>
- </message>
- <message>
- <source>GEOM_IMPORTXAO</source>
- <translation>Import XAO</translation>
- </message>
+ <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>GEOM_IMPORTXAO_IMPORTINGSHAPE</source>
- <translation>Shape</translation>
+ <source>CREATION_INFO_TITLE</source>
+ <translation>Information</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_FILENAME</source>
- <translation>File Name</translation>
+ <source>OPERATION</source>
+ <translation>Creation operation</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LGROUPS</source>
- <translation>Groups</translation>
+ <source>PARAMETER</source>
+ <translation>Parameter</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LFIELDS</source>
- <translation>Fields</translation>
+ <source>VALUE</source>
+ <translation>Value</translation>
</message>
<message>
- <source>STEP</source>
- <translation>Step</translation>
+ <source>NO_INFO</source>
+ <translation>(No info available)</translation>
</message>
</context>
<context>
<source>GEOM_CYLINDER_TITLE</source>
<translation>Construction d'un cylindre </translation>
</message>
+ <message>
+ <source>GEOM_CYLINDER_ANGLE_ERR</source>
+ <translation>Les valeurs de l'angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case "Angle" pour utiliser le constructeur de cylindre complet.</translation>
+ </message>
<message>
<source>GEOM_D1</source>
<translation>D1 :</translation>
<source>GEOM_INERTIA_CONSTR</source>
<translation>Matrice et moment d'inertie</translation>
</message>
- <message>
- <source>GEOM_INERTIA_I</source>
- <translation>%1:1 :</translation>
- </message>
- <message>
- <source>GEOM_INERTIA_IXYZ</source>
- <translation>IX & IY & IZ :</translation>
- </message>
<message>
<source>GEOM_INERTIA_TITLE</source>
<translation>Calcul de l'inertie</translation>
<source>GEOM_MEN_ENTER_ANGLE</source>
<translation>Indiquez l'angle en degrés</translation>
</message>
- <message>
- <source>GEOM_MEN_EXPORT</source>
- <translation>Exporter</translation>
- </message>
- <message>
- <source>GEOM_MEN_IMPORT</source>
- <translation>Importer</translation>
- </message>
<message>
<source>GEOM_MEN_ISOS</source>
<translation>Choisir le nombre d'isolignes</translation>
</message>
<message>
<source>MEN_EXPORT</source>
- <translation>Exporter...</translation>
+ <translation>Exporter</translation>
</message>
<message>
<source>MEN_EXTRUSION</source>
</message>
<message>
<source>MEN_IMPORT</source>
- <translation>Importer...</translation>
+ <translation>Importer</translation>
</message>
<message>
<source>MEN_INERTIA</source>
<source>MEN_POP_VECTORS</source>
<translation>Afficher l'orientation des arêtes</translation>
</message>
+ <message>
+ <source>MEN_POP_VERTICES</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
<message>
<source>MEN_PREFERENCES</source>
<translation>Préférences</translation>
<source>MEN_VECTOR_MODE_OFF</source>
<translation>Cacher l'orientation de l'arête</translation>
</message>
+ <message>
+ <source>MEN_VERTICES_MODE_ON</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
+ <message>
+ <source>MEN_VERTICES_MODE_OFF</source>
+ <translation type="unfinished">Hide Vertices</translation>
+ </message>
<message>
<source>MEN_WIREFRAME</source>
<translation>Filaire</translation>
<source>PREF_DISPLAY_MODE</source>
<translation>Mode de visualisation</translation>
</message>
+ <message>
+ <source>PREF_TRANSPARENCY</source>
+ <translation>Transparence</translation>
+ </message>
<message>
<source>PREF_FREE_BOUND_COLOR</source>
<translation>Couleur des contours libres</translation>
<source>STB_EXPLODE_BLOCKS</source>
<translation>Eclater en blocs</translation>
</message>
- <message>
- <source>STB_EXPORT</source>
- <translation>Exporter la géométrie au fichier BREP</translation>
- </message>
<message>
<source>STB_EXTRUSION</source>
<translation>Créer une extrusion</translation>
<source>STB_HEX_SOLID</source>
<translation>Solide hexaédrique</translation>
</message>
- <message>
- <source>STB_IMPORT</source>
- <translation>Importer une géométrie d'un fichier BREP</translation>
- </message>
<message>
<source>STB_INERTIA</source>
<translation>Calculer les moments d'inertie de l'objet</translation>
<source>STB_POP_VECTORS</source>
<translation>Afficher l'orientation des arêtes</translation>
</message>
+ <message>
+ <source>STB_POP_VERTICES</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
<message>
<source>STB_POP_SETTEXTURE</source>
<translation>Ajoute une texture</translation>
<source>TOM_X</source>
<translation>X</translation>
</message>
- <message>
- <source>TOOL_BASIC</source>
- <translation>Objets de base</translation>
- </message>
- <message>
- <source>TOOL_BLOCKS</source>
- <translation>Blocs</translation>
- </message>
- <message>
- <source>TOOL_BOOLEAN</source>
- <translation>Opérations booléennes </translation>
- </message>
- <message>
- <source>TOOL_FEATURES</source>
- <translation>Modification</translation>
- </message>
- <message>
- <source>TOOL_GENERATION</source>
- <translation>Génération</translation>
- </message>
- <message>
- <source>TOOL_PRIMITIVES</source>
- <translation>Primitives</translation>
- </message>
- <message>
- <source>TOOL_TRANSFORMATION</source>
- <translation>Transformation</translation>
- </message>
- <message>
- <source>TOOL_BUILD</source>
- <translation>Construire</translation>
- </message>
- <message>
- <source>TOOL_OPERATIONS</source>
- <translation>Opérations</translation>
- </message>
- <message>
- <source>TOOL_PICTURES</source>
- <translation>Images</translation>
- </message>
- <message>
- <source>TOOL_ADVANCED</source>
- <translation>Avancé</translation>
- </message>
- <message>
- <source>TOOL_MEASURES</source>
- <translation>Informations</translation>
- </message>
<message>
<source>TOP_ARC</source>
<translation>Créer un arc</translation>
<source>TOP_EXPLODE_BLOCKS</source>
<translation>Eclater en blocs</translation>
</message>
- <message>
- <source>TOP_EXPORT</source>
- <translation>Exporter une géométrie au format BREP</translation>
- </message>
<message>
<source>TOP_EXTRUSION</source>
<translation>Créer une extrusion</translation>
<source>TOP_HEX_SOLID</source>
<translation>Solide hexaédrique</translation>
</message>
- <message>
- <source>TOP_IMPORT</source>
- <translation>Importer une géométrie d'un fichier BREP</translation>
- </message>
<message>
<source>TOP_INERTIA</source>
<translation>Moments d'inertie</translation>
<source>STB_MANAGE_DIMENSIONS</source>
<translation>Gérer la cotation d'un objet</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+ <translation type="unfinished">Show dependency tree</translation>
+ </message>
+ <message>
+ <source>MEN_POP_SHOW_REDUCE_STUDY</source>
+ <translation type="unfinished">Reduce study</translation>
+ </message>
<message>
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
<translation>Afficher les cotations </translation>
<source>GEOM_PREVIEW</source>
<translation>Prévisualiser</translation>
</message>
+ <message>
+ <source>PREF_TAB_DEPENDENCY_VIEW</source>
+ <translation type="unfinished">Dependency Tree</translation>
+ </message>
+ <message>
+ <source>PREF_HIERARCHY_TYPE</source>
+ <translation type="unfinished">Hierarchy type</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_ASCENDANTS</source>
+ <translation type="unfinished">Display only ascendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_DESCENDANTS</source>
+ <translation type="unfinished">Display only descendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+ <translation type="unfinished">Display both ascendants and descendants trees</translation>
+ </message>
+ <message>
+ <source>GEOM_MOVE_POSSIBILITY</source>
+ <translation type="unfinished">Possibility to move nodes</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+ <translation type="unfinished">Color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+ <translation type="unfinished">Background color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+ <translation type="unfinished">Default node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+ <translation type="unfinished">Main node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+ <translation type="unfinished">Unpublished node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+ <translation type="unfinished">Selected node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+ <translation type="unfinished">Arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+ <translation type="unfinished">Highlighted arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+ <translation type="unfinished">Selected arrow color</translation>
+ </message>
<message>
<source>GEOM_ALL_IMPORT_FILES</source>
<translation>Tous les formats supportés ( %1 )</translation>
<source>GEOM_PUBLISH_NAMED_SHAPES</source>
<translation>Créer des groupes pour les objets indiqués (s'ils existent)?</translation>
</message>
- <message>
- <source>GEOM_SCALE_DIMENSIONS</source>
- <translation>Voulez-vous prendre les unités du fichier (%1) en considération?
-Sinon le modèle sera mis à l'échelle GEOM (unités interprétées comme des mètres).</translation>
- </message>
<message>
<source>GEOM_PRECISION_HINT</source>
<translation>Il est possible d'ajuster la précision de la valeur d'entrée avec
<translation>Sélectionner une image...</translation>
</message>
<message>
- <source>MEN_IMPORTEXPORT</source>
- <translation>Import / Export XAO</translation>
+ <source>CC_PNT_ITEM_X_Y</source>
+ <translation>X=%1, Y=%2</translation>
</message>
<message>
- <source>TOOL_IMPORTEXPORT</source>
- <translation>Import / Export XAO</translation>
+ <source>CC_PNT_ITEM_X_Y_Z</source>
+ <translation>X=%1, Y=%2, Z=%3</translation>
</message>
+</context>
+<context>
+ <name>GeometryGUI</name>
<message>
- <source>TOP_EXPORTXAO</source>
- <translation>Export XAO</translation>
+ <source>TOOL_BASIC</source>
+ <translation>Objets de base</translation>
</message>
<message>
- <source>MEN_EXPORTXAO</source>
- <translation>Export XAO</translation>
+ <source>TOOL_BLOCKS</source>
+ <translation>Blocs</translation>
</message>
<message>
- <source>STB_EXPORTXAO</source>
- <translation>Exporter une forme au format XAO</translation>
+ <source>TOOL_BOOLEAN</source>
+ <translation>Opérations booléennes </translation>
</message>
<message>
- <source>TOP_IMPORTXAO</source>
- <translation>Import XAO</translation>
+ <source>TOOL_FEATURES</source>
+ <translation>Modification</translation>
</message>
<message>
- <source>MEN_IMPORTXAO</source>
- <translation>Import XAO</translation>
+ <source>TOOL_GENERATION</source>
+ <translation>Génération</translation>
</message>
<message>
- <source>STB_IMPORTXAO</source>
- <translation>Importer une forme au format XAO</translation>
+ <source>TOOL_PRIMITIVES</source>
+ <translation>Primitives</translation>
</message>
<message>
- <source>GEOM_IMPORTEXPORT_204</source>
- <translation>Export XAO</translation>
+ <source>TOOL_TRANSFORMATION</source>
+ <translation>Transformation</translation>
</message>
<message>
- <source>GEOM_SELECT_IMPORT_XAO</source>
- <translation>Import XAO</translation>
+ <source>TOOL_BUILD</source>
+ <translation>Construire</translation>
</message>
<message>
- <source>GEOM_SELECT_EXPORT_XAO</source>
- <translation>Export XAO</translation>
+ <source>TOOL_OPERATIONS</source>
+ <translation>Opérations</translation>
</message>
<message>
- <source>XAO_FILES</source>
- <translation>Fichiers XAO (*.xao)</translation>
+ <source>TOOL_PICTURES</source>
+ <translation>Images</translation>
</message>
<message>
- <source>TOOLS_IMPORTEXPORT</source>
- <translation>Import / Export XAO</translation>
+ <source>TOOL_ADVANCED</source>
+ <translation>Avancé</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y</source>
- <translation>X=%1, Y=%2</translation>
+ <source>TOOL_MEASURES</source>
+ <translation>Informations</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y_Z</source>
- <translation>X=%1, Y=%2, Z=%3</translation>
+ <source>TOOL_IMPORTEXPORT</source>
+ <translation>Import / Export XAO</translation>
</message>
</context>
<context>
</message>
</context>
<context>
- <name>RepairGUI_UnionFacesDlg</name>
+ <name>GEOMToolsGUI_ReduceStudyDlg</name>
<message>
- <source>GEOM_UNION_FACES_TITLE</source>
- <translation>Unir les faces</translation>
+ <source>GEOM_REDUCE_STUDY_TITLE</source>
+ <translation type="unfinished">Reduce study</translation>
</message>
<message>
- <source>GEOM_UNION_FACES</source>
- <translation>Objet à traiter</translation>
+ <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
+ <translation type="unfinished">Objects to be kept</translation>
</message>
<message>
- <source>UNION_FACES_NEW_OBJ_NAME</source>
- <translation>UnirFaces</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
+ <translation type="unfinished">Objects to be removed</translation>
</message>
-</context>
-<context>
- <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>CREATION_INFO_TITLE</source>
- <translation>Information</translation>
+ <source>GEOM_REDUCE_STUDY_NAME</source>
+ <translation type="unfinished">Name</translation>
</message>
<message>
- <source>OPERATION</source>
- <translation>Création</translation>
+ <source>GEOM_REDUCE_STUDY_OPTIONS</source>
+ <translation type="unfinished">Options</translation>
</message>
<message>
- <source>PARAMETER</source>
- <translation>Paramètre</translation>
+ <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
+ <translation type="unfinished">Intermediate objects</translation>
</message>
<message>
- <source>VALUE</source>
- <translation>Valeur</translation>
+ <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
+ <translation type="unfinished">Sub-objects</translation>
</message>
<message>
- <source>NO_INFO</source>
- <translation>(aucune information disponible)</translation>
+ <source>GEOM_REDUCE_STUDY_KEEP</source>
+ <translation type="unfinished">Keep</translation>
</message>
-</context>
-<context>
- <name>ImportExportGUI_ExportXAODlg</name>
<message>
- <source>GEOM_EXPORTXAO_TITLE</source>
- <translation>Export XAO</translation>
+ <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
+ <translation type="unfinished">Unpublish</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO</source>
- <translation>Export XAO</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE</source>
+ <translation type="unfinished">Remove</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_EXPORTINGSHAPE</source>
- <translation>Objet</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
+ <translation type="unfinished">Remove empty folders</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_FILENAME</source>
- <translation>Fichier</translation>
+ <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
+ <translation type="unfinished">Soft removal</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_AUTHOR</source>
- <translation>Auteur</translation>
+ <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
+ <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
</message>
+</context>
+<context>
+ <name>RepairGUI_UnionFacesDlg</name>
<message>
- <source>GEOM_EXPORTXAO_LGROUPS</source>
- <translation>Groupes</translation>
+ <source>GEOM_UNION_FACES_TITLE</source>
+ <translation>Unir les faces</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_LFIELDS</source>
- <translation>Champs</translation>
+ <source>GEOM_UNION_FACES</source>
+ <translation>Objet à traiter</translation>
</message>
<message>
- <source>EXPORT_DLG_ACCEPT</source>
- <translation>OK</translation>
+ <source>UNION_FACES_NEW_OBJ_NAME</source>
+ <translation>UnirFaces</translation>
</message>
</context>
<context>
- <name>ImportExportGUI_ImportXAODlg</name>
- <message>
- <source>GEOM_IMPORTXAO_TITLE</source>
- <translation>Import XAO</translation>
- </message>
- <message>
- <source>GEOM_IMPORTXAO</source>
- <translation>Import XAO</translation>
- </message>
+ <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>GEOM_IMPORTXAO_IMPORTINGSHAPE</source>
- <translation>Objet</translation>
+ <source>CREATION_INFO_TITLE</source>
+ <translation>Information</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_FILENAME</source>
- <translation>Fichier</translation>
+ <source>OPERATION</source>
+ <translation>Création</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LGROUPS</source>
- <translation>Groupes</translation>
+ <source>PARAMETER</source>
+ <translation>Paramètre</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LFIELDS</source>
- <translation>Champs</translation>
+ <source>VALUE</source>
+ <translation>Valeur</translation>
</message>
<message>
- <source>STEP</source>
- <translation>Pas</translation>
+ <source>NO_INFO</source>
+ <translation>(aucune information disponible)</translation>
</message>
</context>
<context>
<source>GEOM_INERTIA_CONSTR</source>
<translation>行列とモーメント</translation>
</message>
- <message>
- <source>GEOM_INERTIA_I</source>
- <translation>%1:1。</translation>
- </message>
- <message>
- <source>GEOM_INERTIA_IXYZ</source>
- <translation>IX & IY & IZ :</translation>
- </message>
<message>
<source>GEOM_INERTIA_TITLE</source>
<translation>慣性の計算</translation>
<source>GEOM_MEN_ENTER_ANGLE</source>
<translation>角度を度数で指定します</translation>
</message>
- <message>
- <source>GEOM_MEN_EXPORT</source>
- <translation>エクスポート</translation>
- </message>
- <message>
- <source>GEOM_MEN_IMPORT</source>
- <translation>インポート</translation>
- </message>
<message>
<source>GEOM_MEN_ISOS</source>
<translation>輪郭線の数を選択します。</translation>
</message>
<message>
<source>GEOM_PRP_EXPORT</source>
- <translation>ジオメトリを %1 にエクスポート...</translation>
+ <translation>ジオメトリを %1 にエクスポート</translation>
</message>
<message>
<source>GEOM_PRP_LOADING</source>
</message>
<message>
<source>MEN_IMPORT</source>
- <translation>インポート...</translation>
+ <translation>インポート</translation>
</message>
<message>
<source>MEN_INERTIA</source>
<source>MEN_POP_VECTORS</source>
<translation>ベクトル方向表示</translation>
</message>
+ <message>
+ <source>MEN_POP_VERTICES</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
<message>
<source>MEN_PREFERENCES</source>
<translation>設定</translation>
<source>MEN_VECTOR_MODE_OFF</source>
<translation>エッジの方向を非表示</translation>
</message>
+ <message>
+ <source>MEN_VERTICES_MODE_ON</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
+ <message>
+ <source>MEN_VERTICES_MODE_OFF</source>
+ <translation type="unfinished">Hide Vertices</translation>
+ </message>
<message>
<source>MEN_WIREFRAME</source>
<translation>ワイヤ フレーム</translation>
<source>PREF_DISPLAY_MODE</source>
<translation>表示モード</translation>
</message>
+ <message>
+ <source>PREF_TRANSPARENCY</source>
+ <translation>透明度</translation>
+ </message>
<message>
<source>PREF_FREE_BOUND_COLOR</source>
<translation>自由境界の色</translation>
<source>STB_EXPLODE_BLOCKS</source>
<translation>ブロックで展開</translation>
</message>
- <message>
- <source>STB_EXPORT</source>
- <translation>ジオメトリをBREPファイルにエクスポート</translation>
- </message>
<message>
<source>STB_EXTRUSION</source>
<translation>押し出しを作成</translation>
<source>STB_HEX_SOLID</source>
<translation>Hexahedral_Solid</translation>
</message>
- <message>
- <source>STB_IMPORT</source>
- <translation>BREPファイルをジオメトリにインポート</translation>
- </message>
<message>
<source>STB_INERTIA</source>
<translation>オブジェクトの慣性モーメントを計算します。</translation>
<source>STB_POP_VECTORS</source>
<translation>エッジの方向を表示します。</translation>
</message>
+ <message>
+ <source>STB_POP_VERTICES</source>
+ <translation type="unfinished">Show Vertices</translation>
+ </message>
<message>
<source>STB_POP_SETTEXTURE</source>
<translation>テクスチャを追加します。</translation>
<source>TOM_X</source>
<translation>X</translation>
</message>
- <message>
- <source>TOOL_BASIC</source>
- <translation>基礎オブジェクト</translation>
- </message>
- <message>
- <source>TOOL_BLOCKS</source>
- <translation>ブロック分割</translation>
- </message>
- <message>
- <source>TOOL_BOOLEAN</source>
- <translation>ブーリアン操作</translation>
- </message>
- <message>
- <source>TOOL_FEATURES</source>
- <translation>フィーチャー</translation>
- </message>
- <message>
- <source>TOOL_GENERATION</source>
- <translation>押し出し/回転</translation>
- </message>
- <message>
- <source>TOOL_PRIMITIVES</source>
- <translation>基本図形</translation>
- </message>
- <message>
- <source>TOOL_TRANSFORMATION</source>
- <translation>変形/移動/回転</translation>
- </message>
- <message>
- <source>TOOL_BUILD</source>
- <translation>構築</translation>
- </message>
- <message>
- <source>TOOL_OPERATIONS</source>
- <translation>操作</translation>
- </message>
- <message>
- <source>TOOL_PICTURES</source>
- <translation>画像</translation>
- </message>
- <message>
- <source>TOOL_ADVANCED</source>
- <translation>高度なツール</translation>
- </message>
- <message>
- <source>TOOL_MEASURES</source>
- <translation>情報/測定</translation>
- </message>
<message>
<source>TOP_ARC</source>
<translation>円弧を作成</translation>
<source>TOP_EXPLODE_BLOCKS</source>
<translation>ブロックで展開</translation>
</message>
- <message>
- <source>TOP_EXPORT</source>
- <translation>ジオメトリをBREPファイルでエクスポート</translation>
- </message>
<message>
<source>TOP_EXTRUSION</source>
<translation>押し出しを作成</translation>
<source>TOP_HEX_SOLID</source>
<translation>Hexahedral_Solid</translation>
</message>
- <message>
- <source>TOP_IMPORT</source>
- <translation>BREPファイルをジオメトリにインポート</translation>
- </message>
<message>
<source>TOP_INERTIA</source>
<translation>慣性モーメント</translation>
<source>STB_MANAGE_DIMENSIONS</source>
<translation>オブジェクトの基準寸法を管理</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+ <translation type="unfinished">Show dependency tree</translation>
+ </message>
+ <message>
+ <source>MEN_POP_SHOW_REDUCE_STUDY</source>
+ <translation type="unfinished">Reduce study</translation>
+ </message>
<message>
<source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
<translation>すべての寸法を表示</translation>
<source>GEOM_PREVIEW</source>
<translation>プレビュー</translation>
</message>
+ <message>
+ <source>PREF_TAB_DEPENDENCY_VIEW</source>
+ <translation type="unfinished">Dependency Tree</translation>
+ </message>
+ <message>
+ <source>PREF_HIERARCHY_TYPE</source>
+ <translation type="unfinished">Hierarchy type</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_ASCENDANTS</source>
+ <translation type="unfinished">Display only ascendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_ONLY_DESCENDANTS</source>
+ <translation type="unfinished">Display only descendants tree</translation>
+ </message>
+ <message>
+ <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+ <translation type="unfinished">Display both ascendants and descendants trees</translation>
+ </message>
+ <message>
+ <source>GEOM_MOVE_POSSIBILITY</source>
+ <translation type="unfinished">Possibility to move nodes</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+ <translation type="unfinished">Color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+ <translation type="unfinished">Background color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+ <translation type="unfinished">Default node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+ <translation type="unfinished">Main node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+ <translation type="unfinished">Unpublished node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+ <translation type="unfinished">Selected node color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+ <translation type="unfinished">Arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+ <translation type="unfinished">Highlighted arrow color</translation>
+ </message>
+ <message>
+ <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+ <translation type="unfinished">Selected arrow color</translation>
+ </message>
<message>
<source>GEOM_ALL_IMPORT_FILES</source>
<translation>サポートされているすべての形式 (%1)</translation>
<source>GEOM_PUBLISH_NAMED_SHAPES</source>
<translation>指定したオブジェクトのグループ(存在する場合)を作成しますか?</translation>
</message>
- <message>
- <source>GEOM_SCALE_DIMENSIONS</source>
- <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
- </message>
<message>
<source>GEOM_PRECISION_HINT</source>
<translation>パラメーターの入力値の精度を調整することは '%1' の好みにジオメトリ モジュールの。</translation>
<translation>イメージの選択.</translation>
</message>
<message>
- <source>MEN_IMPORTEXPORT</source>
- <translation>インポート/エクスポート</translation>
+ <source>CC_PNT_ITEM_X_Y</source>
+ <translation>X=%1, Y=%2</translation>
</message>
<message>
- <source>TOOL_IMPORTEXPORT</source>
- <translation>インポート/エクスポート</translation>
+ <source>CC_PNT_ITEM_X_Y_Z</source>
+ <translation>X=%1, Y=%2, Z=%3</translation>
</message>
+ </context>
+ <context>
+ <name>GeometryGUI</name>
<message>
- <source>TOP_EXPORTXAO</source>
- <translation>エクスポートしました。</translation>
+ <source>TOOL_BASIC</source>
+ <translation>基礎オブジェクト</translation>
</message>
<message>
- <source>MEN_EXPORTXAO</source>
- <translation>ã\82¨ã\82¯ã\82¹ã\83\9dã\83¼ã\83\88ã\81\97ã\81¾ã\81\97ã\81\9fã\80\82</translation>
+ <source>TOOL_BLOCKS</source>
+ <translation>ã\83\96ã\83ã\83\83ã\82¯å\88\86å\89²</translation>
</message>
<message>
- <source>STB_EXPORTXAO</source>
- <translation>ã\82½ã\83\86ã\83¼ã\81\97ã\81\9få½¢å¼\8fã\81§ã\83\95ã\82©ã\83¼ã\83 ã\82\92ã\82¨ã\82¯ã\82¹ã\83\9dã\83¼ã\83\88ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+ <source>TOOL_BOOLEAN</source>
+ <translation>ã\83\96ã\83¼ã\83ªã\82¢ã\83³æ\93\8dä½\9c</translation>
</message>
<message>
- <source>TOP_IMPORTXAO</source>
- <translation>ã\82¤ã\83³ã\83\9dã\83¼ã\83\88ã\81\97ã\81¾ã\81\97ã\81\9fã\80\82</translation>
+ <source>TOOL_FEATURES</source>
+ <translation>ã\83\95ã\82£ã\83¼ã\83\81ã\83£ã\83¼</translation>
</message>
<message>
- <source>MEN_IMPORTXAO</source>
- <translation>インポートしました。</translation>
+ <source>TOOL_GENERATION</source>
+ <translation>押し出し/回転</translation>
</message>
<message>
- <source>STB_IMPORTXAO</source>
- <translation>ソテーしたフォームをインポートします。</translation>
+ <source>TOOL_PRIMITIVES</source>
+ <translation>基本図形</translation>
</message>
<message>
- <source>GEOM_IMPORTEXPORT_204</source>
- <translation>エクスポートしました。</translation>
+ <source>TOOL_TRANSFORMATION</source>
+ <translation>変形/移動/回転</translation>
</message>
<message>
- <source>GEOM_SELECT_IMPORT_XAO</source>
- <translation>XAOからインポート</translation>
+ <source>TOOL_BUILD</source>
+ <translation>構築</translation>
</message>
<message>
- <source>GEOM_SELECT_EXPORT_XAO</source>
- <translation>エクスポートしました。</translation>
+ <source>TOOL_OPERATIONS</source>
+ <translation>操作</translation>
</message>
<message>
- <source>XAO_FILES</source>
- <translation>ファイルした (*.xao)</translation>
+ <source>TOOL_PICTURES</source>
+ <translation>画像</translation>
</message>
<message>
- <source>TOOLS_IMPORTEXPORT</source>
- <translation>インポート/エクスポート</translation>
+ <source>TOOL_ADVANCED</source>
+ <translation>高度なツール</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y</source>
- <translation>X=%1, Y=%2</translation>
+ <source>TOOL_MEASURES</source>
+ <translation>情報/測定</translation>
</message>
<message>
- <source>CC_PNT_ITEM_X_Y_Z</source>
- <translation>X=%1, Y=%2, Z=%3</translation>
+ <source>TOOL_IMPORTEXPORT</source>
+ <translation>インポート/エクスポート</translation>
</message>
</context>
<context>
</message>
</context>
<context>
- <name>RepairGUI_UnionFacesDlg</name>
+ <name>GEOMToolsGUI_ReduceStudyDlg</name>
<message>
- <source>GEOM_UNION_FACES_TITLE</source>
- <translation>共有面</translation>
+ <source>GEOM_REDUCE_STUDY_TITLE</source>
+ <translation type="unfinished">Reduce study</translation>
</message>
<message>
- <source>GEOM_UNION_FACES</source>
- <translation>オブジェクト面の共有</translation>
+ <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
+ <translation type="unfinished">Objects to be kept</translation>
</message>
<message>
- <source>UNION_FACES_NEW_OBJ_NAME</source>
- <translation>UnionFaces</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
+ <translation type="unfinished">Objects to be removed</translation>
</message>
- </context>
- <context>
- <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>CREATION_INFO_TITLE</source>
- <translation>情報</translation>
+ <source>GEOM_REDUCE_STUDY_NAME</source>
+ <translation type="unfinished">Name</translation>
</message>
<message>
- <source>OPERATION</source>
- <translation>操作</translation>
+ <source>GEOM_REDUCE_STUDY_OPTIONS</source>
+ <translation type="unfinished">Options</translation>
</message>
<message>
- <source>PARAMETER</source>
- <translation>パラメーター</translation>
+ <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
+ <translation type="unfinished">Intermediate objects</translation>
</message>
<message>
- <source>VALUE</source>
- <translation>値</translation>
+ <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
+ <translation type="unfinished">Sub-objects</translation>
</message>
<message>
- <source>NO_INFO</source>
- <translation>(有効情報なし)</translation>
+ <source>GEOM_REDUCE_STUDY_KEEP</source>
+ <translation type="unfinished">Keep</translation>
</message>
- </context>
- <context>
- <name>ImportExportGUI_ExportXAODlg</name>
<message>
- <source>GEOM_EXPORTXAO_TITLE</source>
- <translation>エクスポートしました。</translation>
+ <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
+ <translation type="unfinished">Unpublish</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO</source>
- <translation>エクスポートしました。</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE</source>
+ <translation type="unfinished">Remove</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_EXPORTINGSHAPE</source>
- <translation>オブジェクト</translation>
+ <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
+ <translation type="unfinished">Remove empty folders</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_FILENAME</source>
- <translation>ファイル</translation>
+ <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
+ <translation type="unfinished">Soft removal</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_AUTHOR</source>
- <translation>作成者</translation>
+ <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
+ <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
</message>
+ </context>
+ <context>
+ <name>RepairGUI_UnionFacesDlg</name>
<message>
- <source>GEOM_EXPORTXAO_LGROUPS</source>
- <translation>グループ</translation>
+ <source>GEOM_UNION_FACES_TITLE</source>
+ <translation>共有面</translation>
</message>
<message>
- <source>GEOM_EXPORTXAO_LFIELDS</source>
- <translation>ã\83\95ã\82£ã\83¼ã\83«ã\83\89</translation>
+ <source>GEOM_UNION_FACES</source>
+ <translation>ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88é\9d¢ã\81®å\85±æ\9c\89</translation>
</message>
<message>
- <source>EXPORT_DLG_ACCEPT</source>
- <translation>OK</translation>
+ <source>UNION_FACES_NEW_OBJ_NAME</source>
+ <translation>UnionFaces</translation>
</message>
</context>
<context>
- <name>ImportExportGUI_ImportXAODlg</name>
- <message>
- <source>GEOM_IMPORTXAO_TITLE</source>
- <translation>インポートしました。</translation>
- </message>
- <message>
- <source>GEOM_IMPORTXAO</source>
- <translation>インポートしました。</translation>
- </message>
+ <name>GEOMGUI_CreationInfoWdg</name>
<message>
- <source>GEOM_IMPORTXAO_IMPORTINGSHAPE</source>
- <translation>オブジェクト</translation>
+ <source>CREATION_INFO_TITLE</source>
+ <translation>情報</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_FILENAME</source>
- <translation>ファイル</translation>
+ <source>OPERATION</source>
+ <translation>操作</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LGROUPS</source>
- <translation>ã\82°ã\83«ã\83¼ã\83\97</translation>
+ <source>PARAMETER</source>
+ <translation>ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼</translation>
</message>
<message>
- <source>GEOM_IMPORTXAO_LFIELDS</source>
- <translation>フィールド</translation>
+ <source>VALUE</source>
+ <translation>値</translation>
</message>
<message>
- <source>STEP</source>
- <translation>Step</translation>
+ <source>NO_INFO</source>
+ <translation>(有効情報なし)</translation>
</message>
</context>
<context>
#include "GeometryGUI.h"
#include "GeometryGUI_Operations.h"
#include "GEOMPluginGUI.h"
-#include "GEOMGUI_XmlHandler.h"
#include "GEOMGUI_OCCSelector.h"
#include "GEOMGUI_Selection.h"
#include "GEOMGUI_CreationInfoWdg.h"
#include "GEOM_Constants.h"
#include "GEOM_Displayer.h"
#include "GEOM_AISShape.hxx"
+#include "GEOMUtils_XmlHandler.hxx"
#include "GEOM_Actor.h"
#include <SVTK_InteractorStyle.h>
#include <SVTK_ViewModel.h>
+#include <GraphicsView_Viewer.h>
+
#include <SalomeApp_Application.h>
#include <SalomeApp_DataObject.h>
#include <SalomeApp_Study.h>
#include <LightApp_Preferences.h>
#include <SALOME_LifeCycleCORBA.hxx>
-// #include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SALOMEDSClient_ClientFactory.hxx>
#include <SALOMEDSClient_IParameters.hxx>
#include <OSD_SharedLibrary.hxx>
#include <NCollection_DataMap.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
-#else
-#include <Graphic3d_HArray1OfBytes.hxx>
-#endif
#include <utilities.h>
SUIT_ViewWindow* window = desk->activeWindow();
bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
+ bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() );
// if current viewframe is not of OCC and not of VTK type - return immediately
// fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
QList<int> NotViewerDependentCommands;
<< GEOMOp::OpPointMarker
<< GEOMOp::OpCreateFolder
<< GEOMOp::OpSortChildren;
- if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommands.contains( id ) ) {
+ if ( !ViewOCC && !ViewVTK && !ViewDep && !NotViewerDependentCommands.contains( id ) ) {
// activate OCC viewer
getApp()->getViewManager(OCCViewer_Viewer::Type(), /*create=*/true);
}
case GEOMOp::OpOriginAndVectors: // MENU BASIC - ORIGIN AND BASE VECTORS
createOriginAndBaseVectors(); // internal operation
return;
- case GEOMOp::OpImport: // MENU FILE - IMPORT
- case GEOMOp::OpExport: // MENU FILE - EXPORT
case GEOMOp::OpSelectVertex: // POPUP MENU - SELECT ONLY - VERTEX
case GEOMOp::OpSelectEdge: // POPUP MENU - SELECT ONLY - EDGE
case GEOMOp::OpSelectWire: // POPUP MENU - SELECT ONLY - WIRE
case GEOMOp::OpClsBringToFront: //
case GEOMOp::OpCreateFolder: // POPUP MENU - CREATE FOLDER
case GEOMOp::OpSortChildren: // POPUP MENU - SORT CHILD ITEMS
+ case GEOMOp::OpShowDependencyTree: // POPUP MENU - SHOW DEPENDENCY TREE
+ case GEOMOp::OpReduceStudy: // POPUP MENU - REDUCE STUDY
libName = "GEOMToolsGUI";
break;
case GEOMOp::OpDMWireframe: // MENU VIEW - WIREFRAME
case GEOMOp::OpHide: // MENU VIEW - ERASE
case GEOMOp::OpShow: // MENU VIEW - DISPLAY
case GEOMOp::OpSwitchVectors: // MENU VIEW - VECTOR MODE
+ case GEOMOp::OpSwitchVertices: // MENU VIEW - VERTICES MODE
case GEOMOp::OpWireframe: // POPUP MENU - WIREFRAME
case GEOMOp::OpShading: // POPUP MENU - SHADING
case GEOMOp::OpShadingWithEdges: // POPUP MENU - SHADING WITH EDGES
case GEOMOp::OpTexture: // POPUP MENU - TEXTURE
case GEOMOp::OpVectors: // POPUP MENU - VECTORS
+ case GEOMOp::OpVertices: // POPUP MENU - VERTICES
libName = "DisplayGUI";
break;
case GEOMOp::OpPoint: // MENU BASIC - POINT
case GEOMOp::OpCreateField: // MENU FIELD - CREATE FIELD
case GEOMOp::OpEditField: // MENU FIELD - EDIT FIELD
case GEOMOp::OpEditFieldPopup: // POPUP MENU - EDIT FIELD
+ case GEOMOp::Op2dPolylineEditor: // MENU BASIC - POLYLINE EDITOR
libName = "EntityGUI";
break;
case GEOMOp::OpEdge: // MENU BUILD - EDGE
case GEOMOp::OpSharedShapes: // MENU OPERATION - GET SHARED SHAPES
case GEOMOp::OpExtrudedBoss: // MENU OPERATION - EXTRUDED BOSS
case GEOMOp::OpExtrudedCut: // MENU OPERATION - EXTRUDED CUT
-#ifdef DEBUG_CURVE_CREATOR
- // for debug purposes, to be removed
- case GEOMOp::OpCurveCreator: // MENU OPERATION - CURVE CREATOR
-#endif
libName = "OperationGUI";
break;
case GEOMOp::OpSewing: // MENU REPAIR - SEWING
case GEOMOp::OpExplodeBlock: // MENU BLOCKS - EXPLODE ON BLOCKS
libName = "BlocksGUI";
break;
- case GEOMOp::OpExportXAO: // MENU NEW ENTITY - IMPORTEXPORT - EXPORTXAO
- case GEOMOp::OpImportXAO: // MENU NEW ENTITY - IMPORTEXPORT - IMPORTXAO
- libName = "ImportExportGUI";
- break;
//case GEOMOp::OpAdvancedNoOp: // NO OPERATION (advanced operations base)
//case GEOMOp::OpPipeTShape: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE
//case GEOMOp::OpPipeTShapeGroups: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS
// ----- create actions --------------
- createGeomAction( GEOMOp::OpImport, "IMPORT", "", Qt::ControlModifier + Qt::Key_I );
- createGeomAction( GEOMOp::OpExport, "EXPORT", "", Qt::ControlModifier + Qt::Key_E );
-
createGeomAction( GEOMOp::OpDelete, "DELETE", "", Qt::Key_Delete );
createGeomAction( GEOMOp::OpPoint, "POINT" );
createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" );
#endif
createGeomAction( GEOMOp::OpPictureImport,"PICTURE_IMPORT" );
+ createGeomAction( GEOMOp::Op2dPolylineEditor, "CURVE_CREATOR" );
createGeomAction( GEOMOp::OpEdge, "EDGE" );
createGeomAction( GEOMOp::OpWire, "WIRE" );
createGeomAction( GEOMOp::OpSharedShapes, "GET_SHARED_SHAPES" );
createGeomAction( GEOMOp::OpExtrudedCut, "EXTRUDED_CUT" );
createGeomAction( GEOMOp::OpExtrudedBoss, "EXTRUDED_BOSS" );
-#ifdef DEBUG_CURVE_CREATOR
- // for debug purposes, to be removed
- createGeomAction( GEOMOp::OpCurveCreator, "CURVE_CREATOR" );
-#endif
createGeomAction( GEOMOp::OpFillet1d, "FILLET_1D" );
createGeomAction( GEOMOp::OpFillet2d, "FILLET_2D" );
createGeomAction( GEOMOp::OpHideAll, "ERASE_ALL" );
createGeomAction( GEOMOp::OpShow, "DISPLAY" );
createGeomAction( GEOMOp::OpSwitchVectors, "VECTOR_MODE");
+ createGeomAction( GEOMOp::OpSwitchVertices, "VERTICES_MODE");
createGeomAction( GEOMOp::OpSelectVertex, "VERTEX_SEL_ONLY" ,"", 0, true );
createGeomAction( GEOMOp::OpSelectEdge, "EDGE_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpSelectWire, "WIRE_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpEdgeWidth, "EDGE_WIDTH");
createGeomAction( GEOMOp::OpIsosWidth, "ISOS_WIDTH");
createGeomAction( GEOMOp::OpVectors, "POP_VECTORS", "", 0, true );
+ createGeomAction( GEOMOp::OpVertices, "POP_VERTICES", "", 0, true );
createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" );
createGeomAction( GEOMOp::OpColor, "POP_COLOR" );
createGeomAction( GEOMOp::OpSetTexture, "POP_SETTEXTURE" );
createGeomAction( GEOMOp::OpPredefMaterCustom, "POP_PREDEF_MATER_CUSTOM" );
createGeomAction( GEOMOp::OpCreateFolder, "POP_CREATE_FOLDER" );
createGeomAction( GEOMOp::OpSortChildren, "POP_SORT_CHILD_ITEMS" );
+ createGeomAction( GEOMOp::OpShowDependencyTree, "POP_SHOW_DEPENDENCY_TREE" );
+ createGeomAction( GEOMOp::OpReduceStudy, "POP_REDUCE_STUDY" );
createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
createGeomAction( GEOMOp::OpDecrNbIsos, "", "", 0, false,
"Geometry:Decrease number of isolines");
- // Import/Export XAO
- createGeomAction( GEOMOp::OpExportXAO, "EXPORTXAO" );
- createGeomAction( GEOMOp::OpImportXAO, "IMPORTXAO" );
-
//createGeomAction( GEOMOp::OpPipeTShape, "PIPETSHAPE" );
//createGeomAction( GEOMOp::OpDividedDisk, "DIVIDEDDISK" );
//createGeomAction( GEOMOp::OpDividedCylinder, "DIVIDEDCYLINDER" );
// ---- create menus --------------------------
int fileId = createMenu( tr( "MEN_FILE" ), -1, -1 );
- createMenu( separator(), fileId, 10 );
- createMenu( GEOMOp::OpImport, fileId, 10 );
- createMenu( GEOMOp::OpExport, fileId, 10 );
- int impexpId = createMenu( tr( "MEN_IMPORTEXPORT" ), fileId, -1, 10 );
- createMenu( GEOMOp::OpExportXAO, impexpId, -1 );
- createMenu( GEOMOp::OpImportXAO, impexpId, -1 );
- createMenu( separator(), fileId, -1 );
int editId = createMenu( tr( "MEN_EDIT" ), -1, -1 );
createMenu( GEOMOp::OpDelete, editId, -1 );
int newEntId = createMenu( tr( "MEN_NEW_ENTITY" ), -1, -1, 10 );
int basicId = createMenu( tr( "MEN_BASIC" ), newEntId, -1 );
- createMenu( GEOMOp::OpPoint, basicId, -1 );
- createMenu( GEOMOp::OpLine, basicId, -1 );
- createMenu( GEOMOp::OpCircle, basicId, -1 );
- createMenu( GEOMOp::OpEllipse, basicId, -1 );
- createMenu( GEOMOp::OpArc, basicId, -1 );
- createMenu( GEOMOp::OpCurve, basicId, -1 );
- createMenu( GEOMOp::Op2dSketcher, basicId, -1 );
- createMenu( GEOMOp::Op3dSketcher, basicId, -1 );
- createMenu( GEOMOp::OpIsoline, basicId, -1 );
- createMenu( separator(), basicId, -1 );
- createMenu( GEOMOp::OpVector, basicId, -1 );
- createMenu( GEOMOp::OpPlane, basicId, -1 );
- createMenu( GEOMOp::OpLCS, basicId, -1 );
+ createMenu( GEOMOp::OpPoint, basicId, -1 );
+ createMenu( GEOMOp::OpLine, basicId, -1 );
+ createMenu( GEOMOp::OpCircle, basicId, -1 );
+ createMenu( GEOMOp::OpEllipse, basicId, -1 );
+ createMenu( GEOMOp::OpArc, basicId, -1 );
+ createMenu( GEOMOp::OpCurve, basicId, -1 );
+ createMenu( GEOMOp::Op2dSketcher, basicId, -1 );
+ createMenu( GEOMOp::Op2dPolylineEditor, basicId, -1 );
+ createMenu( GEOMOp::Op3dSketcher, basicId, -1 );
+ createMenu( GEOMOp::OpIsoline, basicId, -1 );
+ createMenu( separator(), basicId, -1 );
+ createMenu( GEOMOp::OpVector, basicId, -1 );
+ createMenu( GEOMOp::OpPlane, basicId, -1 );
+ createMenu( GEOMOp::OpLCS, basicId, -1 );
createMenu( GEOMOp::OpOriginAndVectors, basicId, -1 );
int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 );
createMenu( GEOMOp::OpRevolution, genId, -1 );
createMenu( GEOMOp::OpFilling, genId, -1 );
createMenu( GEOMOp::OpPipe, genId, -1 );
-#if OCC_VERSION_LARGE > 0x06050300
createMenu( GEOMOp::OpPipePath, genId, -1 );
-#endif
//int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
//createMenu( GEOMOp::OpSmoothingSurface, advId, -1 );
createMenu( GEOMOp::OpChamfer, operId, -1 );
createMenu( GEOMOp::OpExtrudedBoss, operId, -1 );
createMenu( GEOMOp::OpExtrudedCut, operId, -1 );
-#ifdef DEBUG_CURVE_CREATOR
- // for debug purposes, to be removed
- createMenu( separator(), operId, -1 );
- createMenu( GEOMOp::OpCurveCreator, operId, -1 );
-#endif
//createMenu( GEOMOp::OpClipping, operId, -1 );
int repairId = createMenu( tr( "MEN_REPAIR" ), -1, -1, 10 );
createMenu( GEOMOp::OpDMTexture, dispmodeId, -1 );
createMenu( separator(), dispmodeId, -1 );
createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 );
+ createMenu( GEOMOp::OpSwitchVertices, dispmodeId, -1 );
createMenu( separator(), viewId, -1 );
createMenu( GEOMOp::OpShowAll, viewId, -1 );
// ---- create toolbars --------------------------
- int basicTbId = createTool( tr( "TOOL_BASIC" ) );
- createTool( GEOMOp::OpPoint, basicTbId );
- createTool( GEOMOp::OpLine, basicTbId );
- createTool( GEOMOp::OpCircle, basicTbId );
- createTool( GEOMOp::OpEllipse, basicTbId );
- createTool( GEOMOp::OpArc, basicTbId );
- createTool( GEOMOp::OpCurve, basicTbId );
- createTool( GEOMOp::OpVector, basicTbId );
- createTool( GEOMOp::Op2dSketcher, basicTbId ); //rnc
- createTool( GEOMOp::Op3dSketcher, basicTbId ); //rnc
- createTool( GEOMOp::OpIsoline, basicTbId );
- createTool( GEOMOp::OpPlane, basicTbId );
- createTool( GEOMOp::OpLCS, basicTbId );
+ int basicTbId = createTool( tr( "TOOL_BASIC" ), QString( "GEOMBasic" ) );
+ createTool( GEOMOp::OpPoint, basicTbId );
+ createTool( GEOMOp::OpLine, basicTbId );
+ createTool( GEOMOp::OpCircle, basicTbId );
+ createTool( GEOMOp::OpEllipse, basicTbId );
+ createTool( GEOMOp::OpArc, basicTbId );
+ createTool( GEOMOp::OpCurve, basicTbId );
+ createTool( GEOMOp::OpVector, basicTbId );
+ createTool( GEOMOp::Op2dSketcher, basicTbId ); //rnc
+ createTool( GEOMOp::Op2dPolylineEditor, basicTbId );
+ createTool( GEOMOp::Op3dSketcher, basicTbId ); //rnc
+ createTool( GEOMOp::OpIsoline, basicTbId );
+ createTool( GEOMOp::OpPlane, basicTbId );
+ createTool( GEOMOp::OpLCS, basicTbId );
createTool( GEOMOp::OpOriginAndVectors, basicTbId );
-// int sketchTbId = createTool( tr( "TOOL_SKETCH" ) );
+// int sketchTbId = createTool( tr( "TOOL_SKETCH" ), QString( "GEOMSketch" ) );
// createTool( GEOMOp::Op2dSketcher, sketchTbId );
// createTool( GEOMOp::Op3dSketcher, sketchTbId );
- int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) );
+ int primTbId = createTool( tr( "TOOL_PRIMITIVES" ), QString( "GEOMPrimitives" ) );
createTool( GEOMOp::OpBox, primTbId );
createTool( GEOMOp::OpCylinder, primTbId );
createTool( GEOMOp::OpSphere, primTbId );
createTool( GEOMOp::OpDisk, primTbId );
//createTool( GEOMOp::OpPipeTShape, primTbId ); //rnc
- //int blocksTbId = createTool( tr( "TOOL_BLOCKS" ) );
+ //int blocksTbId = createTool( tr( "TOOL_BLOCKS" ), QString( "GEOMBlocks" ) );
//createTool( GEOMOp::OpDividedDisk, blocksTbId );
//createTool( GEOMOp::OpDividedCylinder, blocksTbId );
- int boolTbId = createTool( tr( "TOOL_BOOLEAN" ) );
+ int boolTbId = createTool( tr( "TOOL_BOOLEAN" ), QString( "GEOMBooleanOperations" ) );
createTool( GEOMOp::OpFuse, boolTbId );
createTool( GEOMOp::OpCommon, boolTbId );
createTool( GEOMOp::OpCut, boolTbId );
createTool( GEOMOp::OpSection, boolTbId );
- int genTbId = createTool( tr( "TOOL_GENERATION" ) );
+ int genTbId = createTool( tr( "TOOL_GENERATION" ), QString( "GEOMGeneration" ) );
createTool( GEOMOp::OpPrism, genTbId );
createTool( GEOMOp::OpRevolution, genTbId );
createTool( GEOMOp::OpFilling, genTbId );
createTool( GEOMOp::OpPipe, genTbId );
-#if OCC_VERSION_LARGE > 0x06050300
createTool( GEOMOp::OpPipePath, genTbId );
-#endif
- int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ) );
+ int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ), QString( "GEOMTransformation" ) );
createTool( GEOMOp::OpTranslate, transTbId );
createTool( GEOMOp::OpRotate, transTbId );
createTool( GEOMOp::OpChangeLoc, transTbId );
createTool( GEOMOp::OpMultiTranslate, transTbId );
createTool( GEOMOp::OpMultiRotate, transTbId );
- int operTbId = createTool( tr( "TOOL_OPERATIONS" ) );
+ int operTbId = createTool( tr( "TOOL_OPERATIONS" ), QString( "GEOMOperations" ) );
createTool( GEOMOp::OpExplode, operTbId );
createTool( GEOMOp::OpPartition, operTbId );
createTool( GEOMOp::OpArchimede, operTbId );
createTool( GEOMOp::OpShapesOnShape, operTbId );
createTool( GEOMOp::OpSharedShapes, operTbId );
- int featTbId = createTool( tr( "TOOL_FEATURES" ) );
+ int featTbId = createTool( tr( "TOOL_FEATURES" ), QString( "GEOMModification" ) );
createTool( GEOMOp::OpFillet1d, featTbId );
createTool( GEOMOp::OpFillet2d, featTbId );
createTool( GEOMOp::OpFillet3d, featTbId );
createTool( GEOMOp::OpChamfer, featTbId );
createTool( GEOMOp::OpExtrudedBoss, featTbId );
createTool( GEOMOp::OpExtrudedCut, featTbId );
-#ifdef DEBUG_CURVE_CREATOR
- // for debug purposes, to be removed
- createTool( GEOMOp::OpCurveCreator, featTbId );
-#endif
- int buildTbId = createTool( tr( "TOOL_BUILD" ) );
+ int buildTbId = createTool( tr( "TOOL_BUILD" ), QString( "GEOMBuild" ) );
createTool( GEOMOp::OpEdge, buildTbId );
createTool( GEOMOp::OpWire, buildTbId );
createTool( GEOMOp::OpFace, buildTbId );
createTool( GEOMOp::OpSolid, buildTbId );
createTool( GEOMOp::OpCompound, buildTbId );
- int measureTbId = createTool( tr( "TOOL_MEASURES" ) );
+ int measureTbId = createTool( tr( "TOOL_MEASURES" ), QString( "GEOMMeasures" ) );
createTool( GEOMOp::OpPointCoordinates, measureTbId );
createTool( GEOMOp::OpProperties, measureTbId );
createTool( GEOMOp::OpCenterMass, measureTbId );
createTool( GEOMOp::OpGetNonBlocks, measureTbId );
createTool( GEOMOp::OpCheckSelfInters, measureTbId );
- int picturesTbId = createTool( tr( "TOOL_PICTURES" ) );
+ int picturesTbId = createTool( tr( "TOOL_PICTURES" ), QString( "GEOMPictures" ) );
createTool( GEOMOp::OpPictureImport, picturesTbId );
#ifdef WITH_OPENCV
createTool( GEOMOp::OpFeatureDetect, picturesTbId );
#endif
- int impexpTbId = createTool( tr( "TOOL_IMPORTEXPORT" ) );
- createTool( GEOMOp::OpExportXAO, impexpTbId );
- createTool( GEOMOp::OpImportXAO, impexpTbId );
-
//int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) );
//createTool( GEOMOp::OpSmoothingSurface, advancedTbId );
//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@//
mgr->setRule( action( GEOMOp::OpGroupEdit ), QString("client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true"), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
-#if OCC_VERSION_LARGE > 0x06050200
//QString bringRule = clientOCCorOB + " and ($component={'GEOM'}) and (selcount>0) and isOCC=true and topLevel=false";
QString bringRule = clientOCCorOB + " and ($component={'GEOM'}) and isFolder=false and (selcount>0) and isOCC=true";
mgr->insert( action(GEOMOp::OpBringToFront ), -1, -1 ); // bring to front
mgr->setRule(action(GEOMOp::OpBringToFront), "topLevel=true", QtxPopupMgr::ToggleRule );
mgr->insert( action(GEOMOp::OpClsBringToFront ), -1, -1 ); // clear bring to front
mgr->setRule( action(GEOMOp::OpClsBringToFront ), clientOCC + " and autoBringToFront = false", QtxPopupMgr::VisibleRule );
-#endif
mgr->insert( separator(), -1, -1 ); // -----------
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
mgr->insert( action( GEOMOp::OpWireframe ), dispmodeId, -1 ); // wireframe
mgr->insert( action( GEOMOp::OpVectors ), dispmodeId, -1 ); // vectors
mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK + " and isVectorsMode", QtxPopupMgr::ToggleRule );
+ mgr->insert( action( GEOMOp::OpVertices ), dispmodeId, -1 ); // vertices
+ mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK + " and isVerticesMode", QtxPopupMgr::ToggleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpColor ), -1, -1 ); // color
mgr->insert( action( GEOMOp::OpDeflection ), -1, -1 ); // deflection
mgr->setRule( action( GEOMOp::OpDeflection ), clientOCCorVTK_AndSomeVisible + " and selcount>0 and isVisible" + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker
- //mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule );
- mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and ( $typeid in {%1} or compoundOfVertices=true ) " ).arg(GEOM::VERTEX).arg(GEOM::COMPOUND), QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpPointMarker ), clientOCCorOB + " and $type in {'Shape' 'Group' 'Field' 'FieldStep'} and selcount>0 and isOCC=true", QtxPopupMgr::VisibleRule );
// material properties
mgr->insert( action( GEOMOp::OpMaterialProperties ), -1, -1 );
mgr->insert( action( GEOMOp::OpSortChildren ), -1, -1 ); // Sort child items
mgr->setRule( action( GEOMOp::OpSortChildren ), QString("client='ObjectBrowser' and $component={'GEOM'} and nbChildren>1"), QtxPopupMgr::VisibleRule );
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( GEOMOp::OpShowDependencyTree ), -1, -1 ); // Show dependency tree
+ mgr->setRule( action( GEOMOp::OpShowDependencyTree ), clientOCCorVTKorOB + " and selcount>0 and ($component={'GEOM'}) and type='Shape'", QtxPopupMgr::VisibleRule );
+
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( GEOMOp::OpReduceStudy ), -1, -1 ); // Reduce Study
+ mgr->setRule( action( GEOMOp::OpReduceStudy ), clientOCCorVTKorOB + " and selcount>0 and ($component={'GEOM'}) and type='Shape'", QtxPopupMgr::VisibleRule );
+
mgr->hide( mgr->actionId( action( myEraseAll ) ) );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if (!resMgr) return;
- // Find names of a resource XML files ("GEOMActions.xml" and others);
- QString PluginsXml;
- char* cenv = getenv("GEOM_PluginsList");
- if (cenv)
- PluginsXml.sprintf("%s", cenv);
-
- QStringList PluginsXmlList = PluginsXml.split(":", QString::SkipEmptyParts);
- if (PluginsXmlList.count() == 0) return;
-
- // get full names of xml files from PluginsXmlList
- QStringList xmlFiles;
- xmlFiles.append(QDir::home().filePath("CustomGeomPlugins.xml")); // may be inexistent
- for (int i = 0; i < PluginsXmlList.count(); i++) {
- PluginsXml = PluginsXmlList[ i ];
-
- // Find full path to the resource XML file
- QString xmlFile = resMgr->path("resources", "GEOM", PluginsXml + ".xml");
- if ( xmlFile.isEmpty() ) // try PLUGIN resources
- xmlFile = resMgr->path("resources", PluginsXml, PluginsXml + ".xml");
- if ( !xmlFile.isEmpty() )
- xmlFiles.append( xmlFile );
- }
-
- // create "Advanced Operations" menu and corresponding toolbar
- //int advancedMenuId = createMenu(tr("MEN_ADVANCED"), -1, -1, 10);
- //int advancedTbarId = createTool(tr("TOOL_ADVANCED"));
- int id = GEOMOp::OpLastOperationID; // TODO?
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ if (!appStudy) return;
- // loop on xmlFiles
- QString aNoAccessFiles;
- for (int i = 0; i < xmlFiles.count(); i++) {
- QString xmlFile = xmlFiles[ i ];
-
- QFile file (xmlFile);
- if (file.exists() && file.open(QIODevice::ReadOnly)) {
- file.close();
-
- GEOMGUI_XmlHandler* aXmlHandler = new GEOMGUI_XmlHandler();
- ASSERT(aXmlHandler);
-
- QXmlInputSource source (&file);
- QXmlSimpleReader reader;
- reader.setContentHandler(aXmlHandler);
- reader.setErrorHandler(aXmlHandler);
- bool ok = reader.parse(source);
- file.close();
-
- if (ok) {
- // bind action lib and label to its ID for activateOperation() method proper work
- myPluginLibs[aXmlHandler->myPluginData.myName] = aXmlHandler->myPluginData.myClientLib;
-
- QListIterator<GEOMGUI_ActionData> anActionsIter (aXmlHandler->myPluginData.myListOfActions);
- while (anActionsIter.hasNext()) {
- GEOMGUI_ActionData anActionData = anActionsIter.next();
-
- //QPixmap icon = resMgr->loadPixmap("GEOM", tr(anActionData.myIcon.toLatin1().constData()));
- QPixmap icon = resMgr->loadPixmap(aXmlHandler->myPluginData.myName,
- anActionData.myIcon.toLatin1().constData());
-
- // path to action in menu
- QStringList smenus = anActionData.myMenu.split( "/" );
- QString actionName = smenus.last();
- actionName = actionName.toUpper().prepend("MEN_");
- smenus.removeLast();
-
- // path to action in toolbar
- QStringList stools = anActionData.myTooltip.split( "/" );
- QString actionTool = stools.last();
- actionTool = actionTool.toUpper().prepend("TOP_");
- stools.removeLast();
-
- QString actionStat = anActionData.myStatusBar;
- actionStat = actionStat.toUpper().prepend("STB_");
-
- createAction(id, // ~ anActionData.myLabel
- tr(actionTool.toLatin1().constData()),
- icon,
- tr(actionName.toLatin1().constData()),
- tr(actionStat.toLatin1().constData()),
- 0 /*accel*/,
- application()->desktop(),
- false /*toggle*/,
- this, SLOT(OnGUIEvent()),
- QString() /*shortcutAction*/);
-
- int menuId = -1;
- foreach (QString subMenu, smenus) {
- subMenu = subMenu.toUpper().prepend("MEN_");
- menuId = createMenu(tr(subMenu.toLatin1().constData()), menuId, -1);
- }
- //createMenu(id, pluginMenuId, -1);
- createMenu(id, menuId, -1);
+ // Find names of a resource XML files ("AdvancedGEOM.xml" and others);
- QString subTool = stools[0];
- subTool = subTool.toUpper().prepend("TOOL_");
- int toolId = createTool(tr(subTool.toLatin1().constData()));
- //createTool(id, advancedTbarId);
- createTool(id, toolId);
+ GEOMUtils::PluginInfo plugins = GEOMUtils::ReadPluginInfo();
- // add action id to map
- PluginAction anAction (aXmlHandler->myPluginData.myClientLib, anActionData.myLabel);
- myPluginActions[id] = anAction;
+ int id = GEOMOp::OpLastOperationID; // TODO?
- id++;
- }
+ // loop on plugins
+ GEOMUtils::PluginInfo::const_iterator it;
+ for ( it = plugins.begin(); it != plugins.end(); ++it ) {
+ // bind action lib and label to its ID for activateOperation() method proper work
+ GEOMUtils::PluginData pdata = (*it);
+ myPluginLibs[pdata.name.c_str()] = pdata.clientLib.c_str();
+ std::list<GEOMUtils::ActionData> actions = (*it).actions;
+ std::list<GEOMUtils::ActionData>::const_iterator ait;
+ for ( ait = actions.begin(); ait != actions.end(); ++ait ) {
+ GEOMUtils::ActionData adata = (*ait);
+ // icon
+ QPixmap icon;
+ if ( !adata.icon.empty() )
+ icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
+ // menu text (path)
+ QStringList smenus = QString( adata.menuText.c_str() ).split( "/" );
+ QString actionName = smenus.last();
+ actionName = actionName.toUpper().prepend( "MEN_" );
+ smenus.removeLast();
+
+ // path to action in toolbar
+ QStringList stools = QString( adata.toolTip.c_str() ).split( "/" );
+ QString actionTool = stools.last();
+ actionTool = actionTool.toUpper().prepend( "TOP_" );
+ stools.removeLast();
+
+ QString actionStat = adata.statusText.c_str();
+ actionStat = actionStat.toUpper().prepend( "STB_" );
+
+ createAction( id, // ~ adata.label
+ tr( actionTool.toLatin1().constData() ),
+ icon,
+ tr( actionName.toLatin1().constData() ),
+ tr( actionStat.toLatin1().constData() ),
+ QKeySequence( tr( adata.accel.c_str() ) ),
+ application()->desktop(),
+ false /*toggle*/,
+ this, SLOT( OnGUIEvent() ),
+ QString() /*shortcutAction*/ );
+
+ int menuId = -1;
+ foreach ( QString subMenu, smenus ) {
+ QStringList subMenuList = subMenu.split( ":" );
+ QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
+ int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
+ menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
}
- else {
- SUIT_MessageBox::critical(application()->desktop(),
- tr("INF_PARSE_ERROR"),
- tr(aXmlHandler->errorProtocol().toLatin1().data()));
+ createMenu( id, menuId, -1 );
+
+ if ( !stools.isEmpty() ) {
+ QString subTool = stools[0];
+ subTool = subTool.toUpper().prepend( "TOOL_" );
+ int toolId = createTool( tr( subTool.toLatin1().constData() ) );
+ createTool(id, toolId);
}
- delete aXmlHandler;
- }
- else if ( i > 0 ) { // 1st is ~/CustomGeomPlugins.xml
- if (aNoAccessFiles.isEmpty())
- aNoAccessFiles = xmlFile;
- else
- aNoAccessFiles += ", " + xmlFile;
- }
- } // end loop on xmlFiles
- if (!aNoAccessFiles.isEmpty()) {
- QString aMess = QObject::tr("PLUGIN_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
- aMess += QObject::tr("PLUGIN_FILE_CHECK_VARIABLE");
- SUIT_MessageBox::warning(application()->desktop(), tr("GEOM_WRN_WARNING"), aMess);
+ // add action id to map
+ PluginAction anAction( pdata.clientLib.c_str(), adata.label.c_str() );
+ myPluginActions[id] = anAction;
+
+ id++;
+ }
}
}
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
// Reset actions accelerator keys
- action(GEOMOp::OpImport)->setEnabled( true ); // Import: CTRL + Key_I
- action(GEOMOp::OpExport)->setEnabled( true ); // Export: CTRL + Key_E
action(GEOMOp::OpDelete)->setEnabled( true ); // Delete: Key_Delete
GUIMap::Iterator it;
getApp()->insertDockWindow( myCreationInfoWdg->getWinID(), myCreationInfoWdg );
getApp()->placeDockWindow( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
+ //NPAL 19674
+ SALOME_ListIO selected;
+ sm->selectedObjects( selected );
+ sm->clearSelected();
+
SUIT_ViewManager* vm;
ViewManagerList OCCViewManagers, VTKViewManagers;
application()->viewManagers( OCCViewer_Viewer::Type(), OCCViewManagers );
QListIterator<SUIT_ViewManager*> itOCC( OCCViewManagers );
while ( itOCC.hasNext() && (vm = itOCC.next()) )
- myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
+ onViewManagerAdded(vm);
application()->viewManagers( SVTK_Viewer::Type(), VTKViewManagers );
QListIterator<SUIT_ViewManager*> itVTK( VTKViewManagers );
while ( itVTK.hasNext() && (vm = itVTK.next()) )
- myVTKSelectors.append( new LightApp_VTKSelector( dynamic_cast<SVTK_Viewer*>( vm->getViewModel() ), sm ) );
-
- //NPAL 19674
- SALOME_ListIO selected;
- sm->selectedObjects( selected );
- sm->clearSelected();
-
- // disable OCC selectors
- getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
- QListIterator<GEOMGUI_OCCSelector*> itOCCSel( myOCCSelectors );
- while ( itOCCSel.hasNext() )
- if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() )
- sr->setEnabled(true);
-
- // disable VTK selectors
- getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
- QListIterator<LightApp_VTKSelector*> itVTKSel( myVTKSelectors );
- while ( itVTKSel.hasNext() )
- if ( LightApp_VTKSelector* sr = itVTKSel.next() )
- sr->setEnabled(true);
+ onViewManagerAdded(vm);
sm->setSelectedObjects( selected, true ); //NPAL 19674
it.value()->deactivate();
// Unset actions accelerator keys
- action(GEOMOp::OpImport)->setEnabled( false ); // Import: CTRL + Key_I
- action(GEOMOp::OpExport)->setEnabled( false ); // Export: CTRL + Key_E
action(GEOMOp::OpDelete)->setEnabled( false ); // Delete: Key_Delete
qDeleteAll(myOCCSelectors);
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
QString name = info->operationName.in();
if ( !name.isEmpty() ) {
- icon = resMgr->loadPixmap( "GEOM", tr( ("ICO_"+name).toLatin1().constData() ), false );
+
+ QString plugin_name;
+ for ( size_t i = 0; i < info->params.length(); ++i ) {
+ myCreationInfoWdg->addParam( info->params[i].name.in(),
+ info->params[i].value.in() );
+ QString value = info->params[i].name.in();
+ if( value == PLUGIN_NAME ) {
+ plugin_name = info->params[i].value.in();
+ }
+ }
+ QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
+ icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
operationName = tr( ("MEN_"+name).toLatin1().constData() );
if ( operationName.startsWith( "MEN_" ))
operationName = name; // no translation
myCreationInfoWdg->setOperation( icon, operationName );
-
- for ( size_t i = 0; i < info->params.length(); ++i )
- myCreationInfoWdg->addParam( info->params[i].name.in(),
- info->params[i].value.in() );
}
}
}
void GeometryGUI::onAutoBringToFront()
{
- bool isAutoBringToFront = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front" );
+ bool isAutoBringToFront = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "auto_bring_to_front", "false" );
if( !isAutoBringToFront )
return;
return "";
}
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture
-#else
-Handle(Graphic3d_HArray1OfBytes) GeometryGUI::getTexture
-#endif
(SalomeApp_Study* theStudy, int theId, int& theWidth, int& theHeight)
{
theWidth = theHeight = 0;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture;
-#else
- Handle(Graphic3d_HArray1OfBytes) aTexture;
-#endif
if (theStudy) {
TextureMap aTextureMap = myTextureMap[ theStudy->studyDS()->StudyId() ];
theWidth = aWidth;
theHeight = aHeight;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
aTexture = new TColStd_HArray1OfByte (1, aStream->length());
-#else
- aTexture = new Graphic3d_HArray1OfBytes (1, aStream->length());
-#endif
for (int i = 0; i < aStream->length(); i++)
aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
int top_lev_dm = addPreference( tr( "PREF_TOPLEVEL_DM" ), genGroup,
LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
- int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
- LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
+ int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
+ LightApp_Preferences::IntSpin, "Geometry", "transparency" );
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
setPreferenceProperty( wd[i], "max", 5 );
}
+ int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
+ LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
+
addPreference( tr( "PREF_AUTO_BRING_TO_FRONT" ), genGroup,
LightApp_Preferences::Bool, "Geometry", "auto_bring_to_front" );
setPreferenceProperty( step, "max", 10000 );
setPreferenceProperty( step, "precision", 3 );
+ // Set property for trandparency value for spinboxes
+ setPreferenceProperty( transparency, "min", 0 );
+ setPreferenceProperty( transparency, "max", 100 );
+
// Set property for deflection value for spinboxes
setPreferenceProperty( defl, "min", GEOM::minDeflection() );
setPreferenceProperty( defl, "max", 1.0 );
addPreference( tr( "GEOM_PREVIEW" ), operationsGroup,
LightApp_Preferences::Bool, "Geometry", "geom_preview" );
+
+ int DependencyViewId = addPreference( tr( "PREF_TAB_DEPENDENCY_VIEW" ) );
+
+ int treeGeneralGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), DependencyViewId );
+
+ int hierarchy_type = addPreference( tr( "PREF_HIERARCHY_TYPE" ), treeGeneralGroup,
+ LightApp_Preferences::Selector, "Geometry", "dependency_tree_hierarchy_type" );
+
+ QStringList aHierarchyTypeList;
+ aHierarchyTypeList.append( tr("MEN_BOTH_ASCENDANTS_DESCENDANTS") );
+ aHierarchyTypeList.append( tr("MEN_ONLY_ASCENDANTS") );
+ aHierarchyTypeList.append( tr("MEN_ONLY_DESCENDANTS") );
+
+ QList<QVariant> aHierarchyTypeIndexesList;
+ aHierarchyTypeIndexesList.append(0);
+ aHierarchyTypeIndexesList.append(1);
+ aHierarchyTypeIndexesList.append(2);
+
+ setPreferenceProperty( hierarchy_type, "strings", aHierarchyTypeList );
+ setPreferenceProperty( hierarchy_type, "indexes", aHierarchyTypeIndexesList );
+
+ addPreference( tr( "GEOM_MOVE_POSSIBILITY" ), treeGeneralGroup,
+ LightApp_Preferences::Bool, "Geometry", "dependency_tree_move_nodes" );
+
+ int treeColorGroup = addPreference( tr( "PREF_GROUP_DEPENDENCY_VIEW_COLOR" ), DependencyViewId );
+
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_background_color" );
+
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_NODE_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_node_color" );
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_main_node_color" );
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_unpublish_node_color" );
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_select_node_color" );
+
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_ARROW_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_arrow_color" );
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_highlight_arrow_color" );
+ addPreference( tr( "PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR"), treeColorGroup,
+ LightApp_Preferences::Color, "Geometry", "dependency_tree_select_arrow_color" );
+
+
+
+
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
aDisplayer.UpdateViewer();
}
+ else if ( param.startsWith( "dependency_tree") )
+ emit SignalDependencyTreeParamChanged( section, param );
}
}
// saving VTK actors properties
QVector<SUIT_ViewWindow*> views = vman->getViews();
for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++) {
- const ObjMap anObjects = appStudy->getObjectMap(aMgrId);
+ const ObjMap& anObjects = appStudy->getObjectProperties(aMgrId);
ObjMap::ConstIterator o_it = anObjects.begin();
for (; o_it != anObjects.end(); o_it++) {
- const PropMap aProps = o_it.value();
+ const PropMap& aProps = o_it.value();
//Check that object exists in the study
_PTR(SObject) obj( studyDS->FindObjectID( o_it.key().toLatin1().data() ) );
ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::EdgesDirection )).toString().toStdString());
}
+ if (aProps.contains(GEOM::propertyName( GEOM::Vertices ))) {
+ param = occParam + GEOM::propertyName( GEOM::Vertices );
+ ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Vertices )).toString().toStdString());
+ }
+
if (aProps.contains(GEOM::propertyName( GEOM::Deflection ))) {
param = occParam + GEOM::propertyName( GEOM::Deflection );
ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Deflection )).toString().toStdString());
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Texture ), val );
} else if (paramNameStr == GEOM::propertyName( GEOM::EdgesDirection )) {
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::EdgesDirection ), val == "true" || val == "1");
+ } else if (paramNameStr == GEOM::propertyName( GEOM::Vertices )) {
+ aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Vertices ), val == "true" || val == "1");
} else if (paramNameStr == GEOM::propertyName( GEOM::Deflection )) {
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Deflection ), val.toDouble());
} else if (paramNameStr == GEOM::propertyName( GEOM::PointMarker )) {
QList<SUIT_ViewManager*> lst = getApp()->viewManagers();
for (int index = 0; index < aListOfMap.count(); index++) {
-
- appStudy->setObjectPropMap(index, entry, aListOfMap[index]);
+ appStudy->setObjectProperties(index, entry, aListOfMap[index]);
//Get Visibility property of the current PropMap
if (aListOfMap[index].value(GEOM::propertyName( GEOM::Visibility )) == 1) {
{
SUIT_ViewWindow* window = application()->desktop()->activeWindow();
QAction* a = action( GEOMOp::OpSwitchVectors );
+ QAction* aVerticesAction = action( GEOMOp::OpSwitchVertices );
if ( window ) {
a->setEnabled(true);
bool vmode = window->property("VectorsMode").toBool();
a->setText ( vmode == 1 ? tr( "MEN_VECTOR_MODE_OFF" ) : tr("MEN_VECTOR_MODE_ON") );
+ aVerticesAction->setEnabled(true);
+ vmode = window->property("VerticesMode").toBool();
+ aVerticesAction->setText ( vmode == 1 ? tr( "MEN_VERTICES_MODE_OFF" ) : tr("MEN_VERTICES_MODE_ON") );
} else {
a->setText ( tr("MEN_VECTOR_MODE_ON") );
a->setEnabled(false);
+ aVerticesAction->setText ( tr("MEN_VERTICES_MODE_ON") );
+ aVerticesAction->setEnabled(false);
}
}
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
if (!CORBA::is_nil(anObj)) {
anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object
+ emit SignalDependencyTreeRenameObject( anObj->GetEntry() );
}
result = true;
}
// OCCT Includes
#include <gp_Ax3.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
-#else
-#include <Graphic3d_HArray1OfBytes.hxx>
-#endif
// IDL headers
#include "SALOMEconfig.h"
virtual void initialize( CAM_Application* );
virtual QString engineIOR() const;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
static Handle(TColStd_HArray1OfByte) getTexture (SalomeApp_Study*, int, int&, int&);
-#else
- static Handle(Graphic3d_HArray1OfBytes) getTexture (SalomeApp_Study*, int, int&, int&);
-#endif
static bool InitGeomGen();
void SignalDeactivateActiveDialog();
void SignalCloseAllDialogs();
void SignalDefaultStepValueChanged( double newVal );
+ void SignalDependencyTreeParamChanged( const QString&, const QString& );
+ void SignalDependencyTreeRenameObject( const QString& );
protected:
virtual LightApp_Selection* createSelection() const;
private:
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
typedef QMap<long, Handle(TColStd_HArray1OfByte)> TextureMap;
-#else
- typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap;
-#endif
typedef QMap<long, TextureMap> StudyTextureMap;
typedef QMap<QString, GEOMGUI*> GUIMap;
namespace GEOMOp {
enum {
// ToolsGUI --------------------//--------------------------------
- OpImport = 1000, // MENU FILE - IMPORT
- OpExport = 1001, // MENU FILE - EXPORT
OpDelete = 1020, // MENU EDIT - DELETE
OpCheckGeom = 1030, // MENU TOOLS - CHECK GEOMETRY
OpMaterialsLibrary = 1040, // MENU TOOLS - MATERIALS LIBRARY
OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH
OpCreateFolder = 1262, // POPUP MENU - CREATE FOLDER
OpSortChildren = 1263, // POPUP MENU - SORT CHILD ITEMS
+ OpShowDependencyTree = 1264, // POPUP MENU - SHOW DEPENDENCY TREE
+ OpReduceStudy = 1265, // POPUP MENU - REDUCE STUDY
// DisplayGUI ------------------//--------------------------------
OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
OpShowAll = 2002, // MENU VIEW - SHOW ALL
OpDMShading = 2011, // MENU VIEW - DISPLAY MODE - SHADING
OpDMShadingWithEdges = 2012, // MENU VIEW - DISPLAY MODE - SHADING WITH EDGES
OpDMTexture = 2013, // MENU VIEW - DISPLAY MODE - TEXTURE
+ OpSwitchVertices = 2014, // MENU VIEW - DISPLAY MODE - SHOW/HIDE VERTICES
OpShow = 2100, // POPUP MENU - SHOW
OpShowOnly = 2101, // POPUP MENU - SHOW ONLY
OpHide = 2102, // POPUP MENU - HIDE
OpTexture = 2204, // POPUP MENU - DISPLAY MODE - TEXTURE
OpBringToFront = 2205, // POPUP MENU - BRING TO FRONT
OpClsBringToFront = 2206,
+ OpVertices = 2208, // POPUP MENU - DISPLAY MODE - SHOW VERTICES
// BasicGUI --------------------//--------------------------------
OpPoint = 3000, // MENU NEW ENTITY - BASIC - POINT
OpLine = 3001, // MENU NEW ENTITY - BASIC - LINE
OpCreateField = 3305, // MENU FIELD - CREATE FIELD
OpEditField = 3306, // MENU FIELD - EDIT FIELD
OpEditFieldPopup = 3307, // POPUP MENU - EDIT FIELD
+ Op2dPolylineEditor = 3308, // MENU NEW ENTITY - BASIC - POLYLINE EDITOR
// BuildGUI --------------------//--------------------------------
OpEdge = 3400, // MENU NEW ENTITY - BUILD - EDGE
OpWire = 3401, // MENU NEW ENTITY - BUILD - WIRE
OpSharedShapes = 3708, // MENU OPERATION - GET SHARED SHAPES
OpExtrudedBoss = 3709, // MENU OPERATION - ETRUDED BOSS
OpExtrudedCut = 3710, // MENU OPERATION - ETRUDED CUT
-#ifdef DEBUG_CURVE_CREATOR
- OpCurveCreator = 3799, // MENU OPERATION - CURVE CREATOR
-#endif
- // for debug purposes, to be removed
// RepairGUI -------------------//--------------------------------
OpSewing = 4000, // MENU REPAIR - SEWING
OpSuppressFaces = 4001, // MENU REPAIR - SUPPRESS FACES
OpQuadFace = 6102, // MENU BLOCKS - QUADRANGLE FACE
OpPropagate = 6103, // MENU BLOCKS - PROPAGATE
OpExplodeBlock = 6104, // MENU BLOCKS - EXPLODE ON BLOCKS
- // ImportExport ----------------//--------------------------------
- OpExportXAO = 6200, // MENU NEW ENTITY - IMPORTEXPORT - EXPORTXAO
- OpImportXAO = 6201, // MENU NEW ENTITY - IMPORTEXPORT - IMPORTXAO
// AdvancedGUI -----------------//--------------------------------
OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base)
//OpPipeTShape = 10001, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE
GEOMImpl_ICurvesOperations.hxx
GEOMImpl_ILocalOperations.hxx
GEOMImpl_IInsertOperations.hxx
+ GEOMImpl_IECallBack.hxx
GEOMImpl_IMeasureOperations.hxx
GEOMImpl_IGroupOperations.hxx
GEOMImpl_IFieldOperations.hxx
+ GEOMImpl_IBaseIEOperations.hxx
GEOMImpl_IGlue.hxx
GEOMImpl_PointDriver.hxx
GEOMImpl_IPoint.hxx
GEOMImpl_IPolyline.hxx
+ GEOMImpl_IPolyline2D.hxx
GEOMImpl_ICircle.hxx
GEOMImpl_ISpline.hxx
GEOMImpl_IEllipse.hxx
GEOMImpl_Block6Explorer.hxx
GEOMImpl_MeasureDriver.hxx
GEOMImpl_PolylineDriver.hxx
+ GEOMImpl_PolylineDumper.hxx
GEOMImpl_CircleDriver.hxx
GEOMImpl_EllipseDriver.hxx
GEOMImpl_ArcDriver.hxx
GEOMImpl_GlueDriver.hxx
GEOMImpl_Types.hxx
GEOM_GEOMImpl.hxx
- GEOMImpl_IImportExportXAO.hxx
- GEOMImpl_XAODriver.hxx
)
# --- sources ---
GEOMImpl_ICurvesOperations.cxx
GEOMImpl_ILocalOperations.cxx
GEOMImpl_IInsertOperations.cxx
+ GEOMImpl_IECallBack.cxx
GEOMImpl_IMeasureOperations.cxx
GEOMImpl_IGroupOperations.cxx
GEOMImpl_IFieldOperations.cxx
+ GEOMImpl_IBaseIEOperations.cxx
+ GEOMImpl_IPolyline2D.cxx
GEOMImpl_Gen.cxx
GEOMImpl_PointDriver.cxx
GEOMImpl_VectorDriver.cxx
GEOMImpl_Block6Explorer.cxx
GEOMImpl_MeasureDriver.cxx
GEOMImpl_PolylineDriver.cxx
+ GEOMImpl_PolylineDumper.cxx
GEOMImpl_CircleDriver.cxx
GEOMImpl_EllipseDriver.cxx
GEOMImpl_ArcDriver.cxx
GEOMImpl_FillingDriver.cxx
GEOMImpl_GlueDriver.cxx
GEOMImpl_FieldDriver.cxx
- GEOMImpl_XAODriver.cxx
)
# --- rules ---
Standard_Real u1,u2,v1,v2;
SurfaceTrimmee->Bounds(u1,u2,v1,v2);
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
TopoDS_Face tirant = BRepBuilderAPI_MakeFace(SurfaceTrimmee, u1, u2, v1, v2, Precision::Confusion());
-#else
- TopoDS_Face tirant = BRepBuilderAPI_MakeFace(SurfaceTrimmee, u1, u2, v1, v2);
-#endif
if (tirant.IsNull()) {
StdFail_NotDone::Raise("Failed to build secant face");
// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN
// the following block, when enabled, leads to extra vertices generation by partition algorithm
// in some cases, for example when fillet is made on a PipeTShape
-//#if OCC_VERSION_LARGE > 0x06050200
#if 0
// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END
BRep_Builder BB;
gp_Pnt aP;
gp_Vec aV;
- if (aType == CYLINDER_R_H) {
+ if (aType == CYLINDER_R_H || aType == CYLINDER_R_H_A) {
aP = gp::Origin();
aV = gp::DZ();
}
- else if (aType == CYLINDER_PNT_VEC_R_H) {
+ else if (aType == CYLINDER_PNT_VEC_R_H || aType == CYLINDER_PNT_VEC_R_H_A) {
Handle(GEOM_Function) aRefPoint = aCI.GetPoint();
Handle(GEOM_Function) aRefVector = aCI.GetVector();
TopoDS_Shape aShapePnt = aRefPoint->GetValue();
if (aCI.GetH() < 0.0) aV.Reverse();
gp_Ax2 anAxes (aP, aV);
- BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()));
- MC.Build();
- if (!MC.IsDone()) {
- StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
+ TopoDS_Shape aShape;
+
+ switch (aType) {
+ case CYLINDER_R_H:
+ case CYLINDER_PNT_VEC_R_H:
+ {
+ BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()));
+ MC.Build();
+ if (!MC.IsDone()) {
+ StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
+ }
+ aShape = MC.Shape();
+ break;
+ }
+ case CYLINDER_R_H_A:
+ case CYLINDER_PNT_VEC_R_H_A:
+ {
+ BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()), aCI.GetA());
+ MC.Build();
+ if (!MC.IsDone()) {
+ StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters. Failure.");
+ }
+ aShape = MC.Shape();
+ break;
+ }
+ default:
+ break;
}
-
- TopoDS_Shape aShape = MC.Shape();
+
if (aShape.IsNull()) return 0;
-
aFunction->SetValue(aShape);
log.SetTouched(Label());
-
return 1;
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Standard_Stream.hxx>
+// internal includes
+#include "GEOMImpl_ExportDriver.hxx"
+#include "GEOMImpl_IImportExport.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+#include "GEOMImpl_Types.hxx"
-#include <GEOMImpl_ExportDriver.hxx>
-#include <GEOMImpl_IImportExport.hxx>
-#include <GEOMImpl_Types.hxx>
+// GEOM includes
#include <GEOM_Function.hxx>
+// OCC includes
+#include <Standard_Stream.hxx>
#include <TopoDS_Shape.hxx>
-#include <TCollection_AsciiString.hxx>
-
-#include <Standard_Failure.hxx>
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-#ifdef WIN32
-#define LibHandle HMODULE
-#define LoadLib( name ) LoadLibrary( name )
-#define GetProc GetProcAddress
-#define UnLoadLib( handle ) FreeLibrary( handle );
-#else
-#define LibHandle void*
-#define LoadLib( name ) dlopen( name, RTLD_LAZY )
-#define GetProc dlsym
-#define UnLoadLib( handle ) dlclose( handle );
-#endif
-
-typedef int (*funcPoint)(const TopoDS_Shape&,
- const TCollection_AsciiString&,
- const TCollection_AsciiString&);
+
//=======================================================================
//function : GetID
// !!! set the result of function to be used by next operations
aFunction->SetValue(aShape);
+ TDF_Label aLabel = aRefFunction->GetOwnerEntry();
+ if (aLabel.IsRoot()) return 0;
+ Handle(GEOM_Object) obj = GEOM_Object::GetObject( aLabel );
+ if ( obj.IsNull() ) return 0;
+
// retrieve the file and format names
TCollection_AsciiString aFileName = aCI.GetFileName();
TCollection_AsciiString aFormatName = aCI.GetFormatName();
if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty())
return 0;
- // load plugin library
- LibHandle anExportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051
- funcPoint fp = 0;
- if ( anExportLib )
- fp = (funcPoint)GetProc( anExportLib, "Export" );
-
- if ( !fp ) {
- TCollection_AsciiString aMsg = aFormatName;
- aMsg += " plugin was not installed";
- Standard_Failure::Raise(aMsg.ToCString());
- }
-
- // perform the export
- int res = fp( aShape, aFileName, aFormatName );
-
- // unload plugin library
- // commented by enk:
- // the bug was occured: using ACIS Import/Export plugin
- // UnLoadLib( anExportLib );
+ if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( GetDocID(), obj, aFileName, aFormatName ) );
+ return 0;
- if ( res )
- log.SetTouched(Label());
+ log.SetTouched(Label());
- return res;
+ return 1;
}
//================================================================================
#ifndef _GEOMImpl_ExportDriver_HeaderFile
#define _GEOMImpl_ExportDriver_HeaderFile
-#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
-#include <TColStd_SequenceOfExtendedString.hxx>
-#endif
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
#ifndef _Standard_GUID_HeaderFile
#include <Standard_GUID.hxx>
#endif
App.SurfUMults(), App.SurfVMults(), App.UDegree(), App.VDegree());
if (GBS.IsNull()) return 0;
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
aShape = BRepBuilderAPI_MakeFace(GBS, Precision::Confusion());
-#else
- aShape = BRepBuilderAPI_MakeFace(GBS);
-#endif
}
else {
// implemented by skl 20.03.2008 for bug 16568
}
GeomAPI_PointsToBSplineSurface PTB (Points, mindeg, maxdeg, GeomAbs_C2, tol3d);
Handle(Geom_BSplineSurface) BS = PTB.Surface();
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
BRepBuilderAPI_MakeFace BB (BS, Precision::Confusion());
-#else
- BRepBuilderAPI_MakeFace BB (BS);
-#endif
TopoDS_Face NewF = BB.Face();
Handle(ShapeFix_Face) sff = new ShapeFix_Face (NewF);
sff->Perform();
#include <GEOMImpl_GlueDriver.hxx>
#include <GEOMImpl_MeasureDriver.hxx>
#include <GEOMImpl_FieldDriver.hxx>
-#include <GEOMImpl_XAODriver.hxx>
//=============================================================================
/*!
// Field
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FieldDriver::GetID(), new GEOMImpl_FieldDriver());
- // XAO operations
- TFunction_DriverTable::Get()->AddDriver(GEOMImpl_XAODriver::GetID(), new GEOMImpl_XAODriver());
-
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
SetEngine(this);
aGA.Detect();
//modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
-#if OCC_VERSION_LARGE > 0x06050200
Standard_Integer iWrnDetect = aGA.WarningStatus();
if (iWrnDetect == 2) {
Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
}
-#endif
//modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
Standard_Integer iErr = aGA.ErrorStatus();
aGA.Detect();
//modified by NIZNHY-PKV Tue Mar 13 14:07:12 2012f
-#if OCC_VERSION_LARGE > 0x06050200
Standard_Integer iWrnDetect = aGA.WarningStatus();
if (iWrnDetect == 2) {
/*
*/
Standard_Failure::Raise("GLUE_ERROR_STICKED_SHAPES");
}
-#endif
//modified by NIZNHY-PKV Tue Mar 13 14:07:14 2012t
Standard_Integer iErr = aGA.ErrorStatus();
//Compute the box value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed");
return NULL;
//Compute the Box value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Box driver failed");
return NULL;
//Compute the Face
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Face driver failed");
return NULL;
//Compute the Face
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Face driver failed");
return NULL;
//Compute the Disk value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Disk driver failed");
return NULL;
//Compute the Disk value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Disk driver failed");
return NULL;
//Compute the Disk
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Disk driver failed");
return NULL;
//Compute the Cylinder value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed");
return NULL;
return aCylinder;
}
+//=============================================================================
+/*!
+ * MakeCylinderRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRHA (double theR, double theH, double theA)
+{
+ SetErrorCode(KO);
+
+ //Add a new Cylinder object
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), 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 (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+ GEOMImpl_ICylinder aCI (aFunction);
+
+ aCI.SetR(theR);
+ aCI.SetH(theH);
+ aCI.SetA(theA);
+
+ //Compute the Cylinder value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Cylinder driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aCylinder
+ << " = geompy.MakeCylinderRHA(" << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+ SetErrorCode(OK);
+ return aCylinder;
+}
//=============================================================================
/*!
//Compute the Cylinder value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cylinder driver failed");
return NULL;
return aCylinder;
}
+//=============================================================================
+/*!
+ * MakeCylinderPntVecRHA
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
+ Handle(GEOM_Object) theVec,
+ double theR, double theH, double theA)
+{
+ SetErrorCode(KO);
+
+ if (thePnt.IsNull() || theVec.IsNull()) return NULL;
+
+ //Add a new Cylinder object
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+
+ //Add a new Cylinder function for creation a cylinder relatively to point and vector
+ Handle(GEOM_Function) aFunction =
+ aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_PNT_VEC_R_H_A);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_CylinderDriver::GetID()) return NULL;
+
+ GEOMImpl_ICylinder aCI (aFunction);
+
+ Handle(GEOM_Function) aRefPnt = thePnt->GetLastFunction();
+ Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+ if (aRefPnt.IsNull() || aRefVec.IsNull()) return NULL;
+
+ aCI.SetPoint(aRefPnt);
+ aCI.SetVector(aRefVec);
+ aCI.SetR(theR);
+ aCI.SetH(theH);
+ aCI.SetA(theA);
+
+ //Compute the Cylinder value
+ try {
+ OCC_CATCH_SIGNALS;
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Cylinder driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aCylinder << " = geompy.MakeCylinderA("
+ << thePnt << ", " << theVec << ", " << theR << ", " << theH << ", " << theA*180./M_PI << "*math.pi/180.)";
+
+ SetErrorCode(OK);
+ return aCylinder;
+}
+
//=============================================================================
/*!
//Compute the Cone value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed");
return NULL;
//Compute the Cone value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Cone driver failed");
return NULL;
//Compute the Sphere value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed");
return NULL;
//Compute the Sphere value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sphere driver failed");
return NULL;
//Compute the Torus value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed");
return NULL;
//Compute the Torus value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Torus driver failed");
return NULL;
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
//SetErrorCode("Prism driver failed");
SetErrorCode("Extrusion can not be created, check input data");
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Extrusion can not be created, check input data");
return NULL;
//Compute the Prism value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Extrusion can not be created, check input data");
return NULL;
//Compute the Draft Prism Feature value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Extrusion can not be created, check input data");
return NULL;
//Compute the Pipe value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe driver failed");
return NULL;
//Compute the Revolution value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Revolution driver failed");
return NULL;
//Compute the Revolution value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Revolution driver failed");
return NULL;
//Compute the Solid value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Filling driver failed");
return NULL;
//Compute the ThruSections value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("ThruSections driver failed");
return anObj;
//Compute the Pipe value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with defferent section driver failed");
return anObj;
//Compute the Pipe value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with shell sections driver failed");
return anObj;
//Compute the Pipe value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe with shell sections without path driver failed");
return anObj;
//Compute the Pipe value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Pipe driver failed");
return NULL;
//Compute the offset
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Offset driver failed");
return NULL;
// Compute the Path value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("PipePath driver failed");
return NULL;
// Compute the Path value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("PipePath driver failed");
return NULL;
Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH (double theR, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
- Handle(GEOM_Object) theVec,
- double theR, double theH);
+ Handle(GEOM_Object) theVec,
+ double theR, double theH);
+ Standard_EXPORT Handle(GEOM_Object) MakeCylinderRHA (double theR, double theH, double theA);
+ Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
+ Handle(GEOM_Object) theVec,
+ double theR, double theH, double theA);
Standard_EXPORT Handle(GEOM_Object) MakeConeR1R2H (double theR1, double theR2, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeConePntVecR1R2H (Handle(GEOM_Object) thePnt,
- Handle(GEOM_Object) theVec,
- double theR1, double theR2, double theH);
+ Handle(GEOM_Object) theVec,
+ double theR1, double theR2, double theH);
Standard_EXPORT Handle(GEOM_Object) MakeSphereR (double theR);
Standard_EXPORT Handle(GEOM_Object) MakeSpherePntR (Handle(GEOM_Object) thePnt, double theR);
Standard_EXPORT Handle(GEOM_Object) MakeTorusRR (double theRMajor, double theRMinor);
Standard_EXPORT Handle(GEOM_Object) MakeTorusPntVecRR (Handle(GEOM_Object) thePnt,
- Handle(GEOM_Object) theVec,
- double theRMajor, double theRMinor);
+ Handle(GEOM_Object) theVec,
+ double theRMajor, double theRMinor);
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec,
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+#include "GEOMImpl_IGroupOperations.hxx"
+#include "GEOMImpl_IFieldOperations.hxx"
+#include "GEOMImpl_IShapesOperations.hxx"
+
+// OCC includes
+#include <NCollection_DataMap.hxx>
+#include <TDF_ChildIDIterator.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TDataStd_Comment.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
+
+typedef NCollection_DataMap< TCollection_ExtendedString, NCollection_List<TopoDS_Shape> >
+ DataMapOfStringListOfShape;
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+GEOMImpl_IBaseIEOperations::GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID)
+: GEOM_IOperations(theEngine, theDocID)
+{
+ myGroupOperations = new GEOMImpl_IGroupOperations( GetEngine(), GetDocID() );
+ myFieldOperations = new GEOMImpl_IFieldOperations( GetEngine(), GetDocID() );
+ myShapesOperations = new GEOMImpl_IShapesOperations( GetEngine(), GetDocID() );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+GEOMImpl_IBaseIEOperations::~GEOMImpl_IBaseIEOperations()
+{
+ delete myGroupOperations;
+ delete myFieldOperations;
+ delete myShapesOperations;
+}
+
+//=============================================================================
+/*!
+ * This method creates material groups for an imported object.
+ * \param theObject the imported object.
+ */
+//=============================================================================
+void GEOMImpl_IBaseIEOperations::MakeMaterialGroups
+ (const Handle(GEOM_Object) &theObject,
+ const Handle(TColStd_HSequenceOfTransient) &theSeq)
+{
+ TopoDS_Shape aResShape = theObject->GetValue();
+
+ if (aResShape.IsNull() == Standard_False) {
+ // Group shapes by material names.
+ Handle(GEOM_Function) aFunction = theObject->GetLastFunction();
+ DataMapOfStringListOfShape aMapMaterialShapes;
+
+ // check all named shapes using iterator
+ TDF_ChildIDIterator anIt (aFunction->GetNamingEntry(),
+ TNaming_NamedShape::GetID(), Standard_True);
+
+ for (; anIt.More(); anIt.Next()) {
+ Handle(TNaming_NamedShape) anAttr =
+ Handle(TNaming_NamedShape)::DownCast(anIt.Value());
+
+ if (anAttr.IsNull() == Standard_False) {
+ TDF_Label aLabel = anAttr->Label();
+ Handle(TDataStd_Comment) aComment;
+
+ if (aLabel.FindAttribute(TDataStd_Comment::GetID(), aComment)) {
+ TCollection_ExtendedString aMatName = aComment->Get();
+ TopoDS_Shape aShape = anAttr->Get();
+
+ if (aMapMaterialShapes.IsBound(aMatName) == Standard_False) {
+ NCollection_List<TopoDS_Shape> anEmptyList;
+
+ aMapMaterialShapes.Bind(aMatName, anEmptyList);
+ }
+
+ aMapMaterialShapes(aMatName).Append(aShape);
+ }
+ }
+ }
+
+ if (aMapMaterialShapes.IsEmpty() == Standard_False) {
+ // Construct groups.
+ TopAbs_ShapeEnum aType = aResShape.ShapeType();
+ Standard_Integer i;
+ DataMapOfStringListOfShape::Iterator aMapIter;
+
+ // Check each shape type.
+ for(i = aType; i <= TopAbs_VERTEX; i++) {
+ DataMapOfStringListOfShape::Iterator aMapIter(aMapMaterialShapes);
+
+ for (; aMapIter.More(); aMapIter.Next()) {
+ NCollection_List<TopoDS_Shape> &aShList = aMapIter.ChangeValue();
+ NCollection_List<TopoDS_Shape>::Iterator aShIter(aShList);
+ NCollection_List<TopoDS_Shape> aShListSameType;
+
+ while (aShIter.More()) {
+ const TopoDS_Shape &aShape = aShIter.Value();
+
+ if (i == aShape.ShapeType()) {
+ // Treat this element.
+ aShListSameType.Append(aShape);
+ aShList.Remove(aShIter);
+ } else {
+ // Go to the next element.
+ aShIter.Next();
+ }
+ }
+
+ if (aShListSameType.IsEmpty() == Standard_False) {
+ // Construct a group.
+ Handle(GEOM_Object) aGroup =
+ MakeGroup(theObject, aMapIter.Key(), aShListSameType);
+
+ if (aGroup.IsNull() == Standard_False) {
+ theSeq->Append(aGroup);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+//=============================================================================
+/*!
+ * This method creates a group of shapes of certain type.
+ * \param theObject the imported object.
+ * \param theName the material name.
+ * \param theShapes the list of shapes to be added to this group.
+ * \return the created group.
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBaseIEOperations::MakeGroup
+ (const Handle(GEOM_Object) &theObject,
+ const TCollection_ExtendedString &theName,
+ const NCollection_List<TopoDS_Shape> &theShapes)
+{
+ Handle(GEOM_Object) aGroup;
+ TopTools_IndexedMapOfShape anIndices;
+ Handle(TColStd_HSequenceOfInteger) aSeqIDs = new TColStd_HSequenceOfInteger;
+ NCollection_List<TopoDS_Shape>::Iterator anIter(theShapes);
+
+ TopExp::MapShapes(theObject->GetValue(), anIndices);
+
+ // Compose shape IDs.
+ for (; anIter.More(); anIter.Next()) {
+ const TopoDS_Shape &aShape = anIter.Value();
+ const Standard_Integer anIndex = anIndices.FindIndex(aShape);
+
+ if (anIndex > 0) {
+ aSeqIDs->Append(anIndex);
+ }
+ }
+
+ if (aSeqIDs->IsEmpty() == Standard_False) {
+ // Create a group.
+ const TopAbs_ShapeEnum aType = theShapes.First().ShapeType();
+
+ aGroup = myGroupOperations->CreateGroup(theObject, aType);
+
+ if (aGroup.IsNull() == Standard_False) {
+ aGroup->GetLastFunction()->SetDescription("");
+ myGroupOperations->UnionIDs(aGroup, aSeqIDs);
+ aGroup->GetLastFunction()->SetDescription("");
+
+ // Compose the group name.
+ TCollection_AsciiString aGroupName(theName);
+
+ switch(aType) {
+ case TopAbs_VERTEX:
+ aGroupName += "_VERTEX";
+ break;
+ case TopAbs_EDGE:
+ aGroupName += "_EDGE";
+ break;
+ case TopAbs_WIRE:
+ aGroupName += "_WIRE";
+ break;
+ case TopAbs_FACE:
+ aGroupName += "_FACE";
+ break;
+ case TopAbs_SHELL:
+ aGroupName += "_SHELL";
+ break;
+ case TopAbs_SOLID:
+ aGroupName += "_SOLID";
+ break;
+ case TopAbs_COMPSOLID:
+ aGroupName += "_COMPSOLID";
+ break;
+ case TopAbs_COMPOUND:
+ aGroupName += "_COMPOUND";
+ break;
+ default:
+ aGroupName += "_SHAPE";
+ break;
+ }
+
+ aGroup->SetName(aGroupName.ToCString());
+ }
+ }
+
+ return aGroup;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOMImpl_IBaseIEOperations_HXX_
+#define _GEOMImpl_IBaseIEOperations_HXX_
+
+// GEOM includes
+#include <GEOM_IOperations.hxx>
+
+// OCC includes
+#include <NCollection_List.hxx>
+
+class GEOMImpl_IGroupOperations;
+class GEOMImpl_IFieldOperations;
+class GEOMImpl_IShapesOperations;
+
+class GEOMImpl_IBaseIEOperations : public GEOM_IOperations
+{
+public:
+ Standard_EXPORT GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT ~GEOMImpl_IBaseIEOperations();
+
+protected:
+ Standard_EXPORT void MakeMaterialGroups(const Handle(GEOM_Object) &theObject,
+ const Handle(TColStd_HSequenceOfTransient) &theSeq);
+
+ Handle(GEOM_Object) MakeGroup
+ (const Handle(GEOM_Object) &theObject,
+ const TCollection_ExtendedString &theName,
+ const NCollection_List<TopoDS_Shape> &theShapes);
+protected:
+ GEOMImpl_IGroupOperations* myGroupOperations;
+ GEOMImpl_IFieldOperations* myFieldOperations;
+ GEOMImpl_IShapesOperations* myShapesOperations;
+};
+
+#endif
//Compute the point value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed");
return NULL;
//Compute the point value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed");
return NULL;
//Compute the point value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed");
return NULL;
//Compute the point value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Point driver failed");
return NULL;
//Compute the vector value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
//Compute the Vector value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
//Compute the Vector value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
//Compute the Line value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Line driver failed");
return NULL;
//Compute the Line value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Line driver failed");
return NULL;
//Compute the Line value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Line driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the marker value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Marker driver failed");
return NULL;
//Compute the marker value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Marker driver failed");
return NULL;
//Compute the marker value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Marker driver failed");
return NULL;
//Compute the Plane value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Plane driver failed");
return NULL;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face");
return NULL;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face");
return NULL;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a face");
return NULL;
//Compute the Block value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a block");
return NULL;
//Compute the Block value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a block");
return NULL;
//Compute the Blocks Compound value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to compute a blocks compound");
return NULL;
//Compute the Edge value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopTools_IndexedDataMapOfShapeListOfShape MVE;
GEOMImpl_Block6Explorer::MapShapesAndAncestors
(aBlockOrComp, TopAbs_VERTEX, TopAbs_EDGE, MVE);
//Compute the Edge value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
TopoDS_Shape aShape = GEOMUtils::GetEdgeNearPoint(aBlockOrComp, aVert);
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
TopTools_IndexedDataMapOfShapeListOfShape MVF;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
TopTools_IndexedDataMapOfShapeListOfShape MEF;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
GEOMImpl_Block6Explorer aBlockTool;
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
//Compute the Face value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
TopoDS_Edge anEdge = TopoDS::Edge(anArg);
// Compute the result
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
TopTools_MapOfShape mapShape;
//Check
isCompOfBlocks = Standard_True;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopTools_MapOfShape mapShape;
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
for (; exp.More(); exp.Next()) {
//Compute the fixed shape
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to remove extra edges of the given shape");
return NULL;
//Compute the fixed shape
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to remove extra edges of the given shape");
return NULL;
//Compute the fixed shape
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to improve the given blocks compound");
return NULL;
// Explode
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
for (; exp.More(); exp.Next()) {
if (mapShape.Add(exp.Current())) {
//Compute the Block value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape aShape;
TopoDS_Vertex aVert = TopoDS::Vertex(anArg);
//Compute the Block value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
// 1. Explode compound on solids
TopTools_MapOfShape mapShape;
Standard_Integer nbSolids = 0;
//Get the Blocks
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopTools_MapOfShape mapShape;
Standard_Integer nbSolids = 0;
TopExp_Explorer exp (aBlockOrComp, TopAbs_SOLID);
//Compute the transformation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to make multi-transformation");
return NULL;
//Compute the transformation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Block driver failed to make multi-transformation");
return NULL;
//Compute the Boolean value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed");
return NULL;
//Compute the Boolean value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed");
return NULL;
//Compute the Boolean value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed");
return NULL;
//Compute the Boolean value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed");
return NULL;
//Compute the Boolean value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Boolean driver failed");
return NULL;
//Compute the Partition
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Partition driver failed");
return NULL;
//Compute the Partition value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Partition driver failed");
return NULL;
#include "GEOMImpl_3DSketcherDriver.hxx"
#include "GEOMImpl_IPolyline.hxx"
+#include "GEOMImpl_IPolyline2D.hxx"
#include "GEOMImpl_ICircle.hxx"
#include "GEOMImpl_ISpline.hxx"
#include "GEOMImpl_IEllipse.hxx"
#include "GEOMImpl_I3DSketcher.hxx"
#include "GEOMImpl_ICurveParametric.hxx"
#include "GEOMImpl_IIsoline.hxx"
+#include "GEOMImpl_PolylineDumper.hxx"
#include <Basics_OCCTVersion.hxx>
#include "utilities.h"
#include <TDF_Tool.hxx>
+#include <TColStd_HArray1OfByte.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Standard_Failure.hxx>
//Compute the Circle value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Circle driver failed");
return NULL;
//Compute the Circle value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Circle driver failed");
return NULL;
//Compute the Circle value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Circle driver failed");
return NULL;
//Compute the Ellipse value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Ellipse driver failed");
return NULL;
//Compute the Arc value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Arc driver failed");
return NULL;
//Compute the Arc value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("Arc driver failed");
- return NULL;
+ SetErrorCode("Arc driver failed");
+ return NULL;
}
}
catch (Standard_Failure) {
//Compute the Arc value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Arc driver failed");
return NULL;
//Compute the Polyline value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Polyline driver failed");
return NULL;
//Compute the Spline value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed");
return NULL;
//Compute the Spline value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed");
return NULL;
//Compute the Spline value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Spline driver failed");
return NULL;
//Compute the Curve value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Curve driver failed !!!");
return NULL;
//Compute the Sketcher value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sketcher driver failed");
return NULL;
//Compute the Sketcher value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Sketcher driver failed");
return NULL;
//Compute the 3D Sketcher value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("3D Sketcher driver failed");
return NULL;
//Compute the Sketcher value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("3D Sketcher driver failed");
return NULL;
//Compute the isoline curve
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed");
return NULL;
SetErrorCode(OK);
return anIsoline;
}
+
+//=============================================================================
+/*!
+ * MakePolyline2D
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2D
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(TColStd_HArray1OfReal) &theWorkingPlane)
+{
+ SetErrorCode(KO);
+
+ if (theCoords.empty() || theNames.IsNull() || theTypes.IsNull() ||
+ theCloseds.IsNull() || theWorkingPlane.IsNull()) {
+ return NULL;
+ }
+
+ // Add a new Polyline object
+ Handle(GEOM_Object) aResult =
+ GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ Handle(GEOM_Function) aFunction = aResult->AddFunction
+ (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_COORDS);
+
+ if (aFunction.IsNull()) {
+ return NULL;
+ }
+
+ // Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PolylineDriver::GetID()) {
+ return NULL;
+ }
+
+ GEOMImpl_IPolyline2D aCI(aFunction);
+
+ aCI.SetCoords(theCoords);
+ aCI.SetNames(theNames);
+ aCI.SetTypes(theTypes);
+ aCI.SetClosedFlags(theCloseds);
+ aCI.SetWorkingPlaneDbls(theWorkingPlane);
+
+ // Compute the isoline curve
+ try {
+#if OCC_VERSION_LARGE > 0x06010000
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Polyline driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOMImpl_PolylineDumper aDumper(theCoords, theNames, theTypes,
+ theCloseds, theWorkingPlane);
+
+ aDumper.Dump(aResult);
+
+ if (aDumper.IsDone() == Standard_False) {
+ SetErrorCode("Python dump failed");
+ return NULL;
+ }
+
+ SetErrorCode(OK);
+ return aResult;
+}
+
+//=============================================================================
+/*!
+ * MakePolyline2DOnPlane
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2DOnPlane
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(GEOM_Object) &theWorkingPlane)
+{
+ SetErrorCode(KO);
+
+ if (theCoords.empty() || theNames.IsNull() || theTypes.IsNull() ||
+ theCloseds.IsNull() || theWorkingPlane.IsNull()) {
+ return NULL;
+ }
+
+ //Add a new Polyline object
+ Handle(GEOM_Object) aResult =
+ GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ Handle(GEOM_Function) aFunction = aResult->AddFunction
+ (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_OBJECT);
+
+ if (aFunction.IsNull()) {
+ return NULL;
+ }
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PolylineDriver::GetID()) {
+ return NULL;
+ }
+
+ Handle(GEOM_Function) aRefPlane = theWorkingPlane->GetLastFunction();
+
+ if (aRefPlane.IsNull()) {
+ return NULL;
+ }
+
+ GEOMImpl_IPolyline2D aCI(aFunction);
+
+ aCI.SetCoords(theCoords);
+ aCI.SetNames(theNames);
+ aCI.SetTypes(theTypes);
+ aCI.SetClosedFlags(theCloseds);
+ aCI.SetWorkingPlane(aRefPlane);
+
+ //Compute the isoline curve
+ try {
+#if OCC_VERSION_LARGE > 0x06010000
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Polyline driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOMImpl_PolylineDumper aDumper(theCoords, theNames, theTypes,
+ theCloseds, theWorkingPlane);
+
+ aDumper.Dump(aResult);
+
+ if (aDumper.IsDone() == Standard_False) {
+ SetErrorCode("Python dump failed");
+ return NULL;
+ }
+
+ SetErrorCode(OK);
+ return aResult;
+}
const bool IsUIso,
const double theParameter);
+ Standard_EXPORT Handle(GEOM_Object) MakePolyline2D
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(TColStd_HArray1OfReal) &theWorkingPlane);
+
+ Standard_EXPORT Handle(GEOM_Object) MakePolyline2DOnPlane
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(GEOM_Object) &theWorkingPlane);
};
#endif
#define CYL_ARG_H 2
#define CYL_ARG_PNT 3
#define CYL_ARG_VEC 4
+#define CYL_ARG_A 5
class GEOMImpl_ICylinder
{
void SetVector(Handle(GEOM_Function) theRefVector) { _func->SetReference(CYL_ARG_VEC, theRefVector); }
Handle(GEOM_Function) GetVector() { return _func->GetReference(CYL_ARG_VEC); }
+
+ void SetA(double theA) { _func->SetReal(CYL_ARG_A, theA); }
+
+ double GetA() { return _func->GetReal(CYL_ARG_A); }
private:
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "GEOMImpl_IECallBack.hxx"
+#include "GEOMImpl_Gen.hxx"
+
+std::map<TCollection_AsciiString, GEOMImpl_IECallBack*> GEOMImpl_IECallBack::myCallBacks;
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+GEOMImpl_IECallBack::GEOMImpl_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+GEOMImpl_IECallBack::~GEOMImpl_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * GetEngine
+ */
+//=============================================================================
+GEOMImpl_Gen* GEOMImpl_IECallBack::GetEngine()
+{
+ return dynamic_cast<GEOMImpl_Gen*>( GEOM_Engine::GetEngine() );
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool GEOMImpl_IECallBack::Export( int /*theDocId*/,
+ const Handle(GEOM_Object) /*theOriginal*/,
+ const TCollection_AsciiString& /*theFileName*/,
+ const TCollection_AsciiString& /*theFormatName*/ )
+{
+ return false;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+GEOMImpl_IECallBack::Import( int /*theDocId*/,
+ const TCollection_AsciiString& /*theFormatName*/,
+ const TCollection_AsciiString& /*theFileName*/ )
+{
+ return NULL;
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString
+GEOMImpl_IECallBack::ReadValue( int /*theDocId*/,
+ const TCollection_AsciiString& /*theFileName*/,
+ const TCollection_AsciiString& /*theFormatName*/,
+ const TCollection_AsciiString& /*theParameterName*/ )
+{
+ return "";
+}
+
+//=============================================================================
+/*!
+ * Register
+ */
+//=============================================================================
+void GEOMImpl_IECallBack::Register( const TCollection_AsciiString& theFormatName,
+ GEOMImpl_IECallBack* theCallBack )
+{
+ myCallBacks[theFormatName] = theCallBack;
+}
+
+//=============================================================================
+/*!
+ * GetCallBack
+ */
+//=============================================================================
+GEOMImpl_IECallBack* GEOMImpl_IECallBack::GetCallBack( const TCollection_AsciiString& theFormatName )
+{
+ return myCallBacks.find(theFormatName) == myCallBacks.end() ?
+ new GEOMImpl_IECallBack() : myCallBacks[theFormatName];
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOMImpl_IECallBack_HXX_
+#define _GEOMImpl_IECallBack_HXX_
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+// C++ includes
+#include <map>
+
+class GEOMImpl_Gen;
+
+class GEOMImpl_IECallBack
+{
+ public:
+ Standard_EXPORT GEOMImpl_IECallBack();
+ Standard_EXPORT ~GEOMImpl_IECallBack();
+
+ Standard_EXPORT virtual bool Export( int theDocId,
+ 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 );
+
+ Standard_EXPORT virtual
+ TCollection_AsciiString ReadValue( int theDocId,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName );
+
+ Standard_EXPORT static void Register( const TCollection_AsciiString& theFormatName, GEOMImpl_IECallBack* theCallBack );
+
+ static GEOMImpl_IECallBack* GetCallBack( const TCollection_AsciiString& theFormatName );
+
+protected:
+ Standard_EXPORT GEOMImpl_Gen* GetEngine();
+
+private:
+ static std::map<TCollection_AsciiString, GEOMImpl_IECallBack*> myCallBacks;
+};
+
+#endif
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Shape Healing algorithm failed");
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the result
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the result
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction))
{
SetErrorCode("Healing driver failed");
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
// Compute the new wire
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
// get free boundary shapes
-#if OCC_VERSION_LARGE > 0x06030008
ShapeAnalysis_FreeBounds anAnalizer(aShape, Standard_False,
Standard_True, Standard_True);
-#else
- ShapeAnalysis_FreeBounds anAnalizer(aShape);
-#endif
TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
TopoDS_Compound anOpen = anAnalizer.GetOpenWires();
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
// Compute the result
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
// Compute
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Healing driver failed");
return NULL;
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_IImportExportXAO_HXX_
-#define _GEOMImpl_IImportExportXAO_HXX_
-
-#include "GEOM_Function.hxx"
-
-#define IMPORTEXPORTXAO_ARG_DATA 1
-
-class GEOMImpl_IImportExportXAO
-{
-public:
- GEOMImpl_IImportExportXAO(Handle(GEOM_Function) theFunction): _func(theFunction) {}
-
- void SetData(const TCollection_AsciiString& data) { _func->SetString(IMPORTEXPORTXAO_ARG_DATA, data); }
- const TCollection_AsciiString GetData() { return _func->GetString(IMPORTEXPORTXAO_ARG_DATA); }
-
-private:
- Handle(GEOM_Function) _func;
-};
-
-#endif // _GEOMImpl_IExportXAO_HXX_
#include "GEOMImpl_IShapesOperations.hxx"
#include "GEOMImpl_IGroupOperations.hxx"
#include "GEOMImpl_IFieldOperations.hxx"
-#include "GEOMImpl_XAODriver.hxx"
-#include "GEOMImpl_IImportExportXAO.hxx"
+#include "GEOMImpl_IECallBack.hxx"
#include <GEOM_Function.hxx>
#include <GEOM_PythonDump.hxx>
#include "GEOM_ISubShape.hxx"
-#include <XAO_Xao.hxx>
-#include <XAO_Geometry.hxx>
-#include <XAO_BrepGeometry.hxx>
-#include <XAO_Group.hxx>
-#include <XAO_Field.hxx>
-#include <XAO_XaoUtils.hxx>
-#include <XAO_BooleanField.hxx>
-#include <XAO_IntegerField.hxx>
-#include <XAO_DoubleField.hxx>
-#include <XAO_StringField.hxx>
-#include <XAO_BooleanStep.hxx>
-#include <XAO_IntegerStep.hxx>
-#include <XAO_DoubleStep.hxx>
-#include <XAO_StringStep.hxx>
-
#include <Basics_OCCTVersion.hxx>
#include "utilities.h"
#include <BRepTools.hxx>
#include <gp_Pnt.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
#include <TColStd_HArray1OfReal.hxx>
-#else
-#include <TDataStd_HArray1OfByte.hxx>
-#endif
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-/**
- * This function returns the input format name from the original format name.
- */
-static TCollection_AsciiString GetImportFormatName
- (const TCollection_AsciiString& theFormatName)
-{
- return theFormatName.Token("_");
-}
-
//=============================================================================
/*!
* constructor
//Compute the Copy value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Copy driver failed");
return NULL;
if (theOriginal.IsNull()) return;
- Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
- 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);
-
- //Add an Export function
- Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_ExportDriver::GetID(), EXPORT_SHAPE);
- if (aFunction.IsNull()) return;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_ExportDriver::GetID()) return;
-
- Handle(TCollection_HAsciiString) aHLibName;
- if (!IsSupported(Standard_False, theFormatName, aHLibName)) {
+ if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) )
return;
- }
- TCollection_AsciiString aLibName = aHLibName->String();
-
- //Set parameters
- GEOMImpl_IImportExport aCI (aFunction);
- aCI.SetOriginal(aRefFunction);
- aCI.SetFileName(theFileName);
- aCI.SetFormatName(theFormatName);
- aCI.SetPluginName(aLibName);
-
- //Perform the Export
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("Not enough space on disk, or you haven't permissions to write this directory");
- return;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return;
- }
-
- //Make a Python command
- GEOM::TPythonDump(aFunction) << "geompy.Export(" << theOriginal << ", \""
- << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
-
SetErrorCode(OK);
}
if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL;
- //Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
-
- //Add an Import function
- Handle(GEOM_Function) aFunction =
- anImported->AddFunction(GEOMImpl_ImportDriver::GetID(), IMPORT_SHAPE);
-
- if (aFunction.IsNull()) return NULL;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_ImportDriver::GetID()) return NULL;
-
- Handle(TCollection_HAsciiString) aHLibName;
- if (!IsSupported
- (Standard_True, GetImportFormatName(theFormatName), aHLibName)) {
- return NULL;
- }
- TCollection_AsciiString aLibName = aHLibName->String();
-
- //Set parameters
- GEOMImpl_IImportExport aCI (aFunction);
- aCI.SetFileName(theFileName);
- aCI.SetFormatName(theFormatName);
- aCI.SetPluginName(aLibName);
-
- //Perform the Import
- Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
-
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("Import driver failed");
- return NULL;
- }
-
- aSeq->Append(anImported);
-
- // Greate material groups.
- MakeMaterialGroups(anImported, aSeq);
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return NULL;
- }
-
- //Make a Python command
- if (theFormatName != "IGES_UNIT") {
- GEOM::TPythonDump pd (aFunction);
- if (theFormatName == "BREP")
- pd << aSeq << " = geompy.ImportBREP(\"" << theFileName.ToCString() << "\")";
- else if (theFormatName == "IGES")
- pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\")";
- else if (theFormatName == "IGES_SCALE")
- pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\", True)";
- else if (theFormatName == "STEP")
- pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\")";
- else if (theFormatName == "STEP_SCALE")
- pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", True)";
- else {
- pd << aSeq << " = geompy.ImportFile(\""
- << theFileName.ToCString() << "\", \"" << theFormatName.ToCString() << "\")";
- }
- }
-
+ Handle(TColStd_HSequenceOfTransient) aSeq =
+ GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName );
SetErrorCode(OK);
-
- // OLD CODE: begin
- if (theFormatName == "IGES_UNIT") {
- TopoDS_Shape S = aFunction->GetValue();
- TopoDS_Vertex V = TopoDS::Vertex(S);
- gp_Pnt P = BRep_Tool::Pnt(V);
- double scale = P.X();
- TCollection_AsciiString aUnitName = "UNIT_M";
- if (fabs(scale-0.01) < 1.e-6)
- aUnitName = "UNIT_CM";
- else if (fabs(scale-0.001) < 1.e-6)
- aUnitName = "UNIT_MM";
- //cout<<"IIO: aUnitName = "<<aUnitName.ToCString()<<endl;
- SetErrorCode(aUnitName);
- }
- // OLD CODE: end
-
return aSeq;
}
const TCollection_AsciiString& theParameterName)
{
SetErrorCode(KO);
-
- TCollection_AsciiString aValue, anError;
-
+ TCollection_AsciiString aValue;
if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
- Handle(TCollection_HAsciiString) aHLibName;
- if (!IsSupported
- (Standard_True, GetImportFormatName(theFormatName), aHLibName)) {
- return aValue;
- }
- TCollection_AsciiString aLibName = aHLibName->String();
-
- aValue = GEOMImpl_ImportDriver::ReadValue(theFileName, aLibName, theParameterName, anError);
- if (anError.IsEmpty())
- SetErrorCode(OK);
- else
- SetErrorCode(anError.ToCString());
+ aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName );
+ SetErrorCode(OK);
return aValue;
}
-//=============================================================================
-/*!
- * ImportTranslators
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IInsertOperations::ImportTranslators
- (Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
-{
- if (theFormats.IsNull())
- theFormats = new TColStd_HSequenceOfAsciiString;
- else
- theFormats->Clear();
-
- if (thePatterns.IsNull())
- thePatterns = new TColStd_HSequenceOfAsciiString;
- else
- thePatterns->Clear();
-
- if (!InitResMgr()) return Standard_False;
-
- // Read Import formats from directories
- Handle(Resource_Manager) aResMgr;
- Handle(TColStd_HSequenceOfAsciiString) aFormatsToAdd;
- for(int index = 0; index < myResMgrList.size(); index++) {
- int anOldLen = theFormats->Length();
- aResMgr = myResMgrList.at(index);
- if (aResMgr->Find("Import")) {
- TCollection_AsciiString aFormats (aResMgr->Value("Import"));
- TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
- for (int i = 1; !aToken.IsEmpty(); aToken = aFormats.Token("| \t", ++i)) {
- int aLenFormats = theFormats->Length();
- bool isFound = false;
- for(int aInd=1;aInd<=aLenFormats;aInd++){
- if( theFormats->Value(aInd) == aToken ){
- isFound = true;
- break;
- }
- }
- if(!isFound)
- theFormats->Append(aToken);
- }
- }
-
- // Read Patterns for each supported format
- for (int j = anOldLen+1; j <= theFormats->Length(); j++) {
- TCollection_AsciiString aKey, aPattern;
- aKey = theFormats->Value(j) + ".ImportPattern";
- if (aResMgr->Find(aKey.ToCString()))
- aPattern = aResMgr->Value(aKey.ToCString());
- else {
- aKey = theFormats->Value(j) + ".Pattern";
- if (aResMgr->Find(aKey.ToCString()))
- aPattern = aResMgr->Value(aKey.ToCString());
- else {
- aPattern = theFormats->Value(j);
- aPattern += " Files ( *.* )";
- }
- }
- thePatterns->Append(aPattern);
- }
- }
-
- return (!theFormats->IsEmpty());
-}
-
-//=============================================================================
-/*!
- * ExportTranslators
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IInsertOperations::ExportTranslators
- (Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns)
-{
- if (theFormats.IsNull())
- theFormats = new TColStd_HSequenceOfAsciiString;
- else
- theFormats->Clear();
-
- if (thePatterns.IsNull())
- thePatterns = new TColStd_HSequenceOfAsciiString;
- else
- thePatterns->Clear();
-
- if (!InitResMgr()) return Standard_False;
-
- // Read Export formats list from directories
- Handle(Resource_Manager) aResMgr;
- for(int index=0; index < myResMgrList.size(); index++) {
- int anOldLen = theFormats->Length();
- aResMgr = myResMgrList.at(index);
- if (aResMgr->Find("Export")) {
- TCollection_AsciiString aFormats (aResMgr->Value("Export"));
- TCollection_AsciiString aToken = aFormats.Token("| \t", 1);
- for (int i = 1; !aToken.IsEmpty(); aToken = aFormats.Token("| \t", ++i)) {
- int aLenFormats = theFormats->Length();
- bool isFound = false;
- for(int aInd=1;aInd<=aLenFormats;aInd++){
- if( theFormats->Value(aInd) == aToken){
- isFound = true;
- break;
- }
- }
- if(!isFound)
- theFormats->Append(aToken);
- }
- }
-
- // Read Patterns for each supported format
- for (int j = anOldLen+1; j <= theFormats->Length(); j++) {
- TCollection_AsciiString aKey, aPattern;
- aKey = theFormats->Value(j) + ".ExportPattern";
- if (aResMgr->Find(aKey.ToCString()))
- aPattern = aResMgr->Value(aKey.ToCString());
- else {
- aKey = theFormats->Value(j) + ".Pattern";
- if (aResMgr->Find(aKey.ToCString()))
- aPattern = aResMgr->Value(aKey.ToCString());
- else {
- aPattern = theFormats->Value(j);
- aPattern += " Files ( *.* )";
- }
- }
- thePatterns->Append(aPattern);
- }
- }
-
- return (!theFormats->IsEmpty());
-}
-
-//=============================================================================
-/*!
- * IsSupported
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IInsertOperations::IsSupported
- (const Standard_Boolean isImport,
- const TCollection_AsciiString& theFormat,
- Handle(TCollection_HAsciiString)& theLibName)
-{
- if (!InitResMgr()) return Standard_False;
-
- // Import/Export mode
- TCollection_AsciiString aMode;
- //Standard_CString aMode;
- if (isImport) aMode = "Import";
- else aMode = "Export";
-
- // Read supported formats for the certain mode from user directory
- Handle(Resource_Manager) aResMgr;
- for(int index=0; index < myResMgrList.size(); index++) {
- aResMgr = myResMgrList.at(index);
- if (aResMgr->Find(aMode.ToCString())) {
- TCollection_AsciiString aFormats (aResMgr->Value(aMode.ToCString()));
- if (aFormats.Search(theFormat) > -1) {
- // Read library name for the supported format
- TCollection_AsciiString aKey (theFormat);
- aKey += ".";
- aKey += aMode;
- if (aResMgr->Find(aKey.ToCString())) {
- TCollection_AsciiString aLibName (aResMgr->Value(aKey.ToCString()));
- #ifndef WIN32
- if ( aLibName.Length() > 3 && aLibName.SubString(1,3) != "lib" )
- aLibName.Prepend("lib");
- aLibName += ".so";
- #else
- aLibName += ".dll";
- #endif
- theLibName = new TCollection_HAsciiString (aLibName);
- return Standard_True;
- }
- }
- }
- }
-
- return Standard_False;
-}
-
-//=============================================================================
-/*!
- * InitResMgr
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IInsertOperations::InitResMgr()
-{
- bool isResourceFound = false;
- TCollection_AsciiString aNull;
-
- myResMgrList.clear();
-
- // Initialize the GEOM Resource Manager
- TCollection_AsciiString aResDir;
- aResDir = getenv("GEOM_ROOT_DIR");
-#ifdef WIN32
- aResDir += "\\share\\salome\\resources\\geom";
-#else
- aResDir += "/share/salome/resources/geom";
-#endif
- Handle(Resource_Manager) aGeomResMgr = new Resource_Manager ("ImportExport", aResDir, aNull, Standard_False);
- if ( aGeomResMgr->Find("Import") || aGeomResMgr->Find("Export") ) {
- myResMgrList.push_back( aGeomResMgr );
- isResourceFound = true;
- }
-
- // Initialize the user's Resource Manager
- TCollection_AsciiString aResDirsStr;
- aResDirsStr = getenv("GEOM_ENGINE_RESOURCES_DIR");
- if ( !aResDirsStr.IsEmpty() )
- {
- std::string aSep = ":";
-#ifdef WIN32
- aSep = ";";
-#endif
- aResDir = aResDirsStr.Token(aSep.c_str(), 1);
- for (int i = 1; !aResDir.IsEmpty(); aResDir = aResDirsStr.Token(aSep.c_str(), ++i)) {
- Handle(Resource_Manager) anUserResMgr = new Resource_Manager ("ImportExport", aNull, aResDir, Standard_False);
- if (anUserResMgr->Find("Import") || anUserResMgr->Find("Export")) {
- myResMgrList.push_back( anUserResMgr );
- isResourceFound = true;
- }
- }
- }
- else
- {
- aResDir = getenv("HOME");
-#ifdef WIN32
- aResDir += "\\.config\\salome";
-#else
- aResDir += "/.config/salome";
-#endif
- Handle(Resource_Manager) anUserResMgr = new Resource_Manager ("ImportExport", aNull, aResDir, Standard_False);
- if (anUserResMgr->Find("Import") || anUserResMgr->Find("Export")) {
- myResMgrList.push_back( anUserResMgr );
- isResourceFound = true;
- }
- }
- return isResourceFound;
-}
-
//=============================================================================
/*!
* RestoreShape
if (theTextureFile.IsEmpty()) return 0;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture;
-#else
- Handle(TDataStd_HArray1OfByte) aTexture;
-#endif
FILE* fp = fopen(theTextureFile.ToCString(), "r");
if (!fp) return 0;
if (bytedata.empty() || bytedata.size() != lines.size()*lenbytes)
return 0;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
aTexture = new TColStd_HArray1OfByte (1, lines.size()*lenbytes);
-#else
- aTexture = new TDataStd_HArray1OfByte (1, lines.size()*lenbytes);
-#endif
std::list<unsigned char>::iterator bdit;
int i;
}
int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight,
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
const Handle(TColStd_HArray1OfByte)& theTexture)
-#else
- const Handle(TDataStd_HArray1OfByte)& theTexture)
-#endif
{
SetErrorCode(KO);
int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
return aTextureId;
}
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theTextureId,
-#else
-Handle(TDataStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theTextureId,
-#endif
- int& theWidth, int& theHeight)
+ int& theWidth, int& theHeight)
{
SetErrorCode(KO);
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture;
-#else
- Handle(TDataStd_HArray1OfByte) aTexture;
-#endif
theWidth = theHeight = 0;
TCollection_AsciiString aFileName;
SetErrorCode(OK);
return id_list;
}
-
-TopAbs_ShapeEnum getGroupDimension(XAO::Group* group)
-{
- XAO::Dimension dim = group->getDimension();
- TopAbs_ShapeEnum rdim;
- switch ( dim )
- {
- case XAO::VERTEX:
- rdim = TopAbs_VERTEX; break;
- case XAO::EDGE:
- rdim = TopAbs_EDGE; break;
- case XAO::FACE:
- rdim = TopAbs_FACE; break;
- case XAO::SOLID:
- rdim = TopAbs_SOLID; break;
- default:
- rdim = TopAbs_COMPOUND; break;
- }
- return rdim;
-}
-
-XAO::Dimension shapeEnumToDimension(const TopAbs_ShapeEnum& shape)
-{
- XAO::Dimension dim;
- switch( shape ) {
- case TopAbs_VERTEX:
- dim = XAO::VERTEX; break;
- case TopAbs_EDGE:
- dim = XAO::EDGE; break;
- case TopAbs_FACE:
- dim = XAO::FACE; break;
- case TopAbs_SOLID:
- dim = XAO::SOLID; break;
- default:
- throw SALOME_Exception("Bad type"); // TODO
- }
- return dim;
-}
-
-void GEOMImpl_IInsertOperations::exportGroups(std::list<Handle(GEOM_Object)> groupList,
- XAO::Xao* xaoObject,
- XAO::BrepGeometry* geometry)
-{
- // add the groups
- std::list<Handle(GEOM_Object)>::iterator groupIterator = groupList.begin();
- while (groupIterator != groupList.end())
- {
- Handle(GEOM_Object) currGroup = (*groupIterator++);
- Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup);
-
- TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup);
- XAO::Dimension dim = shapeEnumToDimension(shapeGroup);
- XAO::Group* group = xaoObject->addGroup(dim, currGroup->GetName().ToCString());
-
- switch (shapeGroup)
- {
- case TopAbs_VERTEX:
- for (int i = 1; i <= groupIds->Length(); i++)
- {
- std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
- int index = geometry->getVertexIndexByReference(ref);
- group->add(index);
- }
- break;
- case TopAbs_EDGE:
- for (int i = 1; i <= groupIds->Length(); i++)
- {
- std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
- int index = geometry->getEdgeIndexByReference(ref);
- group->add(index);
- }
- break;
- case TopAbs_FACE:
- for (int i = 1; i <= groupIds->Length(); i++)
- {
- std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
- int index = geometry->getFaceIndexByReference(ref);
- group->add(index);
- }
- break;
- case TopAbs_SOLID:
- for (int i = 1; i <= groupIds->Length(); i++)
- {
- std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
- int index = geometry->getSolidIndexByReference(ref);
- group->add(index);
- }
- break;
- }
- }
-}
-
-void GEOMImpl_IInsertOperations::exportFields(std::list<Handle(GEOM_Field)> fieldList,
- XAO::Xao* xaoObject,
- XAO::BrepGeometry* geometry)
-{
- std::list<Handle(GEOM_Field)>::iterator fieldIterator = fieldList.begin();
- while (fieldIterator != fieldList.end())
- {
- Handle(GEOM_Field) currField = (*fieldIterator++);
-
- int fdim = currField->GetDimension();
- int ftype = currField->GetDataType();
- int nbComponents = currField->GetNbComponents();
- std::string name = currField->GetName().ToCString();
-
- XAO::Field* field = xaoObject->addField((XAO::Type)ftype, (XAO::Dimension)fdim, nbComponents, name);
-
- Handle(TColStd_HArray1OfExtendedString) components = currField->GetComponents();
- for (int i = components->Lower(), j = 0; i <= components->Upper(); ++i, ++j)
- {
- field->setComponentName(j, TCollection_AsciiString(components->Value(i)).ToCString());
- }
-
- std::list< Handle(GEOM_FieldStep)> steps = currField->GetSteps();
- std::list<Handle(GEOM_FieldStep)>::iterator stepIterator = steps.begin();
- while (stepIterator != steps.end())
- {
- Handle(GEOM_FieldStep) currStep = (*stepIterator++);
-
- XAO::Step* step = field->addNewStep(currStep->GetID());
- step->setStamp(currStep->GetStamp());
-
- switch (ftype)
- {
- case 0: // bool
- {
- XAO::BooleanStep* bs = (XAO::BooleanStep*)step;
- Handle(TColStd_HArray1OfInteger) bvalues = currStep->GetIntValues();
- std::vector<bool> bv;
- bv.reserve(bvalues->Upper());
- for ( int i = bvalues->Lower(), nb = bvalues->Upper(); i <= nb; ++i )
- {
- bv.push_back(bvalues->Value(i) != 0);
- }
- bs->setValues(bv);
- break;
- }
- case 1: // integer
- {
- XAO::IntegerStep* is = (XAO::IntegerStep*)step;
- Handle(TColStd_HArray1OfInteger) ivalues = currStep->GetIntValues();
- std::vector<int> iv;
- iv.reserve(ivalues->Upper());
- for ( int i = ivalues->Lower(), nb = ivalues->Upper(); i <= nb; ++i )
- {
- iv.push_back(ivalues->Value(i));
- }
- is->setValues(iv);
- break;
- }
- case 2: // double
- {
- XAO::DoubleStep* ds = (XAO::DoubleStep*)step;
- Handle(TColStd_HArray1OfReal) dvalues = currStep->GetDoubleValues();
- std::vector<double> dv;
- dv.reserve(dvalues->Upper());
- for ( int i = dvalues->Lower(), nb = dvalues->Upper(); i <= nb; ++i )
- {
- dv.push_back(dvalues->Value(i));
- }
- ds->setValues(dv);
- break;
- }
- case 3: // string
- {
- XAO::StringStep* ss = (XAO::StringStep*)step;
- Handle(TColStd_HArray1OfExtendedString) svalues = currStep->GetStringValues();
- std::vector<std::string> sv;
- sv.reserve(svalues->Upper());
- for ( int i = svalues->Lower(), nb = svalues->Upper(); i <= nb; ++i )
- {
- sv.push_back(TCollection_AsciiString(svalues->Value(i)).ToCString());
- }
- ss->setValues(sv);
- break;
- }
- }
- }
- }
-}
-
-void GEOMImpl_IInsertOperations::exportSubshapes(const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry)
-{
- Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects(shape, false);
- int nbSubObjects = subObjects->Length();
- // set the names of the sub shapes
- for (int i = 1; i <= nbSubObjects; i++)
- {
- Handle(Standard_Transient) transientSubObject = subObjects->Value(i);
- if (transientSubObject.IsNull())
- continue;
-
- Handle(GEOM_Object) subObject = Handle(GEOM_Object)::DownCast(transientSubObject);
- if (subObject->GetType() != GEOM_GROUP)
- {
- int subIndex = myShapesOperations->GetSubShapeIndex(shape, subObject);
- switch (subObject->GetValue().ShapeType())
- {
- case TopAbs_VERTEX:
- geometry->changeVertexName(subIndex, subObject->GetName().ToCString());
- break;
- case TopAbs_EDGE:
- geometry->changeEdgeName(subIndex, subObject->GetName().ToCString());
- break;
- case TopAbs_FACE:
- geometry->changeFaceName(subIndex, subObject->GetName().ToCString());
- break;
- case TopAbs_SOLID:
- geometry->changeSolidName(subIndex, subObject->GetName().ToCString());
- break;
- }
- }
- }
-}
-
-//=============================================================================
-/*!
- * Export a shape to XAO format
- * \param shape The shape to export
- * \param groups The list of groups to export
- * \param fields The list of fields to export
- * \param fileName The name of the file to exported
- * \return boolean indicating if export was succeful.
- */
-//=============================================================================
-bool GEOMImpl_IInsertOperations::ExportXAO(Handle(GEOM_Object) shape,
- std::list<Handle(GEOM_Object)> groupList,
- std::list<Handle(GEOM_Field)> fieldList,
- const char* author,
- const char* fileName)
-{
- SetErrorCode(KO);
-
- if (shape.IsNull()) return false;
-
- // add a new shape function with parameters
- Handle(GEOM_Function) lastFunction = shape->GetLastFunction();
- if (lastFunction.IsNull()) return false;
-
- // add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
-
- // add an Export function
- Handle(GEOM_Function) exportFunction = result->AddFunction(GEOMImpl_XAODriver::GetID(), IMPORTEXPORT_EXPORTXAO);
- if (exportFunction.IsNull()) return false;
- if (exportFunction->GetDriverGUID() != GEOMImpl_XAODriver::GetID()) return false;
-
- // create the XAO object
- XAO::Xao* xaoObject = new XAO::Xao();
- xaoObject->setAuthor(author);
-
- // add the geometry
- XAO::BrepGeometry* geometry = (XAO::BrepGeometry*)XAO::Geometry::createGeometry(XAO::BREP);
- TopoDS_Shape topoShape = shape->GetValue();
- exportFunction->SetValue(topoShape);
- XAO::BrepGeometry* brep = (XAO::BrepGeometry*)geometry;
- brep->setTopoDS_Shape(topoShape);
-
- geometry->setName(shape->GetName().ToCString());
- exportSubshapes(shape, geometry);
- xaoObject->setGeometry(geometry);
-
- exportGroups(groupList, xaoObject, geometry);
- exportFields(fieldList, xaoObject, geometry);
-
- // export the XAO to the file
- xaoObject->exportXAO(fileName);
-
- // make a Python command
- GEOM::TPythonDump pd(exportFunction);
- pd << "exported = geompy.ExportXAO(" << shape;
-
- // list of groups
- pd << ", [";
- if (groupList.size() > 0)
- {
- std::list<Handle(GEOM_Object)>::iterator itGroup = groupList.begin();
- pd << (*itGroup++);
- while (itGroup != groupList.end())
- {
- pd << ", " << (*itGroup++);
- }
- }
-
- // list of fields
- pd << "], [";
- if (fieldList.size() > 0)
- {
- std::list<Handle(GEOM_Field)>::iterator itField = fieldList.begin();
- pd << (*itField++);
- while (itField != fieldList.end())
- {
- pd << ", " << (*itField++);
- }
- }
- pd << "], ";
- pd << "\"" << author << "\", \"" << fileName << "\")";
-
- SetErrorCode(OK);
- delete xaoObject;
-
- return true;
-}
-
-void GEOMImpl_IInsertOperations::importSubShapes(XAO::Geometry* xaoGeometry,
- Handle(GEOM_Function) function, int shapeType, int dim,
- Handle(TColStd_HSequenceOfTransient)& subShapeList)
-{
- Handle(GEOM_Object) subShape;
- Handle(GEOM_Function) aFunction;
- Handle(TColStd_HArray1OfInteger) anArray;
-
- XAO::GeometricElementList::iterator elementIterator = xaoGeometry->begin((XAO::Dimension)dim);
- for (; elementIterator != xaoGeometry->end((XAO::Dimension)dim); elementIterator++)
- {
- XAO::GeometricElement element = elementIterator->second;
- if (!element.hasName())
- continue;
-
- std::string name = element.getName();
- std::string ref = element.getReference();
- int iref = XAO::XaoUtils::stringToInt(ref);
-
- anArray = new TColStd_HArray1OfInteger(1, 1);
- anArray->SetValue(1, iref);
-
- subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
- Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1);
- if (aFunction.IsNull())
- return;
-
- subShape->SetName(name.c_str());
- subShape->SetType(shapeType);
-
- GEOM_ISubShape aSSI(aFunction);
- aSSI.SetMainShape(function);
- aSSI.SetIndices(anArray);
-
- //aFunction->SetValue(aValue);
- subShapeList->Append(subShape);
-
- // Put this subshape in the list of sub-shapes of theMainShape
- function->AddSubShapeReference(aFunction);
- }
-}
-
-//=============================================================================
-/*!
- * Import a shape from XAO format
- * \param fileName The name of the file to import
- * \param shape The imported shape
- * \param subShapes The list of imported groups
- * \param groups The list of imported groups
- * \param fields The list of imported fields
- * \return boolean indicating if import was succeful.
- */
-//=============================================================================
-bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName,
- Handle(GEOM_Object)& shape,
- Handle(TColStd_HSequenceOfTransient)& subShapes,
- Handle(TColStd_HSequenceOfTransient)& groups,
- Handle(TColStd_HSequenceOfTransient)& fields)
-{
- SetErrorCode(KO);
-
- if (fileName == NULL || groups.IsNull() || fields.IsNull())
- return false;
-
- // Read the XAO
- XAO::Xao* xaoObject = new XAO::Xao();
- try
- {
- xaoObject->importXAO(fileName);
- }
- catch (XAO::XAO_Exception& exc)
- {
- delete xaoObject;
- SetErrorCode(exc.what());
- return false;
- }
-
- XAO::Geometry* xaoGeometry = xaoObject->getGeometry();
- if (xaoGeometry == NULL)
- {
- delete xaoObject;
- SetErrorCode("Cannot import XAO: geometry format not supported.");
- return false;
- }
-
- // create the shape
- shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
- Handle(GEOM_Function) function = shape->AddFunction(GEOMImpl_XAODriver::GetID(), IMPORTEXPORT_EXPORTXAO);
- if (function.IsNull()) return false;
- if (function->GetDriverGUID() != GEOMImpl_XAODriver::GetID()) return false;
-
- // set the geometry
- if (xaoGeometry->getFormat() == XAO::BREP)
- {
- XAO::BrepGeometry* brep = (XAO::BrepGeometry*)xaoGeometry;
- TopoDS_Shape geomShape = brep->getTopoDS_Shape();
- function->SetValue(geomShape);
- shape->SetName(xaoGeometry->getName().c_str());
- }
- else
- {
- delete xaoObject;
- SetErrorCode("Cannot import XAO: geometry format not supported.");
- return false;
- }
-
- // create sub shapes with names
- importSubShapes(xaoGeometry, function, GEOM_POINT, XAO::VERTEX, subShapes);
- importSubShapes(xaoGeometry, function, GEOM_EDGE, XAO::EDGE, subShapes);
- importSubShapes(xaoGeometry, function, GEOM_FACE, XAO::FACE, subShapes);
- importSubShapes(xaoGeometry, function, GEOM_SOLID, XAO::SOLID, subShapes);
-
- // create groups
- int nbGroups = xaoObject->countGroups();
- for (int i = 0; i < nbGroups; ++i)
- {
- XAO::Group* xaoGroup = xaoObject->getGroup(i);
-
- // build an array with the indexes of the sub shapes
- int nbElt = xaoGroup->count();
- Handle(TColStd_HArray1OfInteger) array = new TColStd_HArray1OfInteger(1, nbElt);
- int j = 0;
- for (std::set<int>::iterator it = xaoGroup->begin(); it != xaoGroup->end(); ++it)
- {
- int index = (*it);
- std::string ref = xaoGeometry->getElementReference(xaoGroup->getDimension(), index);
- array->SetValue(++j, XAO::XaoUtils::stringToInt(ref));
- }
-
- // create the group with the array of sub shapes indexes
- Handle(GEOM_Object) group = GetEngine()->AddSubShape(shape, array);
- group->SetType(GEOM_GROUP);
- group->SetName(xaoGroup->getName().c_str());
-
- // Set a sub-shape type
- TDF_Label freeLabel = group->GetFreeLabel();
- TDataStd_Integer::Set(freeLabel, (Standard_Integer) getGroupDimension(xaoGroup));
- groups->Append(group);
-
- function = group->GetLastFunction();
- }
-
- // create the fields
- int nbFields = xaoObject->countFields();
- for (int i = 0; i < nbFields; ++i)
- {
- XAO::Field* xaoField = xaoObject->getField(i);
-
- Handle(TColStd_HArray1OfExtendedString) components = new TColStd_HArray1OfExtendedString(0, xaoField->countComponents()-1);
- for (int j = 0; j < xaoField->countComponents(); ++j)
- {
- components->SetValue(j, (TCollection_ExtendedString)xaoField->getComponentName(j).c_str());
- }
-
- Handle(GEOM_Field) field = myFieldOperations->CreateField(shape,
- xaoField->getName().c_str(),
- (int)xaoField->getType(),
- (int)xaoField->getDimension(),
- components);
-
- switch (xaoField->getType())
- {
- case XAO::BOOLEAN:
- {
- XAO::BooleanField* bfield = (XAO::BooleanField*)xaoField;
- for (int j = 0; j < xaoField->countSteps(); ++j)
- {
- XAO::BooleanStep* bstep = bfield->getStep(j);
- Handle(GEOM_FieldStep) step = field->AddStep(bstep->getStep(), bstep->getStamp());
-
- Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, bstep->countValues()-1);
- std::vector<bool> bvalues = bstep->getValues();
- for (int k = 0; k < bstep->countValues(); ++k)
- {
- values->SetValue(k, bvalues[k] ? 1 : 0);
- }
- step->SetValues(values);
- }
- break;
- }
- case XAO::INTEGER:
- {
- XAO::IntegerField* ifield = (XAO::IntegerField*)xaoField;
- for (int j = 0; j < xaoField->countSteps(); ++j)
- {
- XAO::IntegerStep* istep = ifield->getStep(j);
- Handle(GEOM_FieldStep) step = field->AddStep(istep->getStep(), istep->getStamp());
-
- Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, istep->countValues()-1);
- std::vector<int> ivalues = istep->getValues();
- for (int k = 0; k < istep->countValues(); ++k)
- {
- values->SetValue(k, ivalues[k]);
- }
- step->SetValues(values);
- }
- break;
- }
- case XAO::DOUBLE:
- {
- XAO::DoubleField* dfield = (XAO::DoubleField*)xaoField;
- for (int j = 0; j < xaoField->countSteps(); ++j)
- {
- XAO::DoubleStep* dstep = dfield->getStep(j);
- Handle(GEOM_FieldStep) step = field->AddStep(dstep->getStep(), dstep->getStamp());
-
- Handle(TColStd_HArray1OfReal) values = new TColStd_HArray1OfReal(0, dstep->countValues()-1);
- std::vector<double> dvalues = dstep->getValues();
- for (int k = 0; k < dstep->countValues(); ++k)
- {
- values->SetValue(k, dvalues[k]);
- }
- step->SetValues(values);
- }
- break;
- }
- case XAO::STRING:
- {
- XAO::StringField* sfield = (XAO::StringField*)xaoField;
- for (int j = 0; j < xaoField->countSteps(); ++j)
- {
- XAO::StringStep* sstep = sfield->getStep(j);
- Handle(GEOM_FieldStep) step = field->AddStep(sstep->getStep(), sstep->getStamp());
-
- Handle(TColStd_HArray1OfExtendedString) values = new TColStd_HArray1OfExtendedString(0, sstep->countValues()-1);
- std::vector<std::string> svalues = sstep->getValues();
- for (int k = 0; k < sstep->countValues(); ++k)
- {
- values->SetValue(k, TCollection_ExtendedString(svalues[k].c_str()));
- }
- step->SetValues(values);
- }
- break;
- }
- }
-
- fields->Append(field);
- }
-
- // make a Python command
- GEOM::TPythonDump pd(function);
- pd << "(imported, " << shape << ", ";
-
- // list of sub shapes
- pd << "[";
- int nbSubshapes = subShapes->Length();
- if (nbSubshapes > 0)
- {
- for (int i = 1; i <= nbSubshapes; i++)
- {
- Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(subShapes->Value(i));
- pd << obj << ((i < nbSubshapes) ? ", " : "");
- }
- }
- pd << "], [";
-
- // list of groups
- if (nbGroups > 0)
- {
- for (int i = 1; i <= nbGroups; i++)
- {
- Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(groups->Value(i));
- pd << obj << ((i < nbGroups) ? ", " : "");
- }
- }
-
- pd << "], [";
-
- // list of fields
- if (nbFields > 0)
- {
- for (int i = 1; i <= nbFields; i++)
- {
- Handle(GEOM_Field) obj = Handle(GEOM_Field)::DownCast(fields->Value(i));
- pd << obj << ((i < nbFields) ? ", " : "");
- }
- }
- pd << "]";
- pd << ") = geompy.ImportXAO(\"" << fileName << "\")";
-
- delete xaoObject;
- SetErrorCode(OK);
-
- return true;
-}
-
-//=============================================================================
-/*!
- * This method creates material groups for an imported object.
- * \param theObject the imported object.
- */
-//=============================================================================
-void GEOMImpl_IInsertOperations::MakeMaterialGroups
- (const Handle(GEOM_Object) &theObject,
- const Handle(TColStd_HSequenceOfTransient) &theSeq)
-{
- TopoDS_Shape aResShape = theObject->GetValue();
-
- if (aResShape.IsNull() == Standard_False) {
- // Group shapes by material names.
- Handle(GEOM_Function) aFunction = theObject->GetLastFunction();
- DataMapOfStringListOfShape aMapMaterialShapes;
-
- // check all named shapes using iterator
- TDF_ChildIDIterator anIt (aFunction->GetNamingEntry(),
- TNaming_NamedShape::GetID(), Standard_True);
-
- for (; anIt.More(); anIt.Next()) {
- Handle(TNaming_NamedShape) anAttr =
- Handle(TNaming_NamedShape)::DownCast(anIt.Value());
-
- if (anAttr.IsNull() == Standard_False) {
- TDF_Label aLabel = anAttr->Label();
- Handle(TDataStd_Comment) aComment;
-
- if (aLabel.FindAttribute(TDataStd_Comment::GetID(), aComment)) {
- TCollection_ExtendedString aMatName = aComment->Get();
- TopoDS_Shape aShape = anAttr->Get();
-
- if (aMapMaterialShapes.IsBound(aMatName) == Standard_False) {
- NCollection_List<TopoDS_Shape> anEmptyList;
-
- aMapMaterialShapes.Bind(aMatName, anEmptyList);
- }
-
- aMapMaterialShapes(aMatName).Append(aShape);
- }
- }
- }
-
- if (aMapMaterialShapes.IsEmpty() == Standard_False) {
- // Construct groups.
- TopAbs_ShapeEnum aType = aResShape.ShapeType();
- Standard_Integer i;
- DataMapOfStringListOfShape::Iterator aMapIter;
-
- // Check each shape type.
- for(i = aType; i <= TopAbs_VERTEX; i++) {
- DataMapOfStringListOfShape::Iterator aMapIter(aMapMaterialShapes);
-
- for (; aMapIter.More(); aMapIter.Next()) {
- NCollection_List<TopoDS_Shape> &aShList = aMapIter.ChangeValue();
- NCollection_List<TopoDS_Shape>::Iterator aShIter(aShList);
- NCollection_List<TopoDS_Shape> aShListSameType;
-
- while (aShIter.More()) {
- const TopoDS_Shape &aShape = aShIter.Value();
-
- if (i == aShape.ShapeType()) {
- // Treat this element.
- aShListSameType.Append(aShape);
- aShList.Remove(aShIter);
- } else {
- // Go to the next element.
- aShIter.Next();
- }
- }
-
- if (aShListSameType.IsEmpty() == Standard_False) {
- // Construct a group.
- Handle(GEOM_Object) aGroup =
- MakeGroup(theObject, aMapIter.Key(), aShListSameType);
-
- if (aGroup.IsNull() == Standard_False) {
- theSeq->Append(aGroup);
- }
- }
- }
- }
- }
- }
-}
-
-
-//=============================================================================
-/*!
- * This method creates a group of shapes of certain type.
- * \param theObject the imported object.
- * \param theName the material name.
- * \param theShapes the list of shapes to be added to this group.
- * \return the created group.
- */
-//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeGroup
- (const Handle(GEOM_Object) &theObject,
- const TCollection_ExtendedString &theName,
- const NCollection_List<TopoDS_Shape> &theShapes)
-{
- Handle(GEOM_Object) aGroup;
- TopTools_IndexedMapOfShape anIndices;
- Handle(TColStd_HSequenceOfInteger) aSeqIDs = new TColStd_HSequenceOfInteger;
- NCollection_List<TopoDS_Shape>::Iterator anIter(theShapes);
-
- TopExp::MapShapes(theObject->GetValue(), anIndices);
-
- // Compose shape IDs.
- for (; anIter.More(); anIter.Next()) {
- const TopoDS_Shape &aShape = anIter.Value();
- const Standard_Integer anIndex = anIndices.FindIndex(aShape);
-
- if (anIndex > 0) {
- aSeqIDs->Append(anIndex);
- }
- }
-
- if (aSeqIDs->IsEmpty() == Standard_False) {
- // Create a group.
- const TopAbs_ShapeEnum aType = theShapes.First().ShapeType();
-
- aGroup = myGroupOperations->CreateGroup(theObject, aType);
-
- if (aGroup.IsNull() == Standard_False) {
- aGroup->GetLastFunction()->SetDescription("");
- myGroupOperations->UnionIDs(aGroup, aSeqIDs);
- aGroup->GetLastFunction()->SetDescription("");
-
- // Compose the group name.
- TCollection_AsciiString aGroupName(theName);
-
- switch(aType) {
- case TopAbs_VERTEX:
- aGroupName += "_VERTEX";
- break;
- case TopAbs_EDGE:
- aGroupName += "_EDGE";
- break;
- case TopAbs_WIRE:
- aGroupName += "_WIRE";
- break;
- case TopAbs_FACE:
- aGroupName += "_FACE";
- break;
- case TopAbs_SHELL:
- aGroupName += "_SHELL";
- break;
- case TopAbs_SOLID:
- aGroupName += "_SOLID";
- break;
- case TopAbs_COMPSOLID:
- aGroupName += "_COMPSOLID";
- break;
- case TopAbs_COMPOUND:
- aGroupName += "_COMPOUND";
- break;
- default:
- aGroupName += "_SHAPE";
- break;
- }
-
- aGroup->SetName(aGroupName.ToCString());
- }
- }
-
- return aGroup;
-}
class GEOMImpl_IGroupOperations;
class GEOMImpl_IFieldOperations;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
class Handle_TColStd_HArray1OfByte;
-#else
-class Handle_TDataStd_HArray1OfByte;
-#endif
-
-namespace XAO {
- class Geometry;
- class BrepGeometry;
- class Xao;
-}
-
-typedef NCollection_DataMap<TCollection_ExtendedString, NCollection_List<TopoDS_Shape> >
- DataMapOfStringListOfShape;
class GEOMImpl_IInsertOperations : public GEOM_IOperations {
public:
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatType);
- Standard_EXPORT Standard_Boolean ImportTranslators (Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns);
-
- Standard_EXPORT Standard_Boolean ExportTranslators (Handle(TColStd_HSequenceOfAsciiString)& theFormats,
- Handle(TColStd_HSequenceOfAsciiString)& thePatterns);
-
- Standard_EXPORT Standard_Boolean IsSupported (const Standard_Boolean isImport,
- const TCollection_AsciiString& theFormat,
- Handle(TCollection_HAsciiString)& theLibName);
-
Standard_EXPORT Handle(GEOM_Object) RestoreShape (std::istringstream& theStream);
Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile);
Standard_EXPORT int AddTexture(int theWidth, int theHeight,
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
const Handle(TColStd_HArray1OfByte)& theTexture);
-#else
- const Handle(TDataStd_HArray1OfByte)& theTexture);
-#endif
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Standard_EXPORT Handle(TColStd_HArray1OfByte) GetTexture(int theTextureId,
-#else
- Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId,
-#endif
- int& theWidth, int& theHeight);
+ int& theWidth, int& theHeight);
Standard_EXPORT std::list<int> GetAllTextures();
- Standard_EXPORT bool ExportXAO(Handle(GEOM_Object) shape,
- std::list<Handle(GEOM_Object)> groupList,
- std::list<Handle(GEOM_Field)> fieldList,
- const char* author,
- const char* fileName);
-
- Standard_EXPORT bool ImportXAO(const char* fileName,
- Handle(GEOM_Object)& shape,
- Handle(TColStd_HSequenceOfTransient)& subShapes,
- Handle(TColStd_HSequenceOfTransient)& groups,
- Handle(TColStd_HSequenceOfTransient)& fields);
-
- private:
- Standard_Boolean InitResMgr ();
-
- void importSubShapes(XAO::Geometry* xaoGeometry, Handle(GEOM_Function) function,
- int shapeType, int dim,
- Handle(TColStd_HSequenceOfTransient)& subshapeList);
- void exportSubshapes(const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry);
- void exportFields(std::list<Handle(GEOM_Field)> fieldList, XAO::Xao* xaoObject,
- XAO::BrepGeometry* geometry);
- void exportGroups(std::list<Handle(GEOM_Object)> groupList, XAO::Xao* xaoObject,
- XAO::BrepGeometry* geometry);
-
- void MakeMaterialGroups(const Handle(GEOM_Object) &theObject,
- const Handle(TColStd_HSequenceOfTransient) &theSeq);
-
- Handle(GEOM_Object) MakeGroup
- (const Handle(GEOM_Object) &theObject,
- const TCollection_ExtendedString &theName,
- const NCollection_List<TopoDS_Shape> &theShapes);
-
private:
std::vector<Handle(Resource_Manager)> myResMgrList;
GEOMImpl_IShapesOperations* myShapesOperations;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("2D Fillet driver failed");
return NULL;
//Compute the Fillet value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("1D Fillet driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Chamfer value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Chamfer driver failed");
return NULL;
//Compute the Archimede value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Archimede driver failed");
return NULL;
int geom_type = theShape->GetType();
// check if it's advanced shape
- if ( geom_type > ADVANCED_BASE ) {
+ if ( geom_type > USER_TYPE ) {
SetErrorCode(OK);
return SK_ADVANCED;
}
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Ax3 anAx3 = GEOMUtils::GetPosition(aShape);
//Compute the CentreOfMass value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute centre of mass");
return NULL;
//Compute
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vertex by index driver failed.");
return NULL;
//Compute the Normale value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute normake of face");
return NULL;
//Compute the parameters
GProp_GProps LProps, SProps;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepGProp::LinearProperties(aShape, LProps);
theLength = LProps.Mass();
GProp_GProps System;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (aShape.ShapeType() == TopAbs_VERTEX ||
aShape.ShapeType() == TopAbs_EDGE ||
aShape.ShapeType() == TopAbs_WIRE) {
Bnd_Box B;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepBuilderAPI_Copy aCopyTool (aShape);
if (!aCopyTool.IsDone()) {
SetErrorCode("GetBoundingBox Error: Bad shape detected");
//Compute the BoundingBox value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Measure driver failed to compute a bounding box");
return NULL;
FaceMax = EdgeMax = VertMax = -RealLast();
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
for (TopExp_Explorer ExF (aShape, TopAbs_FACE); ExF.More(); ExF.Next()) {
TopoDS_Face Face = TopoDS::Face(ExF.Current());
T = BRep_Tool::Tolerance(Face);
//Compute the parameters
bool isValid = false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
BRepCheck_Analyzer ana (aShape, theIsCheckGeom);
if (ana.IsValid()) {
isValid = true;
Astr = Astr + " Number of sub-shapes : \n";
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
int iType, nbTypes [TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0;
//Compute the parameters
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Pnt aPnt1, aPnt2;
// Compute the extremities
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
// skl 30.06.2008
// additional workaround for bugs 19899, 19908 and 19910 from Mantis
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
theX = aPnt.X();
theY = aPnt.Y();
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Edge E1 = TopoDS::Edge(aLine1);
TopoDS_Edge E2 = TopoDS::Edge(aLine2);
}
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Edge aE1 = TopoDS::Edge(aVec1);
TopoDS_Edge aE2 = TopoDS::Edge(aVec2);
//Compute curvature
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomLProp_CLProps Prop = GeomLProp_CLProps
(aCurve, aP, 2, Precision::Confusion());
aRes = fabs(Prop.Curvature());
//Compute curvature
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomAPI_ProjectPointOnCurve PPCurve(aPoint, aCurve, aFP, aLP);
if(PPCurve.NbPoints()>0) {
GeomLProp_CLProps Prop = GeomLProp_CLProps
if (aSurf.IsNull()) return aRes;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
GeomLProp_SLProps Prop = GeomLProp_SLProps
(aSurf, theUParam, theVParam, 2, Precision::Confusion());
if(Prop.IsCurvatureDefined()) {
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+#include "GEOMImpl_IPolyline2D.hxx"
+
+#include <TColStd_HArray1OfInteger.hxx>
+
+
+//=============================================================================
+/*!
+ * SetCoords
+ */
+//=============================================================================
+void GEOMImpl_IPolyline2D::SetCoords
+ (const std::list <std::list <double> > &theValue)
+{
+ const Standard_Integer aNbSec = theValue.size();
+
+ if (aNbSec > 0) {
+ // Compute the total number of points and fill the array of start indices.
+ Standard_Integer i;
+ Standard_Integer aNbCoords = 0;
+ Handle(TColStd_HArray1OfInteger) anIndices =
+ new TColStd_HArray1OfInteger(1, aNbSec);
+ Handle(TColStd_HArray1OfReal) aCoords;
+ std::list <std::list <double> >::const_iterator aSecIter = theValue.begin();
+
+ for (i = 1; aSecIter != theValue.end(); ++aSecIter, ++i) {
+ anIndices->SetValue(i, aNbCoords + 1);
+ aNbCoords += aSecIter->size();
+ }
+
+ if (aNbCoords > 0) {
+ // Fill the array of coordinates.
+ std::list<double>::const_iterator aCIter;
+
+ aCoords = new TColStd_HArray1OfReal(1, aNbCoords);
+ aSecIter = theValue.begin();
+
+ for (i = 1; aSecIter != theValue.end(); ++aSecIter) {
+ for (aCIter = aSecIter->begin(); aCIter != aSecIter->end(); ++aCIter) {
+ aCoords->SetValue(i++, *aCIter);
+ }
+ }
+ }
+
+ // Store the coordinates.
+ if (aCoords.IsNull() == Standard_False) {
+ _func->SetRealArray(POLY_ARG_COORDS, aCoords);
+ }
+
+ _func->SetIntegerArray(POLY_ARG_START_INDICES, anIndices);
+ }
+}
+
+//=============================================================================
+/*!
+ * GetCoords
+ */
+//=============================================================================
+void GEOMImpl_IPolyline2D::GetCoords(std::list <std::list <double> > &theValue)
+{
+ theValue.clear();
+
+ Handle(TColStd_HArray1OfReal) aCoords =
+ _func->GetRealArray(POLY_ARG_COORDS);
+ Handle(TColStd_HArray1OfInteger) anIndices =
+ _func->GetIntegerArray(POLY_ARG_START_INDICES);
+
+ if (anIndices.IsNull() == Standard_False) {
+ const Standard_Integer aNbSec = anIndices->Length();
+
+ // Create an empty sections.
+ theValue.resize(aNbSec);
+
+ if (aCoords.IsNull() == Standard_False) {
+ Standard_Integer i;
+ Standard_Integer j;
+ std::list <std::list <double> >::iterator anIt = theValue.begin();
+
+ for (i = anIndices->Lower(); i <= anIndices->Upper(); ++i, ++anIt) {
+ const Standard_Integer iCoord1 = anIndices->Value(i);
+ const Standard_Integer iCoord2 = i + 1 > anIndices->Upper() ?
+ aCoords->Upper() + 1 : anIndices->Value(i + 1);
+
+ for (j = iCoord1; j < iCoord2; ++j) {
+ anIt->push_back(aCoords->Value(j));
+ }
+ }
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//NOTE: This is an interface to a function for the Polyline2D creation.
+
+
+#ifndef _GEOMImpl_IPolyline2D_HXX_
+#define _GEOMImpl_IPolyline2D_HXX_
+
+
+#include <GEOM_GEOMImpl.hxx>
+#include <GEOM_Function.hxx>
+
+#include <list>
+
+#include <TColStd_HArray1OfExtendedString.hxx>
+#include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+
+
+#define POLY_ARG_NAMES 1
+#define POLY_ARG_TYPES 2
+#define POLY_ARG_CLOSEDS 3
+#define POLY_ARG_COORDS 4
+#define POLY_ARG_START_INDICES 5
+#define POLY_ARG_WPLANE_DBLS 6
+#define POLY_ARG_WPLANE_OBJ 7
+
+
+class GEOMIMPL_EXPORT GEOMImpl_IPolyline2D
+{
+ public:
+
+ GEOMImpl_IPolyline2D(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+ void SetNames(const Handle_TColStd_HArray1OfExtendedString &theValue)
+ { _func->SetStringArray(POLY_ARG_NAMES, theValue); }
+
+ Handle_TColStd_HArray1OfExtendedString GetNames()
+ { return _func->GetStringArray(POLY_ARG_NAMES); }
+
+ void SetTypes(const Handle_TColStd_HArray1OfByte &theValue)
+ { _func->SetByteArray(POLY_ARG_TYPES, theValue); }
+
+ Handle_TColStd_HArray1OfByte GetTypes()
+ { return _func->GetByteArray(POLY_ARG_TYPES); }
+
+ void SetClosedFlags(const Handle_TColStd_HArray1OfByte &theValue)
+ { _func->SetBooleanArray(POLY_ARG_CLOSEDS, theValue); }
+
+ Handle_TColStd_HArray1OfByte GetClosedFlags()
+ { return _func->GetBooleanArray(POLY_ARG_CLOSEDS); }
+
+ void SetWorkingPlaneDbls(const Handle_TColStd_HArray1OfReal &thePlane)
+ { _func->SetRealArray(POLY_ARG_WPLANE_DBLS, thePlane); }
+
+ Handle_TColStd_HArray1OfReal GetWorkingPlaneDbls()
+ { return _func->GetRealArray(POLY_ARG_WPLANE_DBLS); }
+
+ void SetWorkingPlane(const Handle_GEOM_Function &thePlane)
+ { _func->SetReference(POLY_ARG_WPLANE_OBJ, thePlane); }
+
+ Handle_GEOM_Function GetWorkingPlane()
+ { return _func->GetReference(POLY_ARG_WPLANE_OBJ); }
+
+ void SetCoords(const std::list <std::list <double> > &theValue);
+
+ void GetCoords(std::list <std::list <double> > &theValue);
+
+ private:
+
+ Handle(GEOM_Function) _func;
+};
+
+#endif
//Compute the Edge value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
//Compute the Edge value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Vector driver failed");
return NULL;
//Compute the Edge value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed");
return NULL;
//Compute the shape
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed");
return NULL;
//Compute the Face value
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to compute a face");
return NULL;
//Compute the shape
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed");
return NULL;
//Compute the shape
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed");
return NULL;
//Compute the sub-shape value
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to glue faces");
return NULL;
//Compute the sub-shape value
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to glue faces");
return NULL;
//Compute the sub-shape value
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to glue edges");
return NULL;
//Compute the sub-shape value
Standard_Boolean isWarning = Standard_False;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to glue edges");
return NULL;
* GetExistingSubObjects
*/
//=============================================================================
-Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetExistingSubObjects
- (Handle(GEOM_Object) theShape,
- const Standard_Boolean theGroupsOnly)
+Handle(TColStd_HSequenceOfTransient)
+GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object) theShape,
+ const Standard_Boolean theGroupsOnly)
+{
+ // note: this method does not return fields
+
+ Standard_Integer types = theGroupsOnly ? Groups : Groups|SubShapes;
+ Handle(TColStd_HSequenceOfTransient) results = GetExistingSubObjects(theShape, types);
+
+ if (results->Length() > 0) {
+ //Make a Python command
+ TCollection_AsciiString anAsciiList;
+ for (int i = 1; i <= results->Length(); i++)
+ {
+ Handle(GEOM_BaseObject) obj = Handle(GEOM_BaseObject)::DownCast( results->Value(i));
+ obj->GetEntryString();
+ if ( i < results->Length() )
+ anAsciiList += ",";
+ }
+
+ GEOM::TPythonDump pd (theShape->GetLastFunction(), /*append=*/true);
+ pd << "[" << anAsciiList.ToCString();
+ pd << "] = geompy.GetExistingSubObjects(";
+ pd << theShape << ", " << (bool)theGroupsOnly << ")";
+ }
+
+ return results;
+}
+
+Handle(TColStd_HSequenceOfTransient)
+GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object) theShape,
+ const Standard_Integer theTypes)
{
SetErrorCode(KO);
SetErrorCode(KO);
- TCollection_AsciiString anAsciiList;
-
TDataStd_ListIteratorOfListOfExtendedString anIt (aListEntries);
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString anEntry = anIt.Value();
char* anEntryStr = new char[aStrLen+1];
anEntry.ToUTF8CString(anEntryStr);
Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false);
- if (!anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Object))) {
- if (!theGroupsOnly || anObj->GetType() == GEOM_GROUP) {
+ 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;
+ bool isField = anObj->IsKind(STANDARD_TYPE(GEOM_Field));
+ if (theTypes & Groups && isGroup ||
+ theTypes & SubShapes && isSubShape ||
+ theTypes & Fields && isField) {
aSeq->Append(anObj);
-
- // for python command
- anAsciiList += anEntryStr;
- anAsciiList += ",";
}
}
delete [] anEntryStr;
return aSeq;
}
- //Make a Python command
- anAsciiList.Trunc(anAsciiList.Length() - 1);
-
- GEOM::TPythonDump pd (aMainShape, /*append=*/true);
- pd << "[" << anAsciiList.ToCString();
- pd << "] = geompy.GetExistingSubObjects(";
- pd << theShape << ", " << (bool)theGroupsOnly << ")";
-
SetErrorCode(OK);
return aSeq;
*/
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
int iType, nbTypes [TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0;
//Compute the sub-shape value
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Shape driver failed to reverse shape");
return NULL;
// Compute tolerance
Standard_Real T, VertMax = -RealLast();
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
for (TopExp_Explorer ExV (theShape, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
TopoDS_Vertex Vertex = TopoDS::Vertex(ExV.Current());
T = BRep_Tool::Tolerance(Vertex);
class GEOMImpl_IShapesOperations : public GEOM_IOperations
{
public:
+
+ enum SubShapeType {
+ None = 0x00,
+ Groups = 0x01,
+ Fields = 0x02,
+ SubShapes = 0x04,
+ All = Groups | Fields | SubShapes,
+ };
+
Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IShapesOperations();
const Standard_Real theTolerance,
std::list<Handle(GEOM_Object)> theEdges);
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects
- (Handle(GEOM_Object) theShape,
- const Standard_Boolean theGroupsOnly);
-
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape,
+ const Standard_Boolean theGroupsOnly);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object) theShape,
+ const Standard_Integer theTypes = All);
+
enum ExplodeType {
EXPLODE_OLD_INCLUDE_MAIN,
EXPLODE_NEW_INCLUDE_MAIN,
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Translation driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the mirror
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Mirror driver failed");
return NULL;
//Compute the offset
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Offset driver failed");
return NULL;
//Compute the offset
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Offset driver failed");
return NULL;
//Compute the Projection
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Projection driver failed");
return NULL;
//Compute the Projection
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Projection driver failed");
return aResult;
//Compute the scale
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Scale driver failed");
return NULL;
//Compute the scale
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Scale driver failed");
return NULL;
//Compute the scale
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Scale driver failed");
return NULL;
//Compute the Position
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Position driver failed");
return NULL;
//Compute the position
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Position driver failed");
return NULL;
//Compute the position
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Position driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
//Compute the translation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Rotate driver failed");
return NULL;
// Compute the transformation
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
if (!GetSolver()->ComputeFunction(aFunction)) {
SetErrorCode("Driver failed");
return NULL;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <Standard_Stream.hxx>
+// internal includes
+#include "GEOMImpl_ImportDriver.hxx"
+#include "GEOMImpl_IImportExport.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+#include "GEOMImpl_Types.hxx"
-#include <GEOMImpl_ImportDriver.hxx>
-#include <GEOMImpl_IImportExport.hxx>
-#include <GEOMImpl_Types.hxx>
+// GEOM includes
#include <GEOM_Function.hxx>
+// OCC includes
+#include <Standard_Stream.hxx>
#include <TopoDS_Shape.hxx>
-#include <TCollection_HAsciiString.hxx>
-
-#include "utilities.h"
-
-#include <Standard_Failure.hxx>
-#include <StdFail_NotDone.hxx>
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-#ifdef WIN32
-#define LibHandle HMODULE
-#define LoadLib( name ) LoadLibrary( name )
-#define GetProc GetProcAddress
-#define UnLoadLib( handle ) FreeLibrary( handle );
-#else
-#define LibHandle void*
-#define LoadLib( name ) dlopen( name, RTLD_LAZY )
-#define GetProc dlsym
-#define UnLoadLib( handle ) dlclose( handle );
-#endif
-
-typedef TopoDS_Shape (*funcPoint)(const TCollection_AsciiString&,
- const TCollection_AsciiString&,
- TCollection_AsciiString&,
- const TDF_Label&);
-
-typedef Handle(TCollection_HAsciiString) (*pGetValue)(const TCollection_AsciiString&,
- const TCollection_AsciiString&,
- TCollection_AsciiString&);
-
//=======================================================================
//function : GetID
//purpose :
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
GEOMImpl_IImportExport aCI (aFunction);
- //Standard_Integer aType = aFunction->GetType();
// retrieve the file and plugin library names
TCollection_AsciiString aFileName = aCI.GetFileName();
TCollection_AsciiString aFormatName = aCI.GetFormatName();
- TCollection_AsciiString aLibName = aCI.GetPluginName();
- if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty())
+ if (aFileName.IsEmpty() || aFormatName.IsEmpty() )
return 0;
- // load plugin library
- LibHandle anImportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051
-
- // Get Import method
- funcPoint fp = 0;
- if ( anImportLib )
- fp = (funcPoint)GetProc( anImportLib, "Import" );
-
- if ( !fp ) {
- TCollection_AsciiString aMsg = aFormatName.SubString(1,4);
- aMsg += " plugin was not installed";
- Standard_Failure::Raise(aMsg.ToCString());
- }
-
- // perform the import
- TCollection_AsciiString anError;
- TopoDS_Shape aShape = fp(aFileName, aFormatName, anError, aFunction->GetNamingEntry());
-
- // unload plugin library
- // commented by enk:
- // the bug was occured: using ACIS Import/Export plugin
- //UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
-
- if ( aShape.IsNull() ) {
- StdFail_NotDone::Raise(anError.ToCString());
+ Handle(TColStd_HSequenceOfTransient) aSeq =
+ GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( GetDocID(), aFormatName, aFileName );
+ if( aSeq.IsNull() )
return 0;
- }
-
- // set the function result
- aFunction->SetValue(aShape);
+ Handle(GEOM_Object) anImported = Handle(GEOM_Object)::DownCast( aSeq->Value(1) );
+ TopoDS_Shape aShape = anImported->GetValue();
+ aFunction->SetValue( aShape );
log.SetTouched(Label());
return 1;
}
-//=======================================================================
-//function : ReadValue
-//purpose :
-//=======================================================================
-TCollection_AsciiString GEOMImpl_ImportDriver::ReadValue(const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theLibName,
- const TCollection_AsciiString& theParameterName,
- TCollection_AsciiString& theError)
-{
- TCollection_AsciiString aValue;
-
- if (theFileName.IsEmpty() || theLibName.IsEmpty() || theParameterName.IsEmpty())
- return aValue;
-
- // load plugin library
- LibHandle anImportLib = LoadLib(theLibName.ToCString()); //This is workaround of BUG OCC13051
- if (!anImportLib) {
- theError = theLibName + " library was not installed";
- return aValue;
- }
-
- // Get GetValue method
- pGetValue pGV = (pGetValue)GetProc(anImportLib, "GetValue");
-
- if (!pGV) {
- theError = theLibName + " library doesn't support GetValue method";
- return aValue;
- }
-
- Handle(TCollection_HAsciiString) aHValue = pGV(theFileName, theParameterName, theError);
-
- if (aHValue.IsNull()) {
- if (theError.IsEmpty())
- theError = theFileName + " doesn't contain requested parameter";
- return aValue;
- }
-
- aValue = aHValue->String();
-
- // unload plugin library
- // commented by enk:
- // the bug was occured: using ACIS Import/Export plugin
- //UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
-
- return aValue;
-}
-
-//================================================================================
-/*!
- * \brief Returns a name of creation operation and names and values of creation parameters
- */
-//================================================================================
-
bool GEOMImpl_ImportDriver::
GetCreationInformation(std::string& theOperationName,
std::vector<GEOM_Param>& theParams)
#ifndef _GEOMImpl_ImportDriver_HeaderFile
#define _GEOMImpl_ImportDriver_HeaderFile
-#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
-#include <TColStd_SequenceOfExtendedString.hxx>
-#endif
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
#ifndef _Standard_GUID_HeaderFile
#include <Standard_GUID.hxx>
#endif
Standard_EXPORT virtual
bool GetCreationInformation(std::string& theOperationName,
std::vector<GEOM_Param>& params);
-
- // Static method
- Standard_EXPORT static TCollection_AsciiString ReadValue (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theLibName,
- const TCollection_AsciiString& theParameterName,
- TCollection_AsciiString& theError);
-
DEFINE_STANDARD_RTTI( GEOMImpl_ImportDriver )
};
return theMode;
}
+//=======================================================================
+//function : BuildPipeShell
+//purpose : Builds a pipe shell. If failed, try to build in Descrete Trihedron
+// mode. Returns Standard_True if the building is done successfully.
+//=======================================================================
+static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
+{
+ theBuilder.Build();
+
+ Standard_Boolean isDone = theBuilder.IsDone();
+
+ if (!isDone) {
+ // Try to use Descrete Trihedron mode.
+ theBuilder.SetDiscreteMode();
+ theBuilder.Build();
+ isDone = theBuilder.IsDone();
+ }
+
+ return isDone;
+}
//=======================================================================
//function : FillForOtherEdges
if (!aBuilder.IsReady()) {
return false;
}
- aBuilder.Build();
+
+ BuildPipeShell(aBuilder);
+
TopoDS_Shape aShape = aBuilder.Shape();
/*
TopoDS_Compound C;
TopTools_SequenceOfShape aSeqBases;
TopTools_SequenceOfShape aSeqLocs;
TopTools_SequenceOfShape aSeqFaces;
+ Standard_Boolean NeedCreateSolid = Standard_False;
Standard_Integer i = 1;
for (i = 1; i <= nbBases; i++) {
//if for section was specified face with a few wires then a few
// pipes were build and make solid
- Standard_Boolean NeedCreateSolid = Standard_False;
if (aTypeBase == TopAbs_SHELL) {
// create wire as boundary contour if shell is no closed
// get free boundary shapes
if (!aBuilder.IsReady()) {
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
- aBuilder.Build();
+
+ BuildPipeShell(aBuilder);
+
TopoDS_Shape resShape = aBuilder.Shape();
aSeqRes.Append(resShape);
}
if (!aBuilder.IsReady()) {
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
- aBuilder.Build();
+
+ BuildPipeShell(aBuilder);
+
TopoDS_Shape resShape = aBuilder.Shape();
aSeqRes.Append(resShape);
// make sewing for result
aBuilder.SetTolerance(aTolConf, aTolConf, aTolAng);
- aBuilder.Build();
+ Standard_Boolean isDone = BuildPipeShell(aBuilder);
+
+ if (isDone && NeedCreateSolid) {
+ isDone = aBuilder.MakeSolid();
+ }
+
+ if (!isDone) {
+ Standard_ConstructionError::Raise("Pipe construction failure");
+ }
aShape = aBuilder.Shape();
aSeqFaces.Append(aShape);
for (j = 1; j <=usedBases.Length(); j++)
aBuilder.Delete(usedBases.Value(j));
}
-
- //for case if section is face
- if (aSeqFaces.Length() >1) {
- BRep_Builder aB;
- TopoDS_Compound aComp;
- aB.MakeCompound(aComp);
- for (i = 1; i <= aSeqFaces.Length(); i++)
- aB.Add(aComp,aSeqFaces.Value(i));
- aShape = aComp;
- }
}
return aShape;
if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
- aBuilder.Build();
+
+ BuildPipeShell(aBuilder);
+
TopoDS_Shape aShape = aBuilder.Shape();
TopoDS_Shell aShell;
B.MakeShell(aShell);
if (aCI) delete aCI;
Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
}
- aBuilder.Build();
+
+ BuildPipeShell(aBuilder);
+
TopoDS_Shape aShape = aBuilder.Shape();
TopoDS_Shell aShell;
B.MakeShell(aShell);
gp_Vec aVec(BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
gp_Dir BiNormal(aVec);
PipeBuilder.SetMode(BiNormal);
- PipeBuilder.Build();
- if (aShapeBase.ShapeType() == TopAbs_FACE) {
+
+ Standard_Boolean isDone = BuildPipeShell(PipeBuilder);
+
+ if (isDone && aShapeBase.ShapeType() == TopAbs_FACE) {
PipeBuilder.MakeSolid();
}
if (FaceBuilder.IsDone())
Sweep.SetMode(FaceBuilder.Face());
Sweep.Add(Profile);
- Sweep.Build();
-
- if (!Sweep.IsDone())
+
+ Standard_Boolean isDone = BuildPipeShell(Sweep);
+
+ if (!isDone)
{
if (aCI) delete aCI;
Standard_ConstructionError::Raise("MakePipeShell failed");
else
{
GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
- aShape = BRepOffsetAPI_MakePipe(aWirePath, aShapeBase, theBestMode);
+ BRepOffsetAPI_MakePipe aMkPipe(aWirePath, aShapeBase, theBestMode);
+
+ if (aMkPipe.IsDone()) {
+ aShape = aMkPipe.Shape();
+ } else if (theBestMode != GeomFill_IsDiscreteTrihedron) {
+ // Try to use Descrete Trihedron mode.
+ BRepOffsetAPI_MakePipe aMkPipeDescrete
+ (aWirePath, aShapeBase, GeomFill_IsDiscreteTrihedron);
+
+ if (aMkPipeDescrete.IsDone()) {
+ aShape = aMkPipeDescrete.Shape();
+ }
+ }
}
}
#include <BRepOffsetAPI_MakePipe.hxx>
#include <BRepOffsetAPI_MakePipeShell.hxx>
-#if OCC_VERSION_LARGE > 0x06050300
#include <BRepOffsetAPI_MiddlePath.hxx>
-#endif
#include <TopAbs.hxx>
#include <TopExp.hxx>
if (aShape.IsNull() || aBase1.IsNull() || aBase2.IsNull())
Standard_NullObject::Raise("RestorePath aborted : null argument");
-#if OCC_VERSION_LARGE > 0x06050300
BRepOffsetAPI_MiddlePath aMPB (aShape, aBase1, aBase2);
aMPB.Build();
if (aMPB.IsDone()) {
aRes = aMPB.Shape();
}
-#else
- Standard_NullObject::Raise("RestorePath is not implemented in used OCCT version");
-#endif
}
else if (aType == PIPE_PATH_TWO_SEQS) {
GEOMImpl_IPipePath aPI (aFunction);
if (aShape.IsNull() || aBase1.IsNull() || aBase2.IsNull())
Standard_NullObject::Raise("RestorePath aborted : null argument");
-#if OCC_VERSION_LARGE > 0x06050300
BRepOffsetAPI_MiddlePath aMPB (aShape, aBase1, aBase2);
aMPB.Build();
if (aMPB.IsDone()) {
aRes = aMPB.Shape();
}
-#else
- Standard_NullObject::Raise("RestorePath is not implemented in used OCCT version");
-#endif
}
else {
}
if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
Standard_ConstructionError::Raise("Plane creation aborted: points lay on one line");
GC_MakePlane aMakePlane (aP1, aP2, aP3);
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
aShape = BRepBuilderAPI_MakeFace(aMakePlane, -aSize, +aSize, -aSize, +aSize,
Precision::Confusion()).Shape();
-#else
- aShape = BRepBuilderAPI_MakeFace(aMakePlane, -aSize, +aSize, -aSize, +aSize).Shape();
-#endif
} else if (aType == PLANE_FACE) {
Handle(GEOM_Function) aRef = aPI.GetFace();
TopoDS_Shape aRefShape = aRef->GetValue();
#include "GEOMImpl_PolylineDriver.hxx"
#include "GEOMImpl_ICurveParametric.hxx"
+#include "GEOMImpl_ICurvesOperations.hxx"
#include "GEOMImpl_IPolyline.hxx"
+#include "GEOMImpl_IPolyline2D.hxx"
#include "GEOMImpl_Types.hxx"
#include "GEOM_Function.hxx"
+#include <GEOMUtils.hxx>
+#include <Sketcher_Utils.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
+#include <gp_Ax3.hxx>
#include <gp_Pnt.hxx>
//=======================================================================
{
}
+//=======================================================================
+//function : MakePolyline2D
+//purpose :
+//=======================================================================
+Standard_Integer GEOMImpl_PolylineDriver::MakePolyline2D
+ (TFunction_Logbook& log) const
+{
+ if (Label().IsNull()) {
+ return 0;
+ }
+
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+ GEOMImpl_IPolyline2D aCI(aFunction);
+ Standard_Integer aType = aFunction->GetType();
+ TopoDS_Shape aShape;
+
+ // Get data.
+ Handle(TColStd_HArray1OfExtendedString) aNames = aCI.GetNames();
+ Handle(TColStd_HArray1OfByte) aTypes = aCI.GetTypes();
+ Handle(TColStd_HArray1OfByte) aClosedFlags = aCI.GetClosedFlags();
+ std::list <std::list <double> > aCoords;
+ gp_Ax3 aWPlane;
+
+ aCI.GetCoords(aCoords);
+
+ // Check the data validity
+ if (aNames.IsNull()) {
+ return 0;
+ }
+
+ Standard_Integer aNbSections = aNames->Length();
+
+ if (aTypes.IsNull() || aNbSections != aTypes->Length()) {
+ return 0;
+ }
+
+ if (aClosedFlags.IsNull() || aNbSections != aClosedFlags->Length()) {
+ return 0;
+ }
+
+ if (aNbSections != aCoords.size()) {
+ return 0;
+ }
+
+ if (aType == POLYLINE2D_PLN_COORDS) {
+ Handle(TColStd_HArray1OfReal) aPlaneCoords = aCI.GetWorkingPlaneDbls();
+
+ if (aPlaneCoords.IsNull()) {
+ return 0;
+ }
+
+ if (aPlaneCoords->Length() != 9) {
+ return 0;
+ }
+
+ Standard_Integer i = aPlaneCoords->Lower();
+ gp_Pnt aOrigin(aPlaneCoords->Value(i), aPlaneCoords->Value(i + 1),
+ aPlaneCoords->Value(i + 2));
+ gp_Dir aDirZ(aPlaneCoords->Value(i + 3), aPlaneCoords->Value(i + 4),
+ aPlaneCoords->Value(i + 5));
+ gp_Dir aDirX(aPlaneCoords->Value(i + 6), aPlaneCoords->Value(i + 7),
+ aPlaneCoords->Value(i + 8));
+ aWPlane = gp_Ax3(aOrigin, aDirZ, aDirX);
+ } else if (aType == POLYLINE2D_PLN_OBJECT) {
+ Handle(GEOM_Function) aRefFace = aCI.GetWorkingPlane();
+ TopoDS_Shape aShape = aRefFace->GetValue();
+
+ aWPlane = GEOMUtils::GetPosition(aShape);
+ } else {
+ return 0;
+ }
+
+ // Construct a shape.
+ Standard_Integer iN = aNames->Lower();
+ Standard_Integer iT = aTypes->Lower();
+ Standard_Integer iC = aClosedFlags->Lower();
+ std::list <std::list <double> >::const_iterator anIter = aCoords.begin();
+ BRep_Builder aBuilder;
+ Standard_Boolean isEmpty = Standard_True;
+
+ if (aNbSections > 1) {
+ aBuilder.MakeCompound(TopoDS::Compound(aShape));
+ }
+
+ for (; anIter != aCoords.end(); ++anIter, ++iN, ++iT, ++iC) {
+ Standard_Integer aType = aTypes->Value(iT);
+ TopoDS_Shape aSection;
+
+ if (aType == GEOMImpl_ICurvesOperations::Polyline) {
+ aSection = Sketcher_Utils::MakePolyline
+ (*anIter, aClosedFlags->Value(iC), aWPlane);
+ } else if (aType == GEOMImpl_ICurvesOperations::Interpolation) {
+ aSection = Sketcher_Utils::MakeInterpolation
+ (*anIter, aClosedFlags->Value(iC), aWPlane);
+ }
+
+ if (aNbSections > 1) {
+ // There are multiple sections.
+ if (aSection.IsNull() == Standard_False) {
+ aBuilder.Add(aShape, aSection);
+ isEmpty = Standard_False;
+ }
+ } else {
+ // There is only one section.
+ isEmpty = aSection.IsNull();
+ aShape = aSection;
+ }
+ }
+
+ if (isEmpty) {
+ return 0;
+ }
+
+ aFunction->SetValue(aShape);
+ log.SetTouched(Label());
+
+ return 1;
+}
+
//=======================================================================
//function : Execute
//purpose :
{
if (Label().IsNull()) return 0;
Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+ Standard_Integer aType = aFunction->GetType();
+
+ if (aType == POLYLINE2D_PLN_COORDS || aType == POLYLINE2D_PLN_OBJECT) {
+ return MakePolyline2D(log);
+ }
GEOMImpl_IPolyline aCI (aFunction);
- Standard_Integer aType = aFunction->GetType();
TopoDS_Shape aShape;
GEOMImpl_ICurveParametric aIP( function );
Standard_Integer aType = function->GetType();
- theOperationName = "CURVE";
-
switch ( aType ) {
case POLYLINE_POINTS:
+ theOperationName = "CURVE";
AddParam( theParams, "Type", "Polyline");
if ( aIP.HasData() )
{
AddParam( theParams, "Is closed", aCI.GetIsClosed() );
}
break;
+ case POLYLINE2D_PLN_COORDS:
+ case POLYLINE2D_PLN_OBJECT:
+ {
+ theOperationName = "SKETCH";
+
+ GEOMImpl_IPolyline2D aP2d(function);
+ Handle(TColStd_HArray1OfExtendedString) aNames = aP2d.GetNames();
+
+ if (aNames.IsNull() == Standard_False) {
+ if (aNames->Length() == 1) {
+ // This is the single curve. Make its full dump.
+ AddParam(theParams, "Name", aNames->Value(aNames->Lower()));
+
+ Handle(TColStd_HArray1OfByte) aTypes = aP2d.GetTypes();
+
+ if (aTypes.IsNull() == Standard_False && aTypes->Length() == 1) {
+ Standard_Integer aType = aTypes->Value(aTypes->Lower());
+
+ if (aType == GEOMImpl_ICurvesOperations::Polyline) {
+ AddParam(theParams, "Type") << "Polyline";
+ } else if (aType == GEOMImpl_ICurvesOperations::Interpolation) {
+ AddParam(theParams, "Type") << "Interpolation";
+ }
+ }
+
+ Handle(TColStd_HArray1OfByte) aCloseds = aP2d.GetClosedFlags();
+
+ if (aCloseds.IsNull() == Standard_False && aCloseds->Length() == 1) {
+ const char *aYesNo =
+ aCloseds->Value(aCloseds->Lower()) ? "Yes" : "No";
+
+ AddParam(theParams, "Is closed", aYesNo);
+ }
+
+ std::list <std::list <double> > aCoords;
+
+ aP2d.GetCoords(aCoords);
+
+ if (aCoords.size() == 1) {
+ AddParam(theParams, "Number of points", aCoords.front().size()/2);
+ }
+ } else {
+ // There are more than 1 curve.
+ Standard_Integer aNbCurves = aNames->Length();
+ Standard_Integer i;
+ std::list <std::list <double> > aCoords;
+
+ AddParam(theParams, "Number of curves", aNbCurves);
+ aP2d.GetCoords(aCoords);
+
+ Standard_Integer aNbCoords = aCoords.size();
+ std::list <std::list <double> >::const_iterator
+ anIt = aCoords.begin();
+
+ for (i = 0; i < aNbCurves; i++) {
+ TCollection_AsciiString aName("Curve ");
+ TCollection_ExtendedString
+ aValue(aNames->Value(aNames->Lower() + i));
+
+ aName.AssignCat(i + 1);
+
+ if (anIt != aCoords.end()) {
+ aValue.AssignCat(" (");
+ aValue.AssignCat(Standard_Integer(anIt->size()));
+ aValue.AssignCat(" points)");
+ anIt++;
+ }
+
+ AddParam(theParams, aName.ToCString(), aValue);
+ }
+ }
+ }
+
+ if (aType == POLYLINE2D_PLN_COORDS) {
+ Handle(TColStd_HArray1OfReal) aPln = aP2d.GetWorkingPlaneDbls();
+
+ if (aPln.IsNull() == Standard_False && aPln->Length() == 9) {
+ Standard_Integer i = aPln->Lower();
+
+ AddParam( theParams, "Origin")
+ << aPln->Value(i) << " "
+ << aPln->Value(i + 1) << " "
+ << aPln->Value(i + 2);
+ AddParam( theParams, "OZ")
+ << aPln->Value(i + 3) << " "
+ << aPln->Value(i + 4) << " "
+ << aPln->Value(i + 5);
+ AddParam( theParams, "OX")
+ << aPln->Value(i + 6) << " "
+ << aPln->Value(i + 7) << " "
+ << aPln->Value(i + 8);
+ }
+ } else {
+ AddParam(theParams, "Working plane", aP2d.GetWorkingPlane(), "XOY");
+ }
+ }
+ break;
default:
return false;
}
Standard_EXPORT virtual
bool GetCreationInformation(std::string& theOperationName,
std::vector<GEOM_Param>& params);
+private:
+
+ Standard_Integer MakePolyline2D(TFunction_Logbook& log) const;
DEFINE_STANDARD_RTTI( GEOMImpl_PolylineDriver )
};
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : GEOMImpl_PolylineDumper.cxx
+// Author : Sergey KHROMOV
+// Module : GEOM
+
+
+#include "GEOMImpl_PolylineDumper.hxx"
+#include "GEOMImpl_ICurvesOperations.hxx"
+
+#include <GEOM_PythonDump.hxx>
+
+
+//=======================================================================
+// function : Constructor
+// purpose :
+//=======================================================================
+GEOMImpl_PolylineDumper::GEOMImpl_PolylineDumper
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(TColStd_HArray1OfReal) &thePlnCoords)
+ : myCoords (theCoords),
+ myNames (theNames),
+ myTypes (theTypes),
+ myCloseds (theCloseds),
+ myPlnCoords (thePlnCoords),
+ myIsDone (Standard_False)
+{
+ init();
+}
+
+
+//=======================================================================
+// function : Constructor
+// purpose :
+//=======================================================================
+GEOMImpl_PolylineDumper::GEOMImpl_PolylineDumper
+ (const std::list <std::list <double> > &theCoords,
+ const Handle(TColStd_HArray1OfExtendedString) &theNames,
+ const Handle(TColStd_HArray1OfByte) &theTypes,
+ const Handle(TColStd_HArray1OfByte) &theCloseds,
+ const Handle(GEOM_Object) &theWorkingPlane)
+ : myCoords (theCoords),
+ myNames (theNames),
+ myTypes (theTypes),
+ myCloseds (theCloseds),
+ myWorkingPlane (theWorkingPlane),
+ myIsDone (Standard_False)
+{
+ init();
+}
+
+//=======================================================================
+// function : Dump
+// purpose :
+//=======================================================================
+Standard_Boolean GEOMImpl_PolylineDumper::Dump
+ (const Handle(GEOM_Object) &theObject)
+{
+ if (theObject.IsNull()) {
+ return Standard_False;
+ }
+
+ if (myIsDone) {
+ Handle(GEOM_Function) aFunction = theObject->GetLastFunction();
+ GEOM::TPythonDump aPD(aFunction);
+
+ aPD << myDescr;
+ aPD << theObject << " = pl.result(";
+
+ if (myWorkingPlane.IsNull()) {
+ // Add coodinates of working plane.
+ Standard_Integer i;
+
+ aPD << "[";
+ for (i = 0; i < 9; ++i) {
+ aPD << myPlnCoords->Value(myPlnCoords->Lower() + i);
+
+ if (i < 8) {
+ aPD << ", ";
+ }
+ }
+ aPD << "]";
+ } else {
+ aPD << myWorkingPlane;
+ }
+
+ aPD << ")";
+ }
+
+ return myIsDone;
+}
+
+//=======================================================================
+// function : init
+// purpose :
+//=======================================================================
+void GEOMImpl_PolylineDumper::init()
+{
+ // Check input parameters.
+ if (myCoords.empty() || myNames.IsNull() ||
+ myTypes.IsNull() || myCloseds.IsNull()) {
+ // One or more input parameters are null or empty()
+ return;
+ }
+
+ const Standard_Integer aNbSec = myCoords.size();
+
+ if (aNbSec != myNames->Length() || aNbSec != myTypes->Length() ||
+ aNbSec != myCloseds->Length()) {
+ // Inconsistent data.
+ return;
+ }
+
+ // Check the reference plane
+ if (myPlnCoords.IsNull()) {
+ if (myWorkingPlane.IsNull()) {
+ // Null working plane
+ return;
+ }
+ } else {
+ if (myWorkingPlane.IsNull() == Standard_False) {
+ // Ambiguous working plane
+ return;
+ }
+
+ if (myPlnCoords->Length() != 9) {
+ // Invalid number of plane coordinates.
+ return;
+ }
+ }
+
+ char *aSeparator = "\n\t";
+ Standard_Integer i;
+ std::list <std::list <double> >::const_iterator anIt = myCoords.begin();
+
+ myDescr += "pl = geompy.Polyline2D()";
+
+ // Add sections.
+ for (i = 0; i < aNbSec && anIt != myCoords.end(); ++i, ++anIt) {
+ myDescr += aSeparator;
+ myDescr += "pl.addSection(";
+ // Add name
+ myDescr += "\"";
+ myDescr += myNames->Value(myNames->Lower() + i) + "\", ";
+ // Add type
+ const Standard_Integer aType = myTypes->Value(myTypes->Lower() + i);
+
+ switch (aType) {
+ case GEOMImpl_ICurvesOperations::Polyline:
+ myDescr += "GEOM.Polyline, ";
+ break;
+ case GEOMImpl_ICurvesOperations::Interpolation:
+ myDescr += "GEOM.Interpolation, ";
+ break;
+ default:
+ myDescr.Clear();
+ return;
+ break; // NEVERREACHED
+ }
+
+ // Add Closed flag.
+ if (myCloseds->Value(myCloseds->Lower() + i)) {
+ myDescr += "True";
+ } else {
+ myDescr += "False";
+ }
+
+ // Add points.
+ const Standard_Integer aNbCoords = anIt->size();
+
+ if (aNbCoords > 0) {
+ if (aNbCoords % 2) {
+ // Odd number of coordinates.
+ myDescr.Clear();
+ return;
+ }
+
+ if (aNbCoords <= 4) {
+ // Add 2 points to the same command addSection.
+ myDescr += ", [";
+
+ std::list <double>::const_iterator aCIt = anIt->begin();
+
+ while (aCIt != anIt->end()) {
+ myDescr += *aCIt;
+
+ if (++aCIt != anIt->end()) {
+ myDescr += ", ";
+ }
+ }
+ } else {
+ // Add points to a separate command addPoints.
+ // Add maximum 4 points in a command.
+ std::list <double>::const_iterator aCIt = anIt->begin();
+ Standard_Integer aMaxNbCoord = 8;
+ Standard_Integer j = 1;
+
+ myDescr += ")";
+ myDescr += aSeparator;
+ myDescr += "pl.addPoints([";
+
+ while (aCIt != anIt->end()) {
+ myDescr += *aCIt;
+
+ if (++aCIt != anIt->end()) {
+ if (j == aMaxNbCoord) {
+ // 4 points are added. Add a new command.
+ myDescr += "])";
+ myDescr += aSeparator;
+ myDescr += "pl.addPoints([";
+ j = 1;
+ } else {
+ myDescr += ", ";
+ j++;
+ }
+ }
+ }
+ }
+
+ myDescr += "]";
+ }
+
+ myDescr += ")";
+ }
+
+ myDescr += aSeparator;
+ myIsDone = Standard_True;
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : GEOMImpl_PolylineDumper.h
+// Author : Sergey KHROMOV
+
+
+#ifndef _GEOMImpl_PolylineDumper_HXX_
+#define _GEOMImpl_PolylineDumper_HXX_
+
+
+#include "GEOM_GEOMImpl.hxx"
+
+#include <GEOM_Object.hxx>
+
+#include <TColStd_HArray1OfExtendedString.hxx>
+#include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+
+#include <list>
+
+
+/**
+ * This is a helper class to form a dump of a polyline 2d curves creation
+ * algorithm.
+ */
+class GEOMIMPL_EXPORT GEOMImpl_PolylineDumper
+{
+
+public:
+
+ /**
+ * This construcor initializes the object with 2D polyline creation
+ * parameters.
+ *
+ * \param theCoords the list of coordinates list. theCoordsList[0]
+ * is the coordinates list of the first section. theCoordsList[1]
+ * is for the second section etc.
+ * \param theNames the list of names. The order corresponds to theCoords.
+ * \param theTypes the list of curve types. The order corresponds to
+ * theCoords.
+ * \param theCloseds the list of Closed flags. The order corresponds to
+ * theCoords.
+ * \param thePlnCoords 9 double values, defining origin,
+ * OZ and OX directions of the working plane.
+ */
+ GEOMImpl_PolylineDumper
+ (const std::list <std::list <double> > &theCoords,
+ const Handle_TColStd_HArray1OfExtendedString &theNames,
+ const Handle_TColStd_HArray1OfByte &theTypes,
+ const Handle_TColStd_HArray1OfByte &theCloseds,
+ const Handle_TColStd_HArray1OfReal &thePlnCoords);
+
+ /**
+ * This construcor initializes the object with 2D polyline creation
+ * parameters.
+ *
+ * \param theCoords the list of coordinates list. theCoordsList[0]
+ * is the coordinates list of the first section. theCoordsList[1]
+ * is for the second section etc.
+ * \param theNames the list of names. The order corresponds to theCoords.
+ * \param theTypes the list of curve types. The order corresponds to
+ * theCoords.
+ * \param theCloseds the list of Closed flags. The order corresponds to
+ * theCoords.
+ * \param theWorkingPlane planar Face or LCS(Marker) of the working plane.
+ */
+ GEOMImpl_PolylineDumper
+ (const std::list <std::list <double> > &theCoords,
+ const Handle_TColStd_HArray1OfExtendedString &theNames,
+ const Handle_TColStd_HArray1OfByte &theTypes,
+ const Handle_TColStd_HArray1OfByte &theCloseds,
+ const Handle_GEOM_Object &theWorkingPlane);
+
+ /**
+ * This method returns Standard_True if the dump description is created
+ * successfully.
+ *
+ * \return Standard_True in case of success; Standard_False otherwise.
+ */
+ Standard_Boolean IsDone() const
+ { return myIsDone; }
+
+ /**
+ * This method performs dump of the polyline.
+ *
+ * \param theObject the newly created object.
+ * \return Standard_True in case of success; Standard_False otherwise.
+ */
+ Standard_Boolean Dump(const Handle_GEOM_Object &theObject);
+
+protected:
+
+ /**
+ * This method generates the description required for python dump.
+ * It is called from constructor.
+ */
+ void init();
+
+private:
+
+ const std::list <std::list <double> > &myCoords;
+ Handle_TColStd_HArray1OfExtendedString myNames;
+ Handle_TColStd_HArray1OfByte myTypes;
+ Handle_TColStd_HArray1OfByte myCloseds;
+ Handle_TColStd_HArray1OfReal myPlnCoords;
+ Handle_GEOM_Object myWorkingPlane;
+ Standard_Boolean myIsDone;
+ TCollection_ExtendedString myDescr;
+
+};
+
+#endif
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepCheck.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <BRepCheck_Shell.hxx>
#include <Standard_TypeMismatch.hxx>
#include <Standard_ConstructionError.hxx>
+// Uncomment this definition to check if type of created shape is the same
+// as expected. For further details please see the Mantis issue
+// http://salome.mantis.opencascade.com/view.php?id=22674
+//#define RESULT_TYPE_CHECK
+
//modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
//static
// void KeepEdgesOrder(const Handle(TopTools_HSequenceOfShape)& aEdges,
TopoDS_Shape aShape;
TCollection_AsciiString aWarning;
+#ifdef RESULT_TYPE_CHECK
+ TopAbs_ShapeEnum anExpectedType = TopAbs_SHAPE;
+#endif
BRep_Builder B;
if (aType == WIRE_EDGES) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_WIRE;
+#endif
+
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
Standard_Real aTolerance = aCI.GetTolerance();
aShape = MakeWireFromEdges(aShapes, aTolerance);
}
else if (aType == FACE_WIRE) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_FACE;
+#endif
+
Handle(GEOM_Function) aRefBase = aCI.GetBase();
TopoDS_Shape aShapeBase = aRefBase->GetValue();
if (aShapeBase.IsNull()) Standard_NullObject::Raise("Argument Shape is null");
}
}
else if (aType == FACE_WIRES) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_FACE;
+#endif
+
// Try to build a face from a set of wires and edges
int ind;
}
}
else if (aType == SHELL_FACES) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_SHELL;
+#endif
+
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
unsigned int ind, nbshapes = aShapes->Length();
}
else if (aType == SOLID_SHELL) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_SOLID;
+#endif
+
Handle(GEOM_Function) aRefShell = aCI.GetBase();
TopoDS_Shape aShapeShell = aRefShell->GetValue();
if (!aShapeShell.IsNull() && aShapeShell.ShapeType() == TopAbs_COMPOUND) {
}
else if (aType == SOLID_SHELLS) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_SOLID;
+#endif
+
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
unsigned int ind, nbshapes = aShapes->Length();
Standard_Integer ish = 0;
- TopoDS_Solid Sol;
- B.MakeSolid(Sol);
+ BRepBuilderAPI_MakeSolid aMkSolid;
// add shapes
for (ind = 1; ind <= nbshapes; ind++) {
if (It.More()) aShapeShell = It.Value();
}
if (aShapeShell.ShapeType() == TopAbs_SHELL) {
- B.Add(Sol, aShapeShell);
+ aMkSolid.Add(TopoDS::Shell(aShapeShell));
ish++;
}
}
- if (ish == 0) return 0;
+ if (ish == 0 || !aMkSolid.IsDone()) return 0;
+
+ TopoDS_Solid Sol = aMkSolid.Solid();
BRepClass3d_SolidClassifier SC (Sol);
SC.PerformInfinitePoint(Precision::Confusion());
if (SC.State() == TopAbs_IN)
aShape = Sol;
}
else if (aType == COMPOUND_SHAPES) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_COMPOUND;
+#endif
+
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
unsigned int ind, nbshapes = aShapes->Length();
}
*/
else if (aType == EDGE_WIRE) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_EDGE;
+#endif
+
Handle(GEOM_Function) aRefBase = aCI.GetBase();
TopoDS_Shape aWire = aRefBase->GetValue();
Standard_Real LinTol = aCI.GetTolerance();
aShape = MakeEdgeFromWire(aWire, LinTol, AngTol);
}
else if (aType == EDGE_CURVE_LENGTH) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_EDGE;
+#endif
+
GEOMImpl_IVector aVI (aFunction);
// RefCurve
if (aME.IsDone())
aShape = aME.Shape();
} else if (aType == SHAPE_ISOLINE) {
+#ifdef RESULT_TYPE_CHECK
+ anExpectedType = TopAbs_EDGE;
+#endif
+
GEOMImpl_IIsoline aII (aFunction);
Handle(GEOM_Function) aRefFace = aII.GetFace();
TopoDS_Shape aShapeFace = aRefFace->GetValue();
aShape = aSfs->Shape();
}
+#ifdef RESULT_TYPE_CHECK
+ // Check if the result shape type is compatible with the expected.
+ const TopAbs_ShapeEnum aShType = aShape.ShapeType();
+
+ if (anExpectedType != TopAbs_SHAPE && anExpectedType != aShType) {
+ if (aShType == TopAbs_COMPOUND) {
+ // The result is compound. Check its sub-shapes.
+ TopoDS_Iterator anIter(aShape);
+
+ if (!anIter.More()) {
+ // The result is an empty compound.
+ Standard_ConstructionError::Raise("Result type check failed");
+ }
+
+ for (; anIter.More(); anIter.Next()) {
+ const TopAbs_ShapeEnum aSubType = anIter.Value().ShapeType();
+
+ if (anExpectedType != aSubType) {
+ // There is an incompatible type.
+ Standard_ConstructionError::Raise("Result type check failed");
+ }
+ }
+ } else {
+ // There is an incompatible type.
+ Standard_ConstructionError::Raise("Result type check failed");
+ }
+ }
+#endif
+
aFunction->SetValue(aShape);
log.SetTouched(Label());
const double theParameter) const
{
TopoDS_Shape aResult;
- GEOMUtils_Hatcher aHatcher(theFace);
+ GEOMUtils::Hatcher aHatcher(theFace);
const GeomAbs_IsoType aType = (IsUIso ? GeomAbs_IsoU : GeomAbs_IsoV);
aHatcher.Init(aType, theParameter);
#define GEOM_FIELD 52 // == GEOM_FIELD_OBJTYPE constant
#define GEOM_FIELD_STEP 53 // == GEOM_FIELD_STEP_OBJTYPE constant
-#define GEOM_EXPORTXAO 54
-
#define GEOM_ISOLINE 55
+#define GEOM_POLYLINE2D 56
+
//GEOM_Function types
#define COPY_WITH_REF 1
#define COPY_WITHOUT_REF 2
-#define EXPORT_SHAPE 1
#define IMPORT_SHAPE 1
+#define EXPORT_SHAPE 2
#define POINT_XYZ 1
#define POINT_XYZ_REF 2
#define DISK_THREE_PNT 2
#define DISK_R 3
-#define CYLINDER_R_H 1
-#define CYLINDER_PNT_VEC_R_H 2
+#define CYLINDER_R_H 1
+#define CYLINDER_PNT_VEC_R_H 2
+#define CYLINDER_R_H_A 3
+#define CYLINDER_PNT_VEC_R_H_A 4
#define CONE_R1_R2_H 1
#define CONE_PNT_VEC_R1_R2_H 2
#define PARTITION_HALF 2
#define PARTITION_NO_SELF_INTERSECTIONS 3
-#define POLYLINE_POINTS 1
+#define POLYLINE_POINTS 1
+#define POLYLINE2D_PLN_COORDS 2
+#define POLYLINE2D_PLN_OBJECT 3
#define SPLINE_BEZIER 1
#define SPLINE_INTERPOLATION 2
#define MARKER_SHAPE 2
#define MARKER_PNT2VEC 3
-// import/export XAO
-#define IMPORTEXPORT_EXPORTXAO 1
-#define IMPORTEXPORT_IMPORTXAO 2
+// Advanced functions
+#define USER_TYPE 200 // Base type for GEOM advanced shapes
+#define USER_TYPE_EX 1000 // Base type for GEOM plugins
+
-// Advanced functions (base = 200)
-#define ADVANCED_BASE 200 // NO OPERATION (advanced operations base)
+//Plugins specified constants
+#define PLUGIN_NAME "Plugin Name"
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <Standard_Stream.hxx>
-
-#include <GEOMImpl_XAODriver.hxx>
-#include <GEOMImpl_IImportExportXAO.hxx>
-#include <GEOMImpl_Types.hxx>
-#include <GEOM_Function.hxx>
-
-#include <TFunction_Logbook.hxx>
-#include <StdFail_NotDone.hxx>
-
-#include "XAO_Xao.hxx"
-#include "XAO_Geometry.hxx"
-#include "XAO_Group.hxx"
-#include "XAO_XaoUtils.hxx"
-//@@ include required header files here @@//
-
-//=======================================================================
-//function : GetID
-//purpose :
-//=======================================================================
-const Standard_GUID& GEOMImpl_XAODriver::GetID()
-{
- static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16");
- return aGUID;
-}
-
-//=======================================================================
-//function : GEOMImpl_XAODriver
-//purpose :
-//=======================================================================
-GEOMImpl_XAODriver::GEOMImpl_XAODriver()
-{
-}
-
-//=======================================================================
-//function : Execute
-//purpose :
-//=======================================================================
-Standard_Integer GEOMImpl_XAODriver::Execute(TFunction_Logbook& log) const
-{
- if (Label().IsNull()) return 0;
- Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
-
- GEOMImpl_IImportExportXAO iexao(function);
- TCollection_AsciiString xao = iexao.GetData();
-
- TopoDS_Shape shape;
-
- Standard_Integer functionType = function->GetType();
- if (functionType == IMPORTEXPORT_EXPORTXAO)
- {
- }
- else if (functionType == IMPORTEXPORT_IMPORTXAO)
- {
- }
- else
- {
- // other construction modes here
- }
-
- if (shape.IsNull()) return 0;
-
- function->SetValue(shape);
-
- log.SetTouched(Label());
-
- return 1;
-}
-
-//=======================================================================
-//function : GEOMImpl_XAODriver_Type_
-//purpose :
-//=======================================================================
-Standard_EXPORT Handle_Standard_Type& GEOMImpl_XAODriver_Type_()
-{
- static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
- if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
- if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
- static Handle_Standard_Transient _Ancestors[] = { aType1, aType2, aType3, NULL };
- static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_XAODriver",
- sizeof(GEOMImpl_XAODriver),
- 1,
- (Standard_Address) _Ancestors,
- (Standard_Address) NULL);
- return _aType;
-}
-
-//=======================================================================
-//function : DownCast
-//purpose :
-//=======================================================================
-const Handle(GEOMImpl_XAODriver) Handle(GEOMImpl_XAODriver)::DownCast(
- const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOMImpl_XAODriver) _anOtherObject;
-
- if (!AnObject.IsNull())
- {
- if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_XAODriver)))
- {
- _anOtherObject = Handle(GEOMImpl_XAODriver)((Handle(GEOMImpl_XAODriver)&) AnObject);
- }
- }
-
- return _anOtherObject;
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _GEOMImpl_XAODriver_HXX
-#define _GEOMImpl_XAODriver_HXX
-
-#include <TFunction_Driver.hxx>
-
-class Handle_Standard_Type;
-class GEOMImpl_XAODriver;
-
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_XAODriver);
-
-class Handle(GEOMImpl_XAODriver): public Handle(TFunction_Driver)
-{
-public:
- inline void* operator new(size_t, void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&) anAddress);
- }
-
- Handle(GEOMImpl_XAODriver) () :
- Handle(TFunction_Driver)()
- {
- }
- Handle(GEOMImpl_XAODriver) (const Handle(GEOMImpl_XAODriver)& aHandle) :
- Handle(TFunction_Driver)(aHandle)
- {
- }
-
- Handle(GEOMImpl_XAODriver) (const GEOMImpl_XAODriver* anItem) :
- Handle(TFunction_Driver)((TFunction_Driver *) anItem)
- {
- }
-
- Handle(GEOMImpl_XAODriver)& operator=(const Handle(GEOMImpl_XAODriver)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOMImpl_XAODriver)& operator=(const GEOMImpl_XAODriver* anItem)
- {
- Assign((Standard_Transient *) anItem);
- return *this;
- }
-
- GEOMImpl_XAODriver* operator->()
- {
- return (GEOMImpl_XAODriver *) ControlAccess();
- }
-
- GEOMImpl_XAODriver* operator->() const
- {
- return (GEOMImpl_XAODriver *) ControlAccess();
- }
-
- Standard_EXPORT
- ~Handle(GEOMImpl_XAODriver)()
- {
- }
-
- Standard_EXPORT
- static const Handle(GEOMImpl_XAODriver) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-
-class GEOMImpl_XAODriver: public TFunction_Driver
-{
-public:
- inline void* operator new(size_t, void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&) anAddress);
- }
-
- // Methods PUBLIC
- //
- Standard_EXPORT
- GEOMImpl_XAODriver();
- Standard_EXPORT
- virtual Standard_Integer Execute(TFunction_Logbook& log) const;
- Standard_EXPORT
- virtual void Validate(TFunction_Logbook&) const
- {
- }
- Standard_EXPORT
- Standard_Boolean MustExecute(const TFunction_Logbook&) const
- {
- return Standard_True;
- }
- Standard_EXPORT
- static const Standard_GUID& GetID();
- Standard_EXPORT
- ~GEOMImpl_XAODriver()
- {
- }
-
- // Type management
- //
- Standard_EXPORT
- friend Handle_Standard_Type& GEOMImpl_ExportXAODriver_Type_();
- Standard_EXPORT
- const Handle(Standard_Type)& DynamicType() const
- {
- return STANDARD_TYPE(GEOMImpl_XAODriver);
- }
- Standard_EXPORT
- Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
- {
- return (STANDARD_TYPE(GEOMImpl_XAODriver) == AType || TFunction_Driver::IsKind(AType));
- }
-};
-
-#endif // _GEOMImpl_XAODriver_HXX
FF1BBB70-5D14-4df2-980B-3A668264EA16 // Projection
-FF1BBB71-5D14-4df2-980B-3A668264EA16 // Export XAO
-
1C3A0F3F-729D-4E83-8232-78E74FC5637C // Pipe T-Shape
1C3A0F30-729D-4E83-8232-78E74FC5637C // Smoothing Surface
${PROJECT_SOURCE_DIR}/src/GEOMGUI
${PROJECT_SOURCE_DIR}/src/GEOMBase
${PROJECT_SOURCE_DIR}/src/Material
+ ${PROJECT_SOURCE_DIR}/src/DependencyTree
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
${CMAKE_CURRENT_SOURCE_DIR}
)
GEOM
GEOMBase
Material
+ DependencyTree
)
# --- headers ---
GEOMToolsGUI_PublishDlg.h
GEOMToolsGUI_MaterialPropertiesDlg.h
GEOMToolsGUI_LineWidthDlg.h
+ GEOMToolsGUI_ReduceStudyDlg.h
)
# header files / to be processed by moc
GEOMToolsGUI_PublishDlg.h
GEOMToolsGUI_MaterialPropertiesDlg.h
GEOMToolsGUI_LineWidthDlg.h
+ GEOMToolsGUI_ReduceStudyDlg.h
)
# --- sources ---
GEOMToolsGUI_PublishDlg.cxx
GEOMToolsGUI_MaterialPropertiesDlg.cxx
GEOMToolsGUI_LineWidthDlg.cxx
+ GEOMToolsGUI_ReduceStudyDlg.cxx
${_moc_SOURCES}
)
#include <GEOMImpl_Types.hxx>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_Prs.h>
// QT Includes
typedef QMap<QString, QString> FilterMap;
static QString lastUsedFilter;
-//=======================================================================
-// function : getFileName
-// purpose : Selection of a file name for Import/Export. Returns also
-// the selected file type code through <filter> argument.
-//=======================================================================
-static QString getFileName( QWidget* parent,
- const QString& initial,
- const FilterMap& filterMap,
- const QStringList& filters,
- const QString& caption,
- bool open,
- QString& format,
- bool showCurrentDirInitially = false )
-{
- //QStringList filters;
- QString aBrepFilter;
- for (FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it) {
- //filters.push_back( it.key() );
- if (it.key().contains( "BREP", Qt::CaseInsensitive ))
- aBrepFilter = it.key();
- }
-
- SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
- if ( !caption.isEmpty() )
- fd->setWindowTitle( caption );
-
- if ( !initial.isEmpty() )
- fd->selectFile( initial );
-
- if ( showCurrentDirInitially && SUIT_FileDlg::getLastVisitedPath().isEmpty() )
- fd->setDirectory( QDir::currentPath() );
-
- fd->setFilters( filters );
-
- if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) ) {
- fd->selectFilter( lastUsedFilter );
- }
- else if ( !aBrepFilter.isEmpty() ) {
- fd->selectFilter( aBrepFilter );
- }
-
- QString filename;
- if ( fd->exec() == QDialog::Accepted ) {
- filename = fd->selectedFile();
- format = filterMap[fd->selectedFilter()];
- lastUsedFilter = fd->selectedFilter();
- }
-
- delete fd;
- qApp->processEvents();
- return filename;
-}
-
-//=======================================================================
-// function : getFileNames
-// purpose : Select list of files for Import operation. Returns also
-// the selected file type code through <format> argument.
-//=======================================================================
-static QStringList getFileNames( QWidget* parent,
- const QString& initial,
- const FilterMap& filterMap,
- const QString& caption,
- QString& format,
- bool showCurrentDirInitially = false)
-{
- QString aBrepFilter;
- QStringList allFilters;
- QStringList filters;
- QRegExp re( "\\((.*)\\)" );
- re.setMinimal( true );
- for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
- if ( it.value().contains( "BREP", Qt::CaseInsensitive ) && aBrepFilter.isEmpty() )
- aBrepFilter = it.key();
- filters.append( it.key() );
- int pos = 0;
- while ( re.indexIn( it.key(), pos ) >= 0 ) {
- QString f = re.cap(1);
- pos = re.pos() + f.length() + 2;
- allFilters.append( f.simplified() );
- }
- }
- filters.append( QObject::tr( "GEOM_ALL_IMPORT_FILES" ).arg( allFilters.join( " " ) ) );
-
- SUIT_FileDlg fd( parent, true, true, true );
- fd.setFileMode( SUIT_FileDlg::ExistingFiles );
- if ( !caption.isEmpty() )
- fd.setWindowTitle( caption );
- if ( !initial.isEmpty() )
- fd.selectFile( initial );
-
- if ( showCurrentDirInitially && SUIT_FileDlg::getLastVisitedPath().isEmpty() )
- fd.setDirectory( QDir::currentPath() );
-
- fd.setFilters( filters );
-
- if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
- fd.selectFilter( lastUsedFilter );
- else if ( !aBrepFilter.isEmpty() )
- fd.selectFilter( aBrepFilter );
-
- QStringList filenames;
- if ( fd.exec() ) {
- filenames = fd.selectedFiles();
- format = filterMap.contains( fd.selectedFilter() ) ? filterMap[ fd.selectedFilter() ] : QString();
- lastUsedFilter = fd.selectedFilter();
- }
- qApp->processEvents();
- return filenames;
-}
-
//=======================================================================
// function : getParentComponent
// purpose : Get object's parent component entry
case GEOMOp::OpDelete: // EDIT - DELETE
OnEditDelete();
break;
- case GEOMOp::OpImport: // FILE - IMPORT
- Import();
- break;
- case GEOMOp::OpExport: // FILE - EXPORT
- Export();
- break;
case GEOMOp::OpCheckGeom: // TOOLS - CHECK GEOMETRY
OnCheckGeometry();
break;
break;
case GEOMOp::OpSortChildren:
OnSortChildren();
+ break;
+ case GEOMOp::OpShowDependencyTree:
+ OnShowDependencyTree();
break;
+ case GEOMOp::OpReduceStudy:
+ OnReduceStudy();
+ break;
default:
SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
break;
app->updateActions(); //SRN: To update a Save button in the toolbar
}
-//=====================================================================================
-// function : Import
-// purpose : BRep, Iges, Step, ...
-//=====================================================================================
-bool GEOMToolsGUI::Import()
-{
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( getGeometryGUI()->getApp() );
- if ( !app ) return false;
-
- SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !stud ) {
- MESSAGE ( "FAILED to cast active study to SalomeApp_Study" );
- return false;
- }
- _PTR(Study) aStudy = stud->studyDS();
-
- // check if study is locked
- bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
- if ( aLocked ) {
- SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
- return false;
- }
-
- // check if GEOM engine is available
- GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
- if ( CORBA::is_nil( eng ) ) {
- SUIT_MessageBox::critical( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr( "GEOM Engine is not started" ) );
- return false;
- }
-
- GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
- if ( aInsOp->_is_nil() )
- return false;
-
- // obtain a list of available import formats
- FilterMap aMap;
- GEOM::string_array_var aFormats, aPatterns;
- aInsOp->ImportTranslators( aFormats, aPatterns );
-
- for ( int i = 0, n = aFormats->length(); i < n; i++ )
- aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
-
- // select files to be imported
- QString fileType;
- QStringList fileNames = getFileNames( app->desktop(), "", aMap,
- tr( "GEOM_MEN_IMPORT" ), fileType, true );
-
- // set Wait cursor
- SUIT_OverrideCursor wc;
-
- if ( fileNames.count() == 0 )
- return false; // nothing selected, return
-
- QStringList errors;
-
- QList< GEOM::GEOM_Object_var > objsForDisplay;
-
- QStringList anEntryList;
-
- // iterate through all selected files
-
- SUIT_MessageBox::StandardButton igesAnswer = SUIT_MessageBox::NoButton;
- SUIT_MessageBox::StandardButton acisAnswer = SUIT_MessageBox::NoButton;
-
- for ( int i = 0; i < fileNames.count(); i++ ) {
- QString fileName = fileNames[i];
-
- if ( fileName.isEmpty() )
- continue;
-
- QString aCurrentType;
- if ( fileType.isEmpty() ) {
- // file type is not defined, try to detect
- QString ext = QFileInfo( fileName ).suffix().toUpper();
- QRegExp re( "\\*\\.(\\w+)" );
- for ( FilterMap::const_iterator it = aMap.begin();
- it != aMap.end() && aCurrentType.isEmpty(); ++it ) {
- int pos = 0;
- while ( re.indexIn( it.key(), pos ) >= 0 ) {
- QString f = re.cap(1).trimmed().toUpper();
- if ( ext == f ) { aCurrentType = it.value(); break; }
- pos = re.pos() + re.cap(1).length() + 2;
- }
- }
- }
- else {
- aCurrentType = fileType;
- }
-
- if ( aCurrentType.isEmpty() ) {
- errors.append( QString( "%1 : %2" ).arg( fileName ).arg( tr( "GEOM_UNSUPPORTED_TYPE" ) ) );
- continue;
- }
-
- GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
- try {
- app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( SUIT_Tools::file( fileName, /*withExten=*/true ) ) );
- anOp->start();
-
- CORBA::String_var fileN = fileName.toUtf8().constData();
- CORBA::String_var fileT = aCurrentType.toUtf8().constData();
-
- // jfa 21.08.2012 for mantis issue 21511 (STEP file units)
- CORBA::String_var aUnits = aInsOp->ReadValue(fileN, fileT, "LEN_UNITS");
- QString aUnitsStr (aUnits.in());
- bool needConvert = true;
- if (aUnitsStr.isEmpty() || aUnitsStr == "M" || aUnitsStr.toLower() == "metre")
- needConvert = false;
-
- if (needConvert) {
- if (igesAnswer == SUIT_MessageBox::NoToAll) {
- // converting for all files is already approved
- fileT = (aCurrentType + "_SCALE").toLatin1().constData();
- }
- else if (igesAnswer != SUIT_MessageBox::YesToAll) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if (i < fileNames.count() - 1) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- igesAnswer = SUIT_MessageBox::question(app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_SCALE_DIMENSIONS").arg(aUnitsStr),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No);
- switch (igesAnswer) {
- case SUIT_MessageBox::Cancel:
- return false; // cancel (break) import operation
- case SUIT_MessageBox::Yes:
- case SUIT_MessageBox::YesToAll:
- break; // scaling is confirmed
- case SUIT_MessageBox::No:
- case SUIT_MessageBox::NoAll:
- fileT = (aCurrentType + "_SCALE").toLatin1().constData();
- default:
- break; // scaling is rejected
- } // switch ( igesAnswer )
- } // if ( igeAnswer != NoToAll )
- } // if ( needConvert )
-
- /*
- // skl 29.05.2009
- if ( aCurrentType == "IGES" ) {
- GEOM::GEOM_Object_var anObj = aInsOp->ImportFile( fileN, "IGES_UNIT" );
- bool needConvert = false;
- TCollection_AsciiString aUnitName = aInsOp->GetErrorCode();
- if ( aUnitName.SubString( 1, 4 ) == "UNIT" )
- needConvert = aUnitName.SubString( 6, aUnitName.Length() ) != "M";
-
- if ( needConvert ) {
- if ( igesAnswer == SUIT_MessageBox::NoToAll ) {
- // converting for all files is already approved
- fileT = "IGES_SCALE";
- }
- else if ( igesAnswer != SUIT_MessageBox::YesToAll ) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- igesAnswer = SUIT_MessageBox::question( app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_SCALE_DIMENSIONS"),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No );
- switch ( igesAnswer ) {
- case SUIT_MessageBox::Cancel:
- return false; // cancel (break) import operation
- case SUIT_MessageBox::Yes:
- case SUIT_MessageBox::YesToAll:
- break; // scaling is confirmed
- case SUIT_MessageBox::No:
- case SUIT_MessageBox::NoAll:
- fileT = "IGES_SCALE";
- default:
- break; // scaling is rejected
- } // switch ( igesAnswer )
- } // if ( igeAnswer != NoToAll )
- } // if ( needConvert )
- } // if ( aCurrentType == "IGES" )
- else if ( aCurrentType == "ACIS" ) {
- */
-
- if ( aCurrentType == "ACIS" ) {
- if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- acisAnswer = SUIT_MessageBox::question( app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_PUBLISH_NAMED_SHAPES"),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No );
- if ( acisAnswer == SUIT_MessageBox::Cancel )
- return false; // cancel (break) import operation
- } // if ( acisAnswer != YesToAll && acisAnswer != NoToAll )
- } // else if ( aCurrentType == "ACIS" )
-
- // IMPORT
- GEOM::ListOfGO_var anObj = aInsOp->ImportFile( fileN, fileT );
-
- if ( anObj->length() > 0 && aInsOp->IsDone() ) {
- GEOM::GEOM_Object_ptr aFather = anObj[0]._retn();
- QString aPublishObjName =
- GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, /*withExten=*/true ) );
-
- SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy );
- SALOMEDS::SObject_var aSO =
- GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
- SALOMEDS::SObject::_nil(),
- aFather,
- aPublishObjName.toLatin1().constData() );
- if ( ( !aSO->_is_nil() ) )
- anEntryList.append( aSO->GetID() );
-
- objsForDisplay.append( aFather );
-
- if ( aCurrentType == "ACIS" ) {
- if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
- GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( aDSStudy, aFather );
- }
-
- anOp->commit();
-
- // Treat group objects.
- for (int i = 1, n = anObj->length(); i < n; i++) {
- GEOM::GEOM_Object_ptr anObject = anObj[i]._retn();
- GeometryGUI::GetGeomGen()->AddInStudy(aDSStudy,
- anObject, tr(anObject->GetName()).toStdString().c_str(), aFather);
- }
- }
- else {
- anOp->abort();
- errors.append( QString( "%1 : %2" ).arg( fileName ).arg( aInsOp->GetErrorCode() ) );
- }
- }
- catch( const SALOME::SALOME_Exception& S_ex ) {
- anOp->abort();
- errors.append( QString( "%1 : %2" ).arg( fileName ).arg( tr( "GEOM_UNKNOWN_IMPORT_ERROR" ) ) );
- }
- }
-
- // update object browser
- getGeometryGUI()->updateObjBrowser( true );
-
- // browse published objects
- app->browseObjects( anEntryList );
-
- // display imported model (if only one file is selected)
- if ( objsForDisplay.count() == 1 )
- GEOM_Displayer( stud ).Display( objsForDisplay[0].in() );
-
- if ( errors.count() > 0 ) {
- SUIT_MessageBox::critical( app->desktop(),
- QObject::tr( "GEOM_ERROR" ),
- QObject::tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
- }
-
- app->updateActions(); //SRN: To update a Save button in the toolbar
-
- return objsForDisplay.count() > 0;
-}
-
-//=====================================================================================
-// function : Export
-// purpose : BRep, Iges, Step
-//=====================================================================================
-bool GEOMToolsGUI::Export()
-{
- SalomeApp_Application* app = getGeometryGUI()->getApp();
- if (!app) return false;
-
- SalomeApp_Study* stud = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !stud ) {
- MESSAGE ( "FAILED to cast active study to SalomeApp_Study" );
- return false;
- }
- _PTR(Study) aStudy = stud->studyDS();
-
- GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
- if ( CORBA::is_nil( eng ) ) {
- SUIT_MessageBox::critical( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr( "GEOM Engine is not started" ) );
- return false;
- }
-
- GEOM::GEOM_IInsertOperations_var aInsOp = eng->GetIInsertOperations( aStudy->StudyId() );
- if ( aInsOp->_is_nil() )
- return false;
-
- // Obtain a list of available export formats
- FilterMap aMap;
- QStringList filters;
- GEOM::string_array_var aFormats, aPatterns;
- aInsOp->ExportTranslators( aFormats, aPatterns );
- for ( int i = 0, n = aFormats->length(); i < n; i++ ) {
- aMap.insert( (char*)aPatterns[i], (char*)aFormats[i] );
- filters.push_back( (char*)aPatterns[i] );
- }
-
- // Get selected objects
- LightApp_SelectionMgr* sm = app->selectionMgr();
- if ( !sm )
- return false;
-
- SALOME_ListIO selectedObjects;
- sm->selectedObjects( selectedObjects );
- bool appropriateObj = false;
-
- SALOME_ListIteratorOfListIO It( selectedObjects );
- for (; It.More(); It.Next()) {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( IObject );
-
- if ( anObj->_is_nil() )
- continue;
-
- QString fileType;
- QString file = getFileName(app->desktop(), QString( IObject->getName() ), aMap, filters,
- tr("GEOM_MEN_EXPORT"), false, fileType, true);
-
- // User has pressed "Cancel" --> stop the operation
- if ( file.isEmpty() || fileType.isEmpty() )
- return false;
-
- GEOM_Operation* anOp = new GEOM_Operation( app, aInsOp.in() );
- try {
- SUIT_OverrideCursor wc;
-
- app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( file, /*withExten=*/true )) );
-
- anOp->start();
-
- aInsOp->Export( anObj, file.toUtf8().constData(), fileType.toUtf8().constData() );
-
- if (aInsOp->IsDone())
- anOp->commit();
- else {
- anOp->abort();
- wc.suspend();
- SUIT_MessageBox::critical(app->desktop(),
- QObject::tr("GEOM_ERROR"),
- QObject::tr("GEOM_PRP_ABORT") + "\n" + QObject::tr(aInsOp->GetErrorCode()));
- return false;
- }
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- //QtCatchCorbaException(S_ex);
- anOp->abort();
- return false;
- }
- appropriateObj = true;
- }
-
- if ( !appropriateObj )
- SUIT_MessageBox::warning( app->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") );
- return true;
-}
-
//=====================================================================================
// function : RemoveObjectWithChildren
// purpose : used by OnEditDelete() method
if (!CORBA::is_nil(geomObj)) {
//Remove visual properties of the object
- appStudy->removeObjectFromAll(obj->GetID().c_str());
+ appStudy->removeObjectProperties(obj->GetID().c_str());
// Erase graphical object
QListIterator<SALOME_View*> it( views );
enum ActionType { SHOWDLG, INCR, DECR };
private:
- // Import and export topology methods
- bool Import();
- bool Export();
void OnEditDelete();
void OnCheckGeometry();
void OnClsBringToFront();
void OnCreateFolder();
void OnSortChildren();
+ void OnShowDependencyTree();
+ void OnReduceStudy();
// Shortcut commands
void OnChangeTransparency( bool );
#include "GEOMToolsGUI_PublishDlg.h"
#include "GEOMToolsGUI_MaterialPropertiesDlg.h"
#include "GEOMToolsGUI_LineWidthDlg.h"
+#include "GEOMToolsGUI_ReduceStudyDlg.h"
#include <Material_Model.h>
#include <GEOM_VTKPropertyMaterial.hxx>
#include <GEOMBase.h>
#include <GEOM_Actor.h>
+#include <DependencyTree_ViewModel.h>
+#include <DependencyTree_View.h>
+#include <DependencyTree_Selector.h>
+
#include <Basics_OCCTVersion.hxx>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOMEDS_SObject.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_ListOfInteractive.hxx>
-
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
-#else
-#include <Graphic3d_HArray1OfBytes.hxx>
-#endif
// QT Includes
#include <QAction>
_PTR(AttributeDrawable) aDrw = B->FindOrCreateAttribute( obj, "AttributeDrawable" );
aDrw->SetDrawable( false );
disp->EraseWithChildren(IObject);
+ // hide references if any
+ std::vector< _PTR(SObject) > vso = aStudy->FindDependances(obj);
+ for ( int i = 0; i < vso.size(); i++ ) {
+ _PTR(SObject) refObj = vso[i];
+ aDrw = B->FindOrCreateAttribute( refObj, "AttributeDrawable" );
+ aDrw->SetDrawable( false );
+ }
} // if ( obj )
} // iterator
aSelMgr->clearSelected();
app->updateObjectBrowser( true );
}
+
+void GEOMToolsGUI::OnShowDependencyTree()
+{
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( !app ) return;
+
+ SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false );
+
+ if( !svm ) {
+ DependencyTree_View* view = new DependencyTree_View();
+ DependencyTree_ViewModel* viewModel = new DependencyTree_ViewModel( GraphicsView_Viewer::Type(), view );
+ SUIT_ViewManager *svm = app->createViewManager( viewModel );
+
+ LightApp_SelectionMgr* selMgr = app->selectionMgr();
+ new DependencyTree_Selector( viewModel, (SUIT_SelectionMgr*)selMgr );
+
+ SUIT_ViewWindow* svw = svm->getActiveView();
+ GraphicsView_ViewFrame* aViewFrame = 0;
+ if (!svw) svw = svm->createViewWindow();
+ if (svw) aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>(svw);
+
+ view->init( aViewFrame );
+ svm->setTitle( view->getViewName() );
+ }
+ else
+ if( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
+ if( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
+ svm->getActiveView()->setFocus();
+ view->updateModel();
+ }
+}
+
+void GEOMToolsGUI::OnReduceStudy()
+{
+ QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( SUIT_Session::session()->activeApplication()->desktop() );
+ if( dlg != NULL )
+ dlg->show();
+}
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <QButtonGroup>
#include <QGridLayout>
if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
int tWidth, tHeight;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
-#else
- Handle(Graphic3d_HArray1OfBytes) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
-#endif
if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
QImage image( tWidth, tHeight, QImage::Format_Mono );
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_ViewManager.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <OCCViewer_ViewModel.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
SUIT_ViewWindow* window = app->desktop()->activeWindow();
if ( window ) {
int mgrId = window->getViewManager()->getGlobalId();
- PropMap propMap = study->getObjectPropMap( mgrId, io->getEntry() );
+ PropMap propMap = study->getObjectProperties( mgrId, io->getEntry() );
QString matProp = propMap.value(GEOM::propertyName( GEOM::Material )).toString();
if ( !matProp.isEmpty() )
myCurrentModel.fromProperties( matProp );
item->setData(0,Qt::CheckStateRole,QVariant());
}
}
+ // show references if any
+ std::vector< _PTR(SObject) > vso = aStudy->FindDependances(SO);
+ for ( int i = 0; i < vso.size(); i++ ) {
+ _PTR(SObject) refObj = vso[i];
+ aDrw = aBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" );
+ aDrw->SetDrawable( true );
+ }
}
}
toProcess.clear();
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "GEOMToolsGUI_ReduceStudyDlg.h"
+
+// GEOM includes
+#include <GEOMBase.h>
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
+
+#include <LightApp_SelectionMgr.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// Qt includes
+#include <QGridLayout>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QHeaderView>
+#include <QMessageBox>
+
+GEOMToolsGUI_ReduceStudyDlg::GEOMToolsGUI_ReduceStudyDlg( QWidget* parent )
+:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+myDisplayer(NULL)
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
+ myInvisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+
+ 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 );
+
+ setWindowTitle( tr( "GEOM_REDUCE_STUDY_TITLE" ) );
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ QGridLayout* topLayout = new QGridLayout( this );
+ topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
+
+ /********************** Objects to be kept **********************/
+ QGroupBox* groupKeptObjects = new QGroupBox( tr( "GEOM_REDUCE_STUDY_KEPT_OBJECTS" ) );
+ QGridLayout* layoutKeptObjects = new QGridLayout( groupKeptObjects );
+ createTreeWidget( myTreeKeptObjects = new QTreeWidget() );
+ layoutKeptObjects->addWidget( myTreeKeptObjects );
+
+ /********************** Objects to be removed **********************/
+ QGroupBox* groupRemoveObjects = new QGroupBox( tr( "GEOM_REDUCE_STUDY_REMOVE_OBJECTS" ) );
+ QGridLayout* layoutRemoveObjects = new QGridLayout( groupRemoveObjects );
+ createTreeWidget( myTreeRemoveObjects = new QTreeWidget() );
+ layoutRemoveObjects->addWidget( myTreeRemoveObjects );
+
+ /********************** Options **********************/
+ QGroupBox* groupOptions = new QGroupBox( tr( "GEOM_REDUCE_STUDY_OPTIONS" ) );
+ QVBoxLayout* layoutOptions = new QVBoxLayout( groupOptions );
+
+ // Intermediate objects
+ QGroupBox* groupIntermediates = createButtonGroup( myGroupIntermediates = new QButtonGroup() );
+ groupIntermediates->setTitle( tr( "GEOM_REDUCE_STUDY_INTERMEDIATES" ) );
+
+ // Sub-objects
+ QGroupBox* groupSubObjects = createButtonGroup( myGroupSubObjects = new QButtonGroup() );
+ groupSubObjects->setTitle( tr( "GEOM_REDUCE_STUDY_SUB_OBJECTS" ) );
+
+ // Others
+ myCBRemoveEmptyFolder = new QCheckBox( tr( "GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER" ) );
+ myCBRemoveEmptyFolder->setChecked( true );
+ myCBSoftRemoval = new QCheckBox( tr( "GEOM_REDUCE_STUDY_SOFT_REMOVAL" ) );
+
+ layoutOptions->addWidget( groupIntermediates );
+ layoutOptions->addWidget( groupSubObjects );
+ layoutOptions->addWidget( myCBRemoveEmptyFolder );
+ layoutOptions->addWidget( myCBSoftRemoval );
+
+ /********************** Buttons **********************/
+ QGroupBox* groupButtons = new QGroupBox();
+ QHBoxLayout* layoutButtons = new QHBoxLayout( groupButtons );
+
+ QPushButton* buttonOk = new QPushButton( tr( "GEOM_BUT_OK" ) );
+ QPushButton* buttonCancel = new QPushButton( tr( "GEOM_BUT_CANCEL" ) );
+ QPushButton* buttonHelp = new QPushButton( tr( "GEOM_BUT_HELP" ) );
+
+ layoutButtons->addWidget( buttonOk );
+ layoutButtons->addStretch();
+ layoutButtons->addWidget( buttonCancel );
+ layoutButtons->addWidget( buttonHelp );
+
+ topLayout->addWidget( groupKeptObjects, 0, 0 );
+ topLayout->addWidget( groupRemoveObjects, 0, 1 );
+ topLayout->addWidget( groupOptions, 1, 0, 1, 2 );
+ topLayout->addWidget( groupButtons, 2, 0, 1, 2 );
+
+ // Signals and slots connections
+
+ connect( myTreeKeptObjects, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
+ connect( myTreeRemoveObjects, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
+ connect( myTreeKeptObjects->header(), SIGNAL( sectionClicked ( int ) ), this, SLOT( onHeaderClicked( int ) ) );
+ connect( myTreeRemoveObjects->header(), SIGNAL( sectionClicked ( int ) ), this, SLOT( onHeaderClicked( int ) ) );
+
+ connect( myGroupIntermediates, SIGNAL( buttonClicked( int ) ), this, SLOT( update() ) );
+ connect( myGroupSubObjects, SIGNAL( buttonClicked( int ) ), this, SLOT( update() ) );
+
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
+
+ connect( myApp->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+ this, SLOT( selectionChanged() ) );
+
+ init( getSelectedObjects() );
+}
+
+GEOMToolsGUI_ReduceStudyDlg::~GEOMToolsGUI_ReduceStudyDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : init()
+// purpose : initialize dialog data
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::init( const std::set<std::string>& theObjectEntries )
+{
+ myMainEntries.clear();
+
+ myKeptObjects.clear();
+ myListParents.clear();
+ myListSubObjects.clear();
+ myRemovedObjects.clear();
+
+ myMainEntries = theObjectEntries;
+
+ GEOM::string_array_var keptObjects = new GEOM::string_array();
+ int It = 0;
+ keptObjects->length( theObjectEntries.size() );
+ std::set<std::string>::iterator iter;
+ for( iter=theObjectEntries.begin(); iter!=theObjectEntries.end(); ++iter, It++ )
+ keptObjects[ It ] = (*iter).c_str();
+
+ GEOM::string_array_var parentsObjects = new GEOM::string_array();
+ 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 );
+
+ for ( int i = 0; i < keptObjects->length(); i++ )
+ myKeptObjects.insert( keptObjects[i].in() );
+ for( int i = 0; i< otherObjects->length(); i++ )
+ myRemovedObjects.insert( otherObjects[i].in() );
+ for( int i = 0; i< parentsObjects->length(); i++ )
+ myListParents.insert( parentsObjects[i].in() );
+ for( int i = 0; i< subObjects->length(); i++ )
+ myListSubObjects.insert( subObjects[i].in() );
+
+ update();
+
+ checkVisibleIcon( myTreeKeptObjects );
+ checkVisibleIcon( myTreeRemoveObjects );
+}
+
+//=================================================================================
+// function : getSelectedObjects()
+// purpose : get selected objects in object browser
+//=================================================================================
+std::set<std::string> GEOMToolsGUI_ReduceStudyDlg::getSelectedObjects() const
+{
+ std::set<std::string> objects;
+
+ SALOME_ListIO selected;
+ myApp->selectionMgr()->selectedObjects( selected );
+
+ for( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
+ Handle( SALOME_InteractiveObject ) io = It.Value();
+ if( !io->hasEntry() )
+ continue;
+ GEOM::GEOM_Object_var geomObject = GEOM::GEOM_Object::_nil();
+ geomObject = GEOMBase::ConvertIOinGEOMObject( io );
+ if( geomObject->_is_nil() )
+ continue;
+ QString entry = geomObject->GetEntry();
+ objects.insert( entry.toStdString().c_str() );
+ }
+ return objects;
+}
+
+//=================================================================================
+// function : createTreeWidget()
+// purpose : create tree widget for unpublished or removed objects
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::createTreeWidget( QTreeWidget* theTreeWidget )
+{
+ theTreeWidget->setColumnCount( 2 );
+ QStringList columnNames;
+ columnNames.append(tr( "GEOM_REDUCE_STUDY_NAME" ));
+ columnNames.append("");
+ theTreeWidget->setHeaderLabels( columnNames );
+ QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
+ theTreeWidget->setHeaderItem ( headerItem );
+ theTreeWidget->header()->moveSection( 1, 0 );
+ theTreeWidget->header()->setClickable( true );
+ theTreeWidget->header()->setMovable( false );
+ theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+ theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
+}
+
+//=================================================================================
+// function : createButtonGroup()
+// purpose : create button group for intermediate objects or sub-objects
+//=================================================================================
+QGroupBox* GEOMToolsGUI_ReduceStudyDlg::createButtonGroup( QButtonGroup* theButtonGroup )
+{
+ QGroupBox* groupObjects = new QGroupBox();
+ QHBoxLayout* layoutObjects = new QHBoxLayout( groupObjects );
+
+ QRadioButton* buttonKeep = new QRadioButton( tr( "GEOM_REDUCE_STUDY_KEEP") );
+ theButtonGroup->addButton( buttonKeep, 0 );
+ QRadioButton* buttonUnpublish = new QRadioButton( tr( "GEOM_REDUCE_STUDY_UNPUBLISH") );
+ theButtonGroup->addButton( buttonUnpublish, 1 );
+ QRadioButton* buttonRemove = new QRadioButton( tr( "GEOM_REDUCE_STUDY_REMOVE") );
+ theButtonGroup->addButton( buttonRemove, 2 );
+
+ theButtonGroup->button( 0 )->setChecked( true );
+ theButtonGroup->setExclusive( true );
+
+ layoutObjects->addWidget( buttonKeep );
+ layoutObjects->addWidget( buttonUnpublish );
+ layoutObjects->addWidget( buttonRemove );
+
+ return groupObjects;
+}
+
+//=================================================================================
+// function : addObjectsToTree()
+// purpose : add the list of objects to tree
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::addObjectsToTree( QTreeWidget* theWidget, std::set<std::string>& theObjects )
+{
+ 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_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
+ QString studyEntry = GeomBaseObject->GetStudyEntry();
+ if( GeomObject->_is_nil() || studyEntry.isEmpty() || !isObjectDrawable( studyEntry.toStdString() ) )
+ continue;
+ addSubObject( theWidget, theObjects, GeomObject );
+ }
+}
+
+//=================================================================================
+// function : addSubObject()
+// purpose : add sub-object to parent object in the tree
+//=================================================================================
+GEOMToolsGUI_TreeWidgetItem* GEOMToolsGUI_ReduceStudyDlg::addSubObject( QTreeWidget* theWidget,
+ std::set<std::string>& theObjects,
+ GEOM::GEOM_Object_var theObject )
+{
+ GEOMToolsGUI_TreeWidgetItem* item;
+ if( !theObject->IsMainShape() ) {
+ GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, theObject->GetMainShape() );
+ item = findObjectInTree( theWidget, theObject );
+ if( !item )
+ item = new GEOMToolsGUI_TreeWidgetItem( parentItem, QStringList() << theObject->GetName(), theObject->GetStudyEntry() );
+ }
+ else {
+ item = findObjectInTree( theWidget, theObject );
+ if( !item )
+ item = new GEOMToolsGUI_TreeWidgetItem( theWidget, QStringList() << theObject->GetName(), theObject->GetStudyEntry() );
+ }
+
+ bool isDisplayed = false;
+ if( theObjects.find( theObject->GetEntry() ) != theObjects.end() ) {
+ isDisplayed = myDisplayer.IsDisplayed( theObject->GetStudyEntry() );
+ if ( isDisplayed )
+ item->setVisible( true, myVisible );
+ else
+ item->setVisible( false, myInvisible );
+
+ if( myMainEntries.find( theObject->GetEntry() ) != myMainEntries.end() ) {
+ QFont Textfont = item->font(0);
+ Textfont.setBold( true );
+ item->setFont( 0, Textfont );
+ }
+ }
+ else {
+ item->setFlags( item->flags() & ~Qt::ItemIsSelectable );
+ item->setTextColor( 0, QColor( 150, 150, 150 ) );
+ }
+ return item;
+}
+
+//=================================================================================
+// function : findObjectInTree()
+// purpose : find object in the tree
+//=================================================================================
+GEOMToolsGUI_TreeWidgetItem* GEOMToolsGUI_ReduceStudyDlg::findObjectInTree( QTreeWidget* theWidget, GEOM::GEOM_Object_var theObject )
+{
+ QTreeWidgetItemIterator it( theWidget );
+ while(*it) {
+ GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>(*it);
+ if( QString( item->getStudyEntry() ) == QString( theObject->GetStudyEntry() ) )
+ return item;
+ ++it;
+ }
+ return NULL;
+}
+
+//=================================================================================
+// function : checkVisibleIcon()
+// purpose : set visible or invisible icon in the header of tree
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::checkVisibleIcon( QTreeWidget* theWidget )
+{
+ bool isInvisible = false;
+ QTreeWidgetItemIterator it( theWidget );
+ while(*it) {
+ GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>(*it);
+ const char* entry = item->getStudyEntry();
+ if( item->flags() & Qt::ItemIsSelectable )
+ if( !item->isVisible() )
+ isInvisible = true;
+ ++it;
+ }
+
+ if( isInvisible ) {
+ theWidget->headerItem()->setIcon( 1, myInvisible );
+ myMapTreeSelectAll[ theWidget ] = false;
+ }
+ else {
+ theWidget->headerItem()->setIcon( 1, myVisible );
+ myMapTreeSelectAll[ theWidget ] = true;
+ }
+}
+
+//=================================================================================
+// function : isObjectDrawable()
+// purpose : return true if object is drawable, and false if object is hidden in the study
+//=================================================================================
+bool GEOMToolsGUI_ReduceStudyDlg::isObjectDrawable( std::string theStudyEntry )
+{
+ _PTR(StudyBuilder) aStudyBuilder = myStudy->NewBuilder();
+ //If object hasn't "AttributeDrawable" => it visible
+ bool isDrawable = true;
+ _PTR(SObject) SO ( myStudy->FindObjectID( theStudyEntry ) );
+ _PTR(GenericAttribute) anAttr;
+ if ( SO && SO->FindAttribute( anAttr, "AttributeDrawable" ) ) {
+ _PTR(AttributeDrawable) aDrw (anAttr);
+ isDrawable = aDrw->IsDrawable();
+ }
+ return isDrawable;
+}
+
+//=================================================================================
+// function : unpublishObjects()
+// purpose : unpublish(hide) objects in the study
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::unpublishObjects( std::set<std::string>& theObjects )
+{
+ _PTR(StudyBuilder) aStudyBuilder = myStudy->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() );
+ std::string studyEntry = GeomBaseObject->GetStudyEntry();
+ if ( studyEntry == "" || !isObjectDrawable( studyEntry ) )
+ continue;
+ _PTR(SObject) obj ( myStudy->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);
+ for ( int i = 0; i < vso.size(); i++ ) {
+ _PTR(SObject) refObj = vso[i];
+ aDrw = aStudyBuilder->FindOrCreateAttribute( refObj, "AttributeDrawable" );
+ aDrw->SetDrawable( false );
+ }
+ }
+ }
+ myApp->updateObjectBrowser( false );
+ myApp->updateActions();
+}
+
+//=================================================================================
+// function : removeObjects()
+// purpose : remove objects from the study
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::removeObjects( std::set<std::string>& theObjects )
+{
+ 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() );
+ std::string studyEntry = GeomBaseObject->GetStudyEntry();
+ if ( studyEntry == "" )
+ GeometryGUI::GetGeomGen()->RemoveObject( GeomBaseObject );
+ else {
+ if( !isObjectDrawable( studyEntry ) )
+ continue;
+ removeObject( studyEntry );
+ }
+ }
+ myApp->updateObjectBrowser( false );
+ myApp->updateActions();
+}
+
+//=================================================================================
+// function : removeObject()
+// purpose : remove object with given study entry
+//=================================================================================
+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(SObject) obj ( myStudy->FindObjectID( theStudyEntry.c_str() ) );
+ if ( obj ) {
+ // remove visual properties of the object
+ appStudy->removeObjectProperties(obj->GetID().c_str());
+ // remove references to this object
+ appStudy->deleteReferencesTo( obj );
+ // remove objects from study
+ aStudyBuilder->RemoveObjectWithChildren( obj );
+ // remove object from use case tree
+ aUseCaseBuilder->Remove( obj );
+ myDisplayer.EraseWithChildren( new SALOME_InteractiveObject( theStudyEntry.c_str(), "GEOM", "TEMP_IO" ) );
+ }
+}
+
+//=================================================================================
+// function : removeEmptyFolders()
+// purpose : remove empty folders from the study
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::removeEmptyFolders()
+{
+ std::set<std::string> emptyFolders;
+
+ _PTR(SComponent) SC ( myStudy->FindComponent( "GEOM" ) );
+ if ( !SC )
+ return;
+ _PTR(ChildIterator) anIter ( myStudy->NewChildIterator( SC ) );
+ anIter->InitEx( true );
+ while( anIter->More() ) {
+ _PTR(SObject) valSO ( anIter->Value() );
+ _PTR(SObject) refSO;
+ if ( !valSO->ReferencedObject( refSO ) )
+ getEmptyFolders( valSO, emptyFolders );
+ anIter->Next();
+ }
+
+ std::set<std::string>::iterator iter;
+ for( iter = emptyFolders.begin(); iter != emptyFolders.end(); ++iter ) {
+ std::string studyEntry = *iter;
+ removeObject( studyEntry );
+ }
+ myApp->updateObjectBrowser( false );
+ myApp->updateActions();
+}
+
+//=================================================================================
+// function : removeEmptyFolders()
+// purpose : remove empty folders from the study
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::getEmptyFolders( _PTR(SObject) theSO, std::set<std::string>& theFolders )
+{
+ _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder();
+
+ bool isFolder = false;
+ _PTR(GenericAttribute) anAttr;
+ if ( theSO->FindAttribute(anAttr, "AttributeLocalID") ) {
+ _PTR(AttributeLocalID) aLocalID( anAttr );
+ isFolder = aLocalID->Value() == 999;
+ }
+ QString studyEntry = theSO->GetID().c_str();
+ if ( isFolder ) {
+ if( !aUseCaseBuilder->HasChildren( theSO ) )
+ theFolders.insert( studyEntry.toStdString() );
+ else {
+ _PTR(UseCaseIterator) ucit ( aUseCaseBuilder->GetUseCaseIterator( theSO ) );
+ for ( ucit->Init( false ); ucit->More(); ucit->Next() )
+ getEmptyFolders( ucit->Value(), theFolders );
+ }
+ }
+}
+
+//=================================================================================
+// function : onItemClicked()
+// purpose : called when tree item was clicked
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
+{
+ if( theColumn != 1 || !( theItem->flags() & Qt::ItemIsSelectable ) )
+ return;
+
+ GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>( theItem );
+
+ const char* entry = item->getStudyEntry();
+ Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( entry, "GEOM", "TEMP_IO" );
+ if( myDisplayer.IsDisplayed( entry ) ) {
+ item->setVisible( false, myInvisible );
+ myDisplayer.Erase( io );
+ }
+ else {
+ item->setVisible( true, myVisible );
+ myDisplayer.Display( io );
+ }
+ myDisplayer.UpdateViewer();
+ checkVisibleIcon( item->treeWidget() );
+}
+
+//=================================================================================
+// function : onHeaderClicked()
+// purpose : called when header item of tree was clicked
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::onHeaderClicked( int theColumn )
+{
+ if( theColumn != 1 )
+ return;
+
+ QTreeWidget* treeWidget = dynamic_cast<QTreeWidget*>(sender()->parent());
+ if( myMapTreeSelectAll[ treeWidget ] ) {
+ myMapTreeSelectAll[ treeWidget ] = false;
+ treeWidget->headerItem()->setIcon( 1, myInvisible );
+ QTreeWidgetItemIterator it( treeWidget );
+ while(*it) {
+ GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>(*it);
+ if( ( item->flags() & Qt::ItemIsSelectable ) && item->isVisible() ) {
+ const char* entry = item->getStudyEntry();
+ item->setVisible( false, myInvisible );
+ myDisplayer.Erase( new SALOME_InteractiveObject( entry, "GEOM", "TEMP_IO" ) );
+ }
+ ++it;
+ }
+ }
+ else {
+ myMapTreeSelectAll[ treeWidget ] = true;
+ treeWidget->headerItem()->setIcon( 1, myVisible );
+ QTreeWidgetItemIterator it( treeWidget );
+ while(*it) {
+ GEOMToolsGUI_TreeWidgetItem* item = dynamic_cast<GEOMToolsGUI_TreeWidgetItem*>(*it);
+ if( ( item->flags() & Qt::ItemIsSelectable ) && !item->isVisible() ) {
+ const char* entry = item->getStudyEntry();
+ item->setVisible( true, myVisible );
+ myDisplayer.Display( new SALOME_InteractiveObject( entry, "GEOM", "TEMP_IO" ) );
+ }
+ ++it;
+ }
+ }
+ myDisplayer.UpdateViewer();
+}
+
+//=================================================================================
+// function : selectionChanged()
+// purpose : called when selection of object browser was changed
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::selectionChanged()
+{
+ init( getSelectedObjects() );
+}
+
+//=================================================================================
+// function : update()
+// purpose : update tree data
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::update()
+{
+ myTreeKeptObjects->clear();
+ myTreeRemoveObjects->clear();
+
+ std::set<std::string> keptObjects( myKeptObjects );
+ std::set<std::string> removeObjects( myRemovedObjects );
+
+ // Intermediate objects
+ if( myGroupIntermediates->checkedId() == 2 ) { // remove
+ std::set<std::string>::iterator iter;
+ for( iter=myListParents.begin(); iter!=myListParents.end(); ++iter)
+ removeObjects.insert( *iter );
+ }
+ else { // keep or unpublish
+ std::set<std::string>::iterator iter;
+ for( iter=myListParents.begin(); iter!=myListParents.end(); ++iter)
+ keptObjects.insert( *iter );
+ }
+
+ // Sub-objects
+ if( myGroupSubObjects->checkedId() == 2 ) {
+ std::set<std::string>::iterator iter;
+ for( iter=myListSubObjects.begin(); iter!=myListSubObjects.end(); ++iter)
+ removeObjects.insert( *iter );
+ }
+ else {
+ std::set<std::string>::iterator iter;
+ for( iter=myListSubObjects.begin(); iter!=myListSubObjects.end(); ++iter)
+ keptObjects.insert( *iter );
+ }
+
+ addObjectsToTree( myTreeKeptObjects, keptObjects );
+ addObjectsToTree( myTreeRemoveObjects, removeObjects );
+
+ myTreeKeptObjects->collapseAll();
+ myTreeRemoveObjects->collapseAll();
+
+}
+
+//=================================================================================
+// function : clickOnOk()
+// purpose : called when OK button was clicked
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::clickOnOk()
+{
+ std::set<std::string> objectsToBeRemoved = myRemovedObjects;
+ std::set<std::string> objectsToBeUnpublished;
+
+ // Create lists of intermediate objects to be removed or to be unpublished
+ std::set<std::string>::iterator iter;
+ if( myGroupIntermediates->checkedId() == 1 ) { // unpublish
+ for( iter = myListParents.begin(); iter != myListParents.end(); ++iter )
+ objectsToBeUnpublished.insert( *iter );
+ }
+ if( myGroupIntermediates->checkedId() == 2 ) { // remove
+ if( !myCBSoftRemoval->isChecked() &&
+ SUIT_MessageBox::question( this,
+ tr( "GEOM_WRN_WARNING" ),
+ tr( "GEOM_REDUCE_STUDY_WARNING_DELETE" ),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::Yes ) == QMessageBox::No ) {
+ return;
+ }
+ for( iter = myListParents.begin(); iter != myListParents.end(); ++iter )
+ objectsToBeRemoved.insert( *iter );
+ }
+
+ // Create lists of sub-objects to be removed or to be unpublished
+ if( myGroupSubObjects->checkedId() == 1 ) { // unpublish
+ for( iter = myListSubObjects.begin(); iter != myListSubObjects.end(); ++iter )
+ objectsToBeUnpublished.insert( *iter );
+ }
+ else if( myGroupSubObjects->checkedId() == 2 ) { // remove
+ for( iter = myListSubObjects.begin(); iter != myListSubObjects.end(); ++iter )
+ objectsToBeRemoved.insert( *iter );
+ }
+
+ // if user chosen the soft removal
+ if( myCBSoftRemoval->isChecked() ) {
+ for( iter = objectsToBeRemoved.begin(); iter != objectsToBeRemoved.end(); ++iter )
+ objectsToBeUnpublished.insert( *iter );
+ unpublishObjects( objectsToBeUnpublished );
+ }
+ else {
+ unpublishObjects( objectsToBeUnpublished );
+ removeObjects( objectsToBeRemoved );
+ }
+
+ // if user want to delete the empty folders
+ if( myCBRemoveEmptyFolder->isChecked() )
+ removeEmptyFolders();
+
+ accept();
+}
+
+//=================================================================================
+// function : clickOnHelp()
+// purpose : called when Help button was clicked to open a help page
+//=================================================================================
+void GEOMToolsGUI_ReduceStudyDlg::clickOnHelp()
+{
+ myApp->onHelpContextModule( "GEOM", "reduce_study_page.html" );
+}
+
+GEOMToolsGUI_TreeWidgetItem::GEOMToolsGUI_TreeWidgetItem( QTreeWidget* view, const QStringList &strings,
+ char* studyEntry, int type )
+:QTreeWidgetItem( view, strings, type ),
+ myStudyEntry( studyEntry ),
+ myVisible( false )
+{
+}
+
+GEOMToolsGUI_TreeWidgetItem::GEOMToolsGUI_TreeWidgetItem( QTreeWidgetItem* parent, const QStringList &strings,
+ char* studyEntry, int type )
+:QTreeWidgetItem( parent, strings, type ),
+ myStudyEntry( studyEntry ),
+ myVisible( false )
+{
+}
+
+GEOMToolsGUI_TreeWidgetItem::~GEOMToolsGUI_TreeWidgetItem()
+{
+}
+
+bool GEOMToolsGUI_TreeWidgetItem::isVisible()
+{
+ return myVisible;
+}
+
+void GEOMToolsGUI_TreeWidgetItem::setVisible( bool theIsVisible, QIcon& theIcon )
+{
+ myVisible = theIsVisible;
+ setIcon( 1, theIcon );
+}
+
+char* GEOMToolsGUI_TreeWidgetItem::getStudyEntry() const
+{
+ return myStudyEntry;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef GEOMTOOLSGUI_REDUCESTUDYDLG_H
+#define GEOMTOOLSGUI_REDUCESTUDYDLG_H
+
+// internal includes
+#include "GEOM_ToolsGUI.hxx"
+
+// GEOM includes
+#include <GEOMUtils.hxx>
+#include <GeometryGUI.h>
+#include <GEOM_Displayer.h>
+
+// Qt includes
+#include <QDialog>
+#include <QTreeWidget>
+#include <QCheckBox>
+#include <QButtonGroup>
+#include <QGroupBox>
+
+// Cpp includes
+#include <set>
+
+class GEOMToolsGUI_TreeWidgetItem : public QTreeWidgetItem
+{
+
+public:
+ GEOMToolsGUI_TreeWidgetItem( QTreeWidget*, const QStringList&, char*, int = Type );
+ GEOMToolsGUI_TreeWidgetItem( QTreeWidgetItem*, const QStringList&, char*, int = Type );
+ ~GEOMToolsGUI_TreeWidgetItem();
+
+ bool isVisible();
+ void setVisible( bool, QIcon& );
+
+ char* getStudyEntry() const;
+
+private:
+ bool myVisible;
+ char* myStudyEntry;
+
+};
+
+class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_ReduceStudyDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ GEOMToolsGUI_ReduceStudyDlg( QWidget* );
+ ~GEOMToolsGUI_ReduceStudyDlg();
+
+private slots:
+ void onItemClicked(QTreeWidgetItem*, int );
+ void onHeaderClicked( int );
+
+ void selectionChanged();
+
+ void update();
+
+ void clickOnOk();
+ void clickOnHelp();
+
+private:
+ void init( const std::set<std::string>& theObjectEntries );
+ std::set<std::string> getSelectedObjects() const;
+
+ void createTreeWidget( QTreeWidget* );
+ QGroupBox* createButtonGroup( QButtonGroup* );
+
+ void addObjectsToTree( QTreeWidget*, std::set<std::string>& );
+ GEOMToolsGUI_TreeWidgetItem* addSubObject( QTreeWidget*, std::set<std::string>&, GEOM::GEOM_Object_var );
+ GEOMToolsGUI_TreeWidgetItem* findObjectInTree( QTreeWidget*, GEOM::GEOM_Object_var );
+
+ void checkVisibleIcon( QTreeWidget* );
+ bool isObjectDrawable( std::string );
+
+ void unpublishObjects( std::set<std::string>& );
+
+ void removeObjects( std::set<std::string>& );
+ void removeObject( std::string& );
+
+ void removeEmptyFolders();
+ void getEmptyFolders( _PTR(SObject), std::set<std::string>& );
+
+ QTreeWidget* myTreeKeptObjects;
+ QTreeWidget* myTreeRemoveObjects;
+ std::map<QTreeWidget*,bool> myMapTreeSelectAll;
+
+ QButtonGroup* myGroupIntermediates;
+ QButtonGroup* myGroupSubObjects;
+
+ QCheckBox* myCBRemoveEmptyFolder;
+ QCheckBox* myCBSoftRemoval;
+
+ std::set<std::string> myMainEntries;
+
+ std::set<std::string> myKeptObjects;
+ std::set<std::string> myRemovedObjects;
+ std::set<std::string> myListParents;
+ std::set<std::string> myListSubObjects;
+
+ QIcon myVisible;
+ QIcon myInvisible;
+
+ GEOM_Displayer myDisplayer;
+ SalomeApp_Application* myApp;
+ _PTR(Study) myStudy;
+
+};
+
+#endif
#include <GEOM_Constants.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
+ ${LIBXML2_INCLUDE_DIR}
${KERNEL_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${CAS_DEFINITIONS}
+ ${LIBXML2_DEFINITIONS}
)
# libraries to link to
${CAS_TKG3d}
${CAS_TKV3d}
${CAS_TKGeomBase}
+ ${LIBXML2_LIBRARIES}
${KERNEL_SALOMELocalTrace}
)
SET(GEOMUtils_HEADERS
GEOMUtils.hxx
GEOMUtils_Hatcher.hxx
+ GEOMUtils_XmlHandler.hxx
)
# --- sources ---
SET(GEOMUtils_SOURCES
GEOMUtils.cxx
GEOMUtils_Hatcher.cxx
+ GEOMUtils_XmlHandler.cxx
)
# --- rules ---
#include <ElSLib.hxx>
#include <vector>
+#include <sstream>
#include <Standard_Failure.hxx>
#include <Standard_NullObject.hxx>
#define STD_SORT_ALGO 1
+namespace
+{
+ /**
+ * This function constructs and returns modified shape from the original one
+ * for singular cases. It is used for the method GetMinDistanceSingular.
+ *
+ * \param theShape the original shape
+ * \param theModifiedShape output parameter. The modified shape.
+ * \param theAddDist output parameter. The added distance for modified shape.
+ * \retval true if the shape is modified; false otherwise.
+ *
+ * \internal
+ */
+ Standard_Boolean ModifyShape(const TopoDS_Shape &theShape,
+ TopoDS_Shape &theModifiedShape,
+ Standard_Real &theAddDist)
+ {
+ Standard_Boolean isModified = Standard_False;
+ TopExp_Explorer anExp;
+ int nbf = 0;
+
+ theAddDist = 0.;
+ theModifiedShape.Nullify();
+
+ for ( anExp.Init( theShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
+ nbf++;
+ theModifiedShape = anExp.Current();
+ }
+ if(nbf==1) {
+ TopoDS_Shape sh = theShape;
+ while(sh.ShapeType()==TopAbs_COMPOUND) {
+ TopoDS_Iterator it(sh);
+ sh = it.Value();
+ }
+ Handle(Geom_Surface) S = BRep_Tool::Surface(TopoDS::Face(theModifiedShape));
+ if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
+ S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ||
+ S->IsUPeriodic()) {
+ const Standard_Boolean isShell =
+ (sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE);
+
+ if( isShell || S->IsUPeriodic() ) {
+ // non solid case or any periodic surface (Mantis 22454).
+ double U1,U2,V1,V2;
+ // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
+ //S->Bounds(U1,U2,V1,V2); changed by
+ ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
+ // end of changes for 020677 (dmv)
+ Handle(Geom_RectangularTrimmedSurface) TrS1 =
+ new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
+ Handle(Geom_RectangularTrimmedSurface) TrS2 =
+ new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
+ BRep_Builder B;
+ TopoDS_Face F1,F2;
+ TopoDS_Shape aMShape;
+
+ if (isShell) {
+ B.MakeCompound(TopoDS::Compound(aMShape));
+ } else {
+ B.MakeShell(TopoDS::Shell(aMShape));
+ }
+
+ B.MakeFace(F1,TrS1,1.e-7);
+ B.Add(aMShape,F1);
+ B.MakeFace(F2,TrS2,1.e-7);
+ B.Add(aMShape,F2);
+ Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+
+ if (!isShell) {
+ // The original shape is a solid.
+ TopoDS_Solid aSolid;
+
+ B.MakeSolid(aSolid);
+ B.Add(aSolid, aMShape);
+ aMShape = aSolid;
+ }
+
+ sfs->Init(aMShape);
+ sfs->SetPrecision(1.e-6);
+ sfs->SetMaxTolerance(1.0);
+ sfs->Perform();
+ theModifiedShape = sfs->Shape();
+ isModified = Standard_True;
+ }
+ else {
+ if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
+ Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
+ gp_Pnt PC = SS->Location();
+ BRep_Builder B;
+ TopoDS_Vertex V;
+ B.MakeVertex(V,PC,1.e-7);
+ theModifiedShape = V;
+ theAddDist = SS->Radius();
+ isModified = Standard_True;
+ }
+ else {
+ Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
+ gp_Ax3 ax3 = TS->Position();
+ Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
+ BRep_Builder B;
+ TopoDS_Edge E;
+ B.MakeEdge(E,C,1.e-7);
+ theModifiedShape = E;
+ theAddDist = TS->MinorRadius();
+ isModified = Standard_True;
+ }
+ }
+ } else {
+ theModifiedShape = theShape;
+ }
+ }
+ else
+ theModifiedShape = theShape;
+
+ return isModified;
+ }
+
+ //=======================================================================
+ //function : ShapeToDouble
+ //purpose : used by CompareShapes::operator()
+ //=======================================================================
+ std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
+ {
+ // Computing of CentreOfMass
+ gp_Pnt GPoint;
+ double Len;
+
+ if (S.ShapeType() == TopAbs_VERTEX) {
+ GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
+ Len = (double)S.Orientation();
+ }
+ else {
+ GProp_GProps GPr;
+ // BEGIN: fix for Mantis issue 0020842
+ if (isOldSorting) {
+ BRepGProp::LinearProperties(S, GPr);
+ }
+ else {
+ if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
+ BRepGProp::LinearProperties(S, GPr);
+ }
+ else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
+ BRepGProp::SurfaceProperties(S, GPr);
+ }
+ else {
+ BRepGProp::VolumeProperties(S, GPr);
+ }
+ }
+ // END: fix for Mantis issue 0020842
+ GPoint = GPr.CentreOfMass();
+ Len = GPr.Mass();
+ }
+
+ double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
+ return std::make_pair(dMidXYZ, Len);
+ }
+
+ void parseWard( const GEOMUtils::LevelsList &theLevelList, std::string &treeStr )
+ {
+ treeStr.append( "{" );
+ for( GEOMUtils::LevelsList::const_iterator j = theLevelList.begin();
+ j != theLevelList.end(); ++j ) {
+ if ( j != theLevelList.begin() ) {
+ treeStr.append( ";" );
+ }
+ GEOMUtils::LevelInfo level = (*j);
+ GEOMUtils::LevelInfo::iterator upIter;
+ for ( upIter = level.begin(); upIter != level.end(); ++upIter ) {
+ if ( upIter != level.begin() ) {
+ treeStr.append( "," );
+ }
+ treeStr.append( upIter->first );
+ for ( std::vector<std::string>::iterator k = upIter->second.begin(); k != upIter->second.end(); ++k ) {
+ treeStr.append( "_" );
+ treeStr.append( *k );
+ }
+ }
+ }
+ treeStr.append( "}" );
+ }
+
+ GEOMUtils::LevelsList parseWard( const std::string& theData, std::size_t& theCursor )
+ {
+ std::size_t indexStart = theData.find( "{", theCursor ) + 1;
+ std::size_t indexEnd = theData.find( "}", indexStart );
+
+ std::string ward = theData.substr( indexStart, indexEnd - indexStart );
+ std::stringstream ss(ward);
+ std::string substr;
+ std::vector<std::string> levelsListStr;
+ while ( std::getline( ss, substr, ';' ) ) {
+ if ( !substr.empty() )
+ levelsListStr.push_back( substr );
+ }
+ GEOMUtils::LevelsList levelsListData;
+ for( int level = 0; level < levelsListStr.size(); level++ ) {
+ std::vector<std::string> namesListStr;
+ std::stringstream ss1( levelsListStr[level] );
+ while ( std::getline( ss1, substr, ',' ) ) {
+ if ( !substr.empty() )
+ namesListStr.push_back( substr );
+ }
+ GEOMUtils::LevelInfo levelInfoData;
+ for( int node = 0; node < namesListStr.size(); node++ ) {
+ std::vector<std::string> linksListStr;
+ std::stringstream ss2( namesListStr[node] );
+ while ( std::getline( ss2, substr, '_' ) ) {
+ if ( !substr.empty() )
+ linksListStr.push_back( substr );
+ }
+ std::string nodeItem = linksListStr[0];
+ if( !nodeItem.empty() ) {
+ GEOMUtils::NodeLinks linksListData;
+ for( int link = 1; link < linksListStr.size(); link++ ) {
+ std::string linkItem = linksListStr[link];
+ linksListData.push_back( linkItem );
+ }// Links
+ levelInfoData[nodeItem] = linksListData;
+ }
+ }// Level's objects
+ levelsListData.push_back(levelInfoData);
+ }// Levels
+
+ theCursor = indexEnd + 1;
+ return levelsListData;
+ }
+
+}
+
//=======================================================================
//function : GetPosition
//purpose :
return aV;
}
-//=======================================================================
-//function : ShapeToDouble
-//purpose : used by CompareShapes::operator()
-//=======================================================================
-std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
-{
- // Computing of CentreOfMass
- gp_Pnt GPoint;
- double Len;
-
- if (S.ShapeType() == TopAbs_VERTEX) {
- GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
- Len = (double)S.Orientation();
- }
- else {
- GProp_GProps GPr;
- // BEGIN: fix for Mantis issue 0020842
- if (isOldSorting) {
- BRepGProp::LinearProperties(S, GPr);
- }
- else {
- if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
- BRepGProp::LinearProperties(S, GPr);
- }
- else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
- BRepGProp::SurfaceProperties(S, GPr);
- }
- else {
- BRepGProp::VolumeProperties(S, GPr);
- }
- }
- // END: fix for Mantis issue 0020842
- GPoint = GPr.CentreOfMass();
- Len = GPr.Mass();
- }
-
- double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
- return std::make_pair(dMidXYZ, Len);
-}
-
//=======================================================================
//function : CompareShapes::operator()
//purpose : used by std::sort(), called from SortShapes()
Standard_Boolean GEOMUtils::PreciseBoundingBox
(const TopoDS_Shape &theShape, Bnd_Box &theBox)
{
- Standard_Real aBound[6];
+ if ( theBox.IsVoid() ) BRepBndLib::Add( theShape, theBox );
+ Standard_Real aBound[6];
theBox.Get(aBound[0], aBound[2], aBound[4], aBound[1], aBound[3], aBound[5]);
Standard_Integer i;
const Standard_Integer iHalf = i/2;
const gp_Pln aPln(aPnt[i], aDir[iHalf]);
BRepBuilderAPI_MakeFace aMkFace(aPln, -aPlnSize[iHalf], aPlnSize[iHalf],
- -aPlnSize[iHalf], aPlnSize[iHalf]);
+ -aPlnSize[iHalf], aPlnSize[iHalf]);
if (!aMkFace.IsDone()) {
return Standard_False;
TopoDS_Shape tmpSh2;
Standard_Real AddDist1 = 0.;
Standard_Real AddDist2 = 0.;
- Standard_Boolean IsChange1 = GEOMUtils::ModifyShape(aSh1, tmpSh1, AddDist1);
- Standard_Boolean IsChange2 = GEOMUtils::ModifyShape(aSh2, tmpSh2, AddDist2);
+ Standard_Boolean IsChange1 = ModifyShape(aSh1, tmpSh1, AddDist1);
+ Standard_Boolean IsChange2 = ModifyShape(aSh2, tmpSh2, AddDist2);
if( !IsChange1 && !IsChange2 )
return -2.0;
}
//=======================================================================
-// function : ModifyShape
-// purpose :
+// function : ConvertTreeToString()
+// purpose : Returns the string representation of dependency tree
//=======================================================================
-Standard_Boolean GEOMUtils::ModifyShape(const TopoDS_Shape &theShape,
- TopoDS_Shape &theModifiedShape,
- Standard_Real &theAddDist)
+void GEOMUtils::ConvertTreeToString( const TreeModel &tree,
+ std::string &treeStr )
{
- Standard_Boolean isModified = Standard_False;
- TopExp_Explorer anExp;
- int nbf = 0;
-
- theAddDist = 0.;
- theModifiedShape.Nullify();
-
- for ( anExp.Init( theShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
- nbf++;
- theModifiedShape = anExp.Current();
- }
- if(nbf==1) {
- TopoDS_Shape sh = theShape;
- while(sh.ShapeType()==TopAbs_COMPOUND) {
- TopoDS_Iterator it(sh);
- sh = it.Value();
- }
- Handle(Geom_Surface) S = BRep_Tool::Surface(TopoDS::Face(theModifiedShape));
- if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
- S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ||
- S->IsUPeriodic()) {
- const Standard_Boolean isShell =
- (sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE);
-
- if( isShell || S->IsUPeriodic() ) {
- // non solid case or any periodic surface (Mantis 22454).
- double U1,U2,V1,V2;
- // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
- //S->Bounds(U1,U2,V1,V2); changed by
- ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
- // end of changes for 020677 (dmv)
- Handle(Geom_RectangularTrimmedSurface) TrS1 =
- new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
- Handle(Geom_RectangularTrimmedSurface) TrS2 =
- new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
- BRep_Builder B;
- TopoDS_Face F1,F2;
- TopoDS_Shape aMShape;
-
- if (isShell) {
- B.MakeCompound(TopoDS::Compound(aMShape));
- } else {
- B.MakeShell(TopoDS::Shell(aMShape));
- }
+ TreeModel::const_iterator i;
+ for ( i = tree.begin(); i != tree.end(); ++i ) {
+ treeStr.append( i->first );
+ treeStr.append( "-" );
+ std::vector<LevelInfo> upLevelList = i->second.first;
+ treeStr.append( "upward" );
+ parseWard( upLevelList, treeStr );
+ std::vector<LevelInfo> downLevelList = i->second.second;
+ treeStr.append( "downward" );
+ parseWard( downLevelList, treeStr );
+ }
+}
- B.MakeFace(F1,TrS1,1.e-7);
- B.Add(aMShape,F1);
- B.MakeFace(F2,TrS2,1.e-7);
- B.Add(aMShape,F2);
- Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+//=======================================================================
+// function : ConvertStringToTree()
+// purpose : Returns the dependency tree
+//=======================================================================
+void GEOMUtils::ConvertStringToTree( const std::string &theData,
+ TreeModel &tree )
+{
+ std::size_t cursor = 0;
- if (!isShell) {
- // The original shape is a solid.
- TopoDS_Solid aSolid;
+ while( theData.find('-',cursor) != std::string::npos ) //find next selected object
+ {
+ std::size_t objectIndex = theData.find( '-', cursor );
+ std::string objectEntry = theData.substr( cursor, objectIndex - cursor );
+ cursor = objectIndex;
- B.MakeSolid(aSolid);
- B.Add(aSolid, aMShape);
- aMShape = aSolid;
- }
+ std::size_t upwardIndexBegin = theData.find("{",cursor) + 1;
+ std::size_t upwardIndexFinish = theData.find("}",upwardIndexBegin);
+ LevelsList upwardList = parseWard( theData, cursor );
- sfs->Init(aMShape);
- sfs->SetPrecision(1.e-6);
- sfs->SetMaxTolerance(1.0);
- sfs->Perform();
- theModifiedShape = sfs->Shape();
- isModified = Standard_True;
- }
- else {
- if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
- Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
- gp_Pnt PC = SS->Location();
- BRep_Builder B;
- TopoDS_Vertex V;
- B.MakeVertex(V,PC,1.e-7);
- theModifiedShape = V;
- theAddDist = SS->Radius();
- isModified = Standard_True;
- }
- else {
- Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
- gp_Ax3 ax3 = TS->Position();
- Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
- BRep_Builder B;
- TopoDS_Edge E;
- B.MakeEdge(E,C,1.e-7);
- theModifiedShape = E;
- theAddDist = TS->MinorRadius();
- isModified = Standard_True;
- }
- }
- } else {
- theModifiedShape = theShape;
- }
- }
- else
- theModifiedShape = theShape;
+ LevelsList downwardList = parseWard( theData, cursor );
- return isModified;
+ tree[objectEntry] = std::pair<LevelsList,LevelsList>( upwardList, downwardList );
+ }
}
#include <functional>
+#include <map>
+#include <vector>
+#include <string>
+#include <utility>
+
class Bnd_Box;
inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
return S1.IsSame(S2);
}
-class GEOMUtils {
+namespace GEOMUtils
+{
+
+ typedef std::vector<std::string> NodeLinks;
+ typedef std::map<std::string, NodeLinks> LevelInfo;
+ typedef std::vector<LevelInfo> LevelsList;
+ typedef std::map<std::string,std::pair<LevelsList,LevelsList> > TreeModel;
- public:
/*!
* \brief Get Local Coordinate System, corresponding to the given shape.
*
* Axes of the LCS are obtained from shape's location or,
* if the shape is a planar face, from position of its plane.
*/
- Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
+ Standard_EXPORT gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
/*!
* \brief Get vector, defined by the given edge.
* the same edge can have different orientation depending on the way it was
* extracted from a shape.
*/
- Standard_EXPORT static gp_Vec GetVector (const TopoDS_Shape& theShape,
- Standard_Boolean doConsiderOrientation);
+ Standard_EXPORT gp_Vec GetVector (const TopoDS_Shape& theShape,
+ Standard_Boolean doConsiderOrientation);
/*!
* \brief Sort shapes in the list by their coordinates.
/*!
* \brief Sort shapes by their centers of mass, using formula X*999 + Y*99 + Z*0.9
*/
- Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL,
- const Standard_Boolean isOldSorting = Standard_True);
+ Standard_EXPORT void SortShapes (TopTools_ListOfShape& SL,
+ const Standard_Boolean isOldSorting = Standard_True);
/*!
* \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
* \param theCompsolid The compsolid to be converted.
* \retval TopoDS_Shape Returns the resulting compound.
*/
- Standard_EXPORT static TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
+ Standard_EXPORT TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
/*!
* \brief Recursively extract all shapes from compounds and compsolids of the given shape into theList.
* \param theShape The shape to be exploded.
* \param theList Output parameter.
*/
- Standard_EXPORT static void AddSimpleShapes (const TopoDS_Shape& theShape,
- TopTools_ListOfShape& theList);
+ Standard_EXPORT void AddSimpleShapes (const TopoDS_Shape& theShape,
+ TopTools_ListOfShape& theList);
/*!
* \brief Build a triangulation on \a theShape if it is absent.
* \param theShape The shape to check/build triangulation on.
* \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
*/
- Standard_EXPORT static bool CheckTriangulation (const TopoDS_Shape& theShape);
-
+ Standard_EXPORT bool CheckTriangulation (const TopoDS_Shape& theShape);
+
/*!
* \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape.
* \param theShape The shape to get type of.
* \retval TopAbs_ShapeEnum Return type of shape for explode.
*/
- Standard_EXPORT static TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
+ Standard_EXPORT TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
/*!
* \brief Find an edge of theShape, closest to thePoint.
* \param thePoint The point near the required edge.
* \retval TopoDS_Shape Returns the found edge or an empty shape if multiple edges found.
*/
- Standard_EXPORT static TopoDS_Shape GetEdgeNearPoint (const TopoDS_Shape& theShape,
- const TopoDS_Vertex& thePoint);
+ Standard_EXPORT TopoDS_Shape GetEdgeNearPoint (const TopoDS_Shape& theShape,
+ const TopoDS_Vertex& thePoint);
/*!
* \brief Compute precise bounding box of the shape based on the rough bounding box.
* \param theBox rough bounding box on input; precise bounding box on output.
* \retval Standard_True in case of success; Standard_False otherwise.
*/
- Standard_EXPORT static Standard_Boolean PreciseBoundingBox
- (const TopoDS_Shape &theShape, Bnd_Box &theBox);
+ Standard_EXPORT Standard_Boolean PreciseBoundingBox(const TopoDS_Shape &theShape, Bnd_Box &theBox);
/*!
* \brief Computes minumal distance between two shapes for singular cases
* \param Ptmp2 the output result point on the second shape
* \retval negative value if it is not a singular case; actual distance for singular case.
*/
- Standard_EXPORT static Standard_Real GetMinDistanceSingular
- (const TopoDS_Shape& aSh1,
- const TopoDS_Shape& aSh2,
- gp_Pnt& Ptmp1, gp_Pnt& Ptmp2);
-
+ Standard_EXPORT Standard_Real GetMinDistanceSingular(const TopoDS_Shape& aSh1,
+ const TopoDS_Shape& aSh2,
+ gp_Pnt& Ptmp1, gp_Pnt& Ptmp2);
+
/*!
* \brief Computes minumal distance between two shapes.
*
* \param thePnt2 the output result point on the second shape
* \retval negative value in case of failure; otherwise the real distance.
*/
- Standard_EXPORT static Standard_Real GetMinDistance
- (const TopoDS_Shape& theShape1,
- const TopoDS_Shape& theShape2,
- gp_Pnt& thePnt1, gp_Pnt& thePnt2);
-
+ Standard_EXPORT Standard_Real GetMinDistance(const TopoDS_Shape& theShape1,
+ const TopoDS_Shape& theShape2,
+ gp_Pnt& thePnt1, gp_Pnt& thePnt2);
+
/*!
* \brief Returns the point clicked in 3D view.
*
* \param theView View where the given point takes place.
* \retval gp_Pnt Returns the point clicked in 3D view
*/
- Standard_EXPORT static gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) theView );
-
-private:
+ Standard_EXPORT gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) theView );
- /**
- * This function constructs and returns modified shape from the original one
- * for singular cases. It is used for the method GetMinDistanceSingular.
- *
- * \param theShape the original shape
- * \param theModifiedShape output parameter. The modified shape.
- * \param theAddDist output parameter. The added distance for modified shape.
- * \retval true if the shape is modified; false otherwise.
- */
- static Standard_Boolean ModifyShape(const TopoDS_Shape &theShape,
- TopoDS_Shape &theModifiedShape,
- Standard_Real &theAddDist);
+ Standard_EXPORT void ConvertTreeToString( const TreeModel &theTree,
+ std::string &DependencyStr );
+ Standard_EXPORT void ConvertStringToTree( const std::string &theDependencyStr,
+ TreeModel &tree );
};
//function : GEOMUtils_Hatcher
//purpose :
//=======================================================================
-GEOMUtils_Hatcher::GEOMUtils_Hatcher(const TopoDS_Face &theFace)
+GEOMUtils::Hatcher::Hatcher(const TopoDS_Face &theFace)
: myHatcher(Geom2dHatch_Intersector (IntersectorConfusion, IntersectorTangency),
HatcherConfusion2d, HatcherConfusion3d,
Standard_True, Standard_False),
//function : Init
//purpose :
//=======================================================================
-void GEOMUtils_Hatcher::Init(const Standard_Integer theNbIsos)
+void GEOMUtils::Hatcher::Init(const Standard_Integer theNbIsos)
{
Init(theNbIsos, theNbIsos);
}
//function : Init
//purpose :
//=======================================================================
-void GEOMUtils_Hatcher::Init(const Standard_Integer theNbIsoU,
- const Standard_Integer theNbIsoV)
+void GEOMUtils::Hatcher::Init(const Standard_Integer theNbIsoU,
+ const Standard_Integer theNbIsoV)
{
// Initialize data.
Clear();
//function : Init
//purpose :
//=======================================================================
-void GEOMUtils_Hatcher::Init(const GeomAbs_IsoType theIsoType,
- const Standard_Real theParameter)
+void GEOMUtils::Hatcher::Init(const GeomAbs_IsoType theIsoType,
+ const Standard_Real theParameter)
{
// Initialize data.
Clear();
//function : Perform
//purpose :
//=======================================================================
-void GEOMUtils_Hatcher::Perform()
+void GEOMUtils::Hatcher::Perform()
{
myHatcher.Trim();
//function : GetNbDomains
//purpose :
//=======================================================================
-Standard_Integer GEOMUtils_Hatcher::GetNbDomains
+Standard_Integer GEOMUtils::Hatcher::GetNbDomains
(const Standard_Integer theHatchingIndex) const
{
Standard_Integer aResult = -1;
//function : GetDomain
//purpose :
//=======================================================================
-Standard_Boolean GEOMUtils_Hatcher::GetDomain
+Standard_Boolean GEOMUtils::Hatcher::GetDomain
(const Standard_Integer theHatchingIndex,
const Standard_Integer theDomainIndex,
Standard_Real &theParam1,
//function : IsDomainInfinite
//purpose :
//=======================================================================
-Standard_Boolean GEOMUtils_Hatcher::IsDomainInfinite
+Standard_Boolean GEOMUtils::Hatcher::IsDomainInfinite
(const Standard_Integer theHatchingIndex,
const Standard_Integer theDomainIndex) const
{
//function : GetHatching
//purpose :
//=======================================================================
-const Handle(Geom2d_Curve) &GEOMUtils_Hatcher::GetHatching
+const Handle(Geom2d_Curve) &GEOMUtils::Hatcher::GetHatching
(const Standard_Integer theHatchingIndex) const
{
const Geom2dAdaptor_Curve &aGACurve =
//function : Clear
//purpose :
//=======================================================================
-void GEOMUtils_Hatcher::Clear()
+void GEOMUtils::Hatcher::Clear()
{
myIsDone = Standard_False;
myUPrm.Nullify();
/*!
* This class represents a hatcher for topological faces.
*/
-class GEOMUtils_Hatcher {
-
-public:
-
- /**
- * Constructor. Initializes the object with the face.
- */
- Standard_EXPORT GEOMUtils_Hatcher(const TopoDS_Face &theFace);
-
- /**
- * This method initializes the hatcher with hatchings.
- *
- * \param theNbIsos the number of U- and V-isolines.
- */
- Standard_EXPORT void Init(const Standard_Integer theNbIsos);
-
- /**
- * This method initializes the hatcher with hatchings.
- *
- * \param theNbIsoU the number of U-isolines.
- * \param theNbIsoV the number of V-isolines.
- */
- Standard_EXPORT void Init(const Standard_Integer theNbIsoU,
- const Standard_Integer theNbIsoV);
-
- /**
- * This method initializes the hatcher with a hatching.
- *
- * \param theIsoType the isoline type.
- * \param theParameter the isoline parameter.
- */
- Standard_EXPORT void Init(const GeomAbs_IsoType theIsoType,
- const Standard_Real theParameter);
-
- /**
- * Compute hatching domatins.
- */
- Standard_EXPORT void Perform();
-
- /**
- * This method returns true if at least one hatching's domains
- * are computed successfully.
- *
- * \return Standard_True is case of success.
- */
- Standard_Boolean IsDone() const
- { return myIsDone; }
-
- /**
- * This method returns the initial face.
- *
- * \return the initial face.
- */
- const TopoDS_Face &GetFace() const
- { return myFace; }
-
- /**
- * This method returns the number of domains for a particular hatching.
- * If the operation is not done or there is no real hatching for
- * a particular index a negative value is returned.
- *
- * \param theHatchingIndex the hatching index.
- * \return the number of domains computed for the hatching.
- */
- Standard_EXPORT Standard_Integer GetNbDomains
- (const Standard_Integer theHatchingIndex) const;
-
- /**
- * This method returns the domputed domain range computed for a particular
- * hatching. theDomainIndex should be in the range [1..GetNbDomains].
- *
- * \param theHatchingIndex the hatching index.
- * \param theDomainIndex the domain index for the particular hatching.
- * \param theParam1 (output) the first parameter of the domain.
- * \param theParam2 (output) the last parameter of the domain.
- * \return Standard_True in case of success; Standard_False otherwise.
- */
- Standard_EXPORT Standard_Boolean GetDomain
- (const Standard_Integer theHatchingIndex,
- const Standard_Integer theDomainIndex,
- Standard_Real &theParam1,
- Standard_Real &theParam2) const;
-
- /**
- * This method returns Standard_True if a domain has infinite first
- * or last parameter.
- *
- * \param theHatchingIndex the hatching index.
- * \param theDomainIndex the domain index for the particular hatching.
- * \return Standard_True if a domain is infinite; Standard_False otherwise.
- */
- Standard_EXPORT Standard_Boolean IsDomainInfinite
- (const Standard_Integer theHatchingIndex,
- const Standard_Integer theDomainIndex) const;
-
- /**
- * This method returns the reference to OCCT hatcher.
- *
- * \return the reference to OCCT hatcher.
- */
- Standard_EXPORT const Geom2dHatch_Hatcher &GetHatcher() const
- { return myHatcher; }
-
- /**
- * This method returns the array of indices of U-isoline hatchings.
- * Can be null if the object is initialized by 0 U-isolines.
- *
- * \return the array of U-isoline hatching indices.
- */
- Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetUIndices() const
- { return myUInd; }
-
- /**
- * This method returns the array of indices of V-isoline hatchings.
- * Can be null if the object is initialized by 0 V-isolines.
- *
- * \return the array of V-isoline hatching indices.
- */
- Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetVIndices() const
- { return myVInd; }
-
- /**
- * This method returns the array of parameters of U-isoline hatchings.
- * Can be null if the object is initialized by 0 U-isolines.
- *
- * \return the array of U-isoline hatching parameters.
- */
- Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetUParams() const
- { return myUPrm; }
-
- /**
- * This method returns the array of parameters of V-isoline hatchings.
- * Can be null if the object is initialized by 0 V-isolines.
- *
- * \return the array of V-isoline hatching parameters.
- */
- Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetVParams() const
- { return myVPrm; }
-
- /**
- * This method returns a hatching curve by its index.
- * If the curve is not found null handle is returned.
- *
- * \param theHatchingIndex the hatching curve index.
- */
- Standard_EXPORT const Handle(Geom2d_Curve) &GetHatching
- (const Standard_Integer theHatchingIndex) const;
-
-protected:
-
- /**
- * This method clears all hatchings data.
- */
- void Clear();
-
-private:
-
- Geom2dHatch_Hatcher myHatcher;
- TopoDS_Face myFace;
- Standard_Boolean myIsDone;
- Standard_Real myUMin;
- Standard_Real myUMax;
- Standard_Real myVMin;
- Standard_Real myVMax;
- Handle(TColStd_HArray1OfReal) myUPrm;
- Handle(TColStd_HArray1OfReal) myVPrm;
- Handle(TColStd_HArray1OfInteger) myUInd;
- Handle(TColStd_HArray1OfInteger) myVInd;
-
-};
+namespace GEOMUtils
+{
+ class Hatcher
+ {
+ public:
+
+ /**
+ * Constructor. Initializes the object with the face.
+ */
+ Standard_EXPORT Hatcher(const TopoDS_Face &theFace);
+
+ /**
+ * This method initializes the hatcher with hatchings.
+ *
+ * \param theNbIsos the number of U- and V-isolines.
+ */
+ Standard_EXPORT void Init(const Standard_Integer theNbIsos);
+
+ /**
+ * This method initializes the hatcher with hatchings.
+ *
+ * \param theNbIsoU the number of U-isolines.
+ * \param theNbIsoV the number of V-isolines.
+ */
+ Standard_EXPORT void Init(const Standard_Integer theNbIsoU,
+ const Standard_Integer theNbIsoV);
+
+ /**
+ * This method initializes the hatcher with a hatching.
+ *
+ * \param theIsoType the isoline type.
+ * \param theParameter the isoline parameter.
+ */
+ Standard_EXPORT void Init(const GeomAbs_IsoType theIsoType,
+ const Standard_Real theParameter);
+
+ /**
+ * Compute hatching domatins.
+ */
+ Standard_EXPORT void Perform();
+
+ /**
+ * This method returns true if at least one hatching's domains
+ * are computed successfully.
+ *
+ * \return Standard_True is case of success.
+ */
+ Standard_Boolean IsDone() const
+ { return myIsDone; }
+
+ /**
+ * This method returns the initial face.
+ *
+ * \return the initial face.
+ */
+ const TopoDS_Face &GetFace() const
+ { return myFace; }
+
+ /**
+ * This method returns the number of domains for a particular hatching.
+ * If the operation is not done or there is no real hatching for
+ * a particular index a negative value is returned.
+ *
+ * \param theHatchingIndex the hatching index.
+ * \return the number of domains computed for the hatching.
+ */
+ Standard_EXPORT Standard_Integer GetNbDomains
+ (const Standard_Integer theHatchingIndex) const;
+
+ /**
+ * This method returns the domputed domain range computed for a particular
+ * hatching. theDomainIndex should be in the range [1..GetNbDomains].
+ *
+ * \param theHatchingIndex the hatching index.
+ * \param theDomainIndex the domain index for the particular hatching.
+ * \param theParam1 (output) the first parameter of the domain.
+ * \param theParam2 (output) the last parameter of the domain.
+ * \return Standard_True in case of success; Standard_False otherwise.
+ */
+ Standard_EXPORT Standard_Boolean GetDomain
+ (const Standard_Integer theHatchingIndex,
+ const Standard_Integer theDomainIndex,
+ Standard_Real &theParam1,
+ Standard_Real &theParam2) const;
+
+ /**
+ * This method returns Standard_True if a domain has infinite first
+ * or last parameter.
+ *
+ * \param theHatchingIndex the hatching index.
+ * \param theDomainIndex the domain index for the particular hatching.
+ * \return Standard_True if a domain is infinite; Standard_False otherwise.
+ */
+ Standard_EXPORT Standard_Boolean IsDomainInfinite
+ (const Standard_Integer theHatchingIndex,
+ const Standard_Integer theDomainIndex) const;
+
+ /**
+ * This method returns the reference to OCCT hatcher.
+ *
+ * \return the reference to OCCT hatcher.
+ */
+ Standard_EXPORT const Geom2dHatch_Hatcher &GetHatcher() const
+ { return myHatcher; }
+
+ /**
+ * This method returns the array of indices of U-isoline hatchings.
+ * Can be null if the object is initialized by 0 U-isolines.
+ *
+ * \return the array of U-isoline hatching indices.
+ */
+ Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetUIndices() const
+ { return myUInd; }
+
+ /**
+ * This method returns the array of indices of V-isoline hatchings.
+ * Can be null if the object is initialized by 0 V-isolines.
+ *
+ * \return the array of V-isoline hatching indices.
+ */
+ Standard_EXPORT const Handle(TColStd_HArray1OfInteger) &GetVIndices() const
+ { return myVInd; }
+
+ /**
+ * This method returns the array of parameters of U-isoline hatchings.
+ * Can be null if the object is initialized by 0 U-isolines.
+ *
+ * \return the array of U-isoline hatching parameters.
+ */
+ Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetUParams() const
+ { return myUPrm; }
+
+ /**
+ * This method returns the array of parameters of V-isoline hatchings.
+ * Can be null if the object is initialized by 0 V-isolines.
+ *
+ * \return the array of V-isoline hatching parameters.
+ */
+ Standard_EXPORT const Handle(TColStd_HArray1OfReal) &GetVParams() const
+ { return myVPrm; }
+
+ /**
+ * This method returns a hatching curve by its index.
+ * If the curve is not found null handle is returned.
+ *
+ * \param theHatchingIndex the hatching curve index.
+ */
+ Standard_EXPORT const Handle(Geom2d_Curve) &GetHatching
+ (const Standard_Integer theHatchingIndex) const;
+
+ protected:
+
+ /**
+ * This method clears all hatchings data.
+ */
+ void Clear();
+
+ private:
+
+ Geom2dHatch_Hatcher myHatcher;
+ TopoDS_Face myFace;
+ Standard_Boolean myIsDone;
+ Standard_Real myUMin;
+ Standard_Real myUMax;
+ Standard_Real myVMin;
+ Standard_Real myVMax;
+ Handle(TColStd_HArray1OfReal) myUPrm;
+ Handle(TColStd_HArray1OfReal) myVPrm;
+ Handle(TColStd_HArray1OfInteger) myUInd;
+ Handle(TColStd_HArray1OfInteger) myVInd;
+
+ };
+}
#endif
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "GEOMUtils_XmlHandler.hxx"
+
+#include <libxml/parser.h>
+#include <algorithm>
+
+#ifdef WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+//#define MYDEBUG
+
+namespace
+{
+ const char* env_var = "GEOM_PluginsList";
+
+ const xmlChar* root_tag = (xmlChar*)"geom-plugins";
+ const xmlChar* plugin_tag = (xmlChar*)"geom-plugin";
+ const xmlChar* name_tag = (xmlChar*)"name";
+ const xmlChar* server_tag = (xmlChar*)"server-lib";
+ const xmlChar* gui_tag = (xmlChar*)"gui-lib";
+ const xmlChar* actions_tag = (xmlChar*)"actions";
+ const xmlChar* action_tag = (xmlChar*)"action";
+ const xmlChar* label_tag = (xmlChar*)"label";
+ const xmlChar* icon_tag = (xmlChar*)"icon";
+ const xmlChar* menu_tag = (xmlChar*)"menu";
+ const xmlChar* tooltip_tag = (xmlChar*)"tooltip";
+ const xmlChar* status_tag = (xmlChar*)"status-bar";
+ const xmlChar* accel_tag = (xmlChar*)"accel";
+
+ std::string toUpper( const std::string& s )
+ {
+ std::string r = s;
+ std::transform( r.begin(), r.end(), r.begin(), toupper );
+ return r;
+ }
+
+ std::string toLower( const std::string& s )
+ {
+ std::string r = s;
+ std::transform( r.begin(), r.end(), r.begin(), tolower );
+ return r;
+ }
+
+ std::string readXmlAttribute(xmlNodePtr node, const xmlChar* attribute)
+ {
+ std::string result = "";
+ xmlChar* strAttr = xmlGetProp(node, attribute);
+ if (strAttr != NULL) {
+ result = (char*)strAttr;
+ xmlFree(strAttr);
+ }
+ return result;
+ }
+
+ std::list<std::string> getPluginXMLFiles()
+ {
+ std::list<std::string> xmlPaths;
+
+#ifdef WIN32
+ std::string sep = "\\";
+#else
+ std::string sep = "/";
+#endif
+
+ if ( const char* var = getenv( env_var ) )
+ {
+ std::string plugins = var;
+
+ std::string::size_type from = 0, pos;
+ while ( from < plugins.size() )
+ {
+ pos = plugins.find( ':', from );
+ std::string plugin;
+ if ( pos != std::string::npos )
+ plugin = plugins.substr( from, pos-from );
+ else
+ plugin = plugins.substr( from ), pos = plugins.size();
+ from = pos + 1;
+
+ if ( plugin.size() == 0 ) continue;
+
+ std::string pluginRoot = toUpper( plugin+"_ROOT_DIR" );
+
+ const char* rootDirGeom = getenv( "GEOM_ROOT_DIR" );
+ const char* rootDirPlugin = getenv( pluginRoot.c_str() );
+
+ bool fileOK = false;
+ if ( rootDirGeom ) {
+ std::string xmlPath = rootDirGeom;
+ if ( xmlPath[ xmlPath.size()-1 ] != sep[0] )
+ xmlPath += sep;
+ xmlPath += "share" + sep + "salome" + sep + "resources" + sep + "geom" + sep + plugin + ".xml";
+#ifdef WIN32
+ fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
+#else
+ fileOK = (access(xmlPath.c_str(), F_OK) == 0);
+#endif
+ if ( fileOK )
+ xmlPaths.push_back( xmlPath );
+ }
+ if ( !fileOK && rootDirPlugin ) {
+ std::string xmlPath = rootDirPlugin;
+ if ( xmlPath[ xmlPath.size()-1 ] != sep[0] )
+ xmlPath += sep;
+ xmlPath += "share" + sep + "salome" + sep + "resources" + sep + toLower(plugin) + sep + plugin + ".xml";
+#ifdef WIN32
+ fileOK = (GetFileAttributes(xmlPath.c_str()) != INVALID_FILE_ATTRIBUTES);
+#else
+ fileOK = (access(xmlPath.c_str(), F_OK) == 0);
+#endif
+ if ( fileOK )
+ xmlPaths.push_back( xmlPath );
+ }
+ }
+ }
+ return xmlPaths;
+ }
+
+ void dumpinfo(const GEOMUtils::PluginInfo& info)
+ {
+ printf("DUMPING PLUGIN INFO\n");
+ GEOMUtils::PluginInfo::const_iterator it;
+ for (it = info.begin(); it != info.end(); ++it) {
+ GEOMUtils::PluginData pdata = *it;
+ printf("Plugin: %s\n", pdata.name.c_str());
+ printf(" serverLib = %s\n", pdata.serverLib.c_str());
+ printf(" clientLib = %s\n", pdata.clientLib.c_str());
+ printf(" actions:\n");
+ std::list<GEOMUtils::ActionData>::const_iterator ait;
+ for (ait = pdata.actions.begin(); ait != pdata.actions.end(); ++ait) {
+ GEOMUtils::ActionData adata = *ait;
+ printf(" label = %s\n", adata.label.c_str());
+ printf(" icon = %s\n", adata.icon.c_str());
+ printf(" menuText = %s\n", adata.menuText.c_str());
+ printf(" toolTip = %s\n", adata.toolTip.c_str());
+ printf(" statusText = %s\n", adata.statusText.c_str());
+ printf("\n");
+ }
+ printf("-----\n");
+ }
+ }
+}
+
+namespace GEOMUtils
+{
+ PluginInfo ReadPluginInfo()
+ {
+ PluginInfo info;
+
+ std::list<std::string> xmlPaths = getPluginXMLFiles();
+
+ std::list<std::string>::const_iterator fit;
+
+ for ( fit = xmlPaths.begin(); fit != xmlPaths.end(); ++fit )
+ {
+ std::string fileName = *fit;
+
+ int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA;
+ xmlDocPtr doc = xmlReadFile( fileName.c_str(), NULL, options );
+
+ if ( doc )
+ {
+ // get root node
+ xmlNodePtr root = xmlDocGetRootElement(doc);
+
+ // check if it is plugins container node
+ if (xmlStrcmp(root->name, root_tag) == 0)
+ {
+ // iterate through children, to get plugins data
+ for (xmlNodePtr node = root->children; node; node = node->next)
+ {
+ if (xmlStrcmp(node->name, plugin_tag) == 0)
+ {
+ // plugin node
+ PluginData data;
+ data.name = readXmlAttribute(node, name_tag);
+ data.serverLib = readXmlAttribute(node, server_tag);
+ data.clientLib = readXmlAttribute(node, gui_tag);
+ // iterate through children, to find actions container node
+ for (xmlNodePtr subnode = node->children; subnode; subnode = subnode->next)
+ {
+ if (xmlStrcmp(subnode->name, actions_tag) == 0)
+ {
+ // actions container node
+ // iterate through children, to get actions data
+ for (xmlNodePtr subsubnode = subnode->children; subsubnode; subsubnode = subsubnode->next)
+ {
+ if (xmlStrcmp(subsubnode->name, action_tag) == 0)
+ {
+ // action node
+ ActionData action;
+ action.label = readXmlAttribute(subsubnode, label_tag);
+ action.icon = readXmlAttribute(subsubnode, icon_tag);
+ action.menuText = readXmlAttribute(subsubnode, menu_tag);
+ action.toolTip = readXmlAttribute(subsubnode, tooltip_tag);
+ action.statusText = readXmlAttribute(subsubnode, status_tag);
+ action.accel = readXmlAttribute(subsubnode, accel_tag);
+ if (action.label != "")
+ data.actions.push_back(action);
+ } // end action node
+ } // end iteration through actions container node children
+ } // end actions container node
+ } // end iterations through plugin node children
+
+ if (data.name != "")
+ info.push_back(data);
+ } // end plugin node
+ } // end iterations through plugins container node children
+ } // end root node
+
+ xmlFreeDoc(doc);
+ //xmlCleanupParser();//vsr: xmlCleanupParser should not be called from the application
+ } // end xml doc
+ }
+#ifdef MYDEBUG
+ dumpinfo(info);
+#endif
+ return info;
+ }
+}
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOMUtils_XmlHandler_HXX_
+#define _GEOMUtils_XmlHandler_HXX_
+
+#include <Standard_Macro.hxx>
+
+#include <string>
+#include <list>
+
+namespace GEOMUtils
+{
+ //! Plugin action data
+ struct Standard_EXPORT ActionData
+ {
+ std::string label; //!< unique ID
+ std::string icon; //!< icon
+ std::string menuText; //!< menu text
+ std::string toolTip; //!< tooltip
+ std::string statusText; //!< status bar text
+ std::string accel; //!< shortcut
+ };
+
+ //! Plugin data
+ struct Standard_EXPORT PluginData
+ {
+ std::string name; //!< plugin name
+ std::string serverLib; //!< engine library
+ std::string clientLib; //!< GUI library
+ std::list<ActionData> actions; //!< actions
+ };
+
+ //! Plugins information
+ typedef std::list<PluginData> PluginInfo;
+
+ Standard_EXPORT PluginInfo ReadPluginInfo();
+}
+
+#endif // _GEOMUtils_XmlHandler_HXX_
${PROJECT_SOURCE_DIR}/src/GEOMImpl
${PROJECT_SOURCE_DIR}/src/GEOM
${PROJECT_SOURCE_DIR}/src/GEOMAlgo
- ${PROJECT_SOURCE_DIR}/src/XAO
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
${PROJECT_BINARY_DIR}/idl
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
# libraries to link to
SET(_link_LIBRARIES
GEOMImpl
+ GEOMUtils
SalomeIDLGEOM
${KERNEL_SALOMELocalTrace}
${KERNEL_SalomeGenericObj}
# --- headers ---
SET(GEOMEngine_HEADERS
+ GEOM_IFieldOperations_i.hh
+ GEOM_BaseObject_i.hh
GEOM_Object_i.hh
GEOM_IOperations_i.hh
GEOM_IBasicOperations_i.hh
#include "Utils_ExceptHandlers.hxx"
#include "utilities.h"
-#include "GEOM_Object_i.hh"
#include "GEOM_Object.hxx"
#include "GEOM_Function.hxx"
#include "GEOM_ISubShape.hxx"
#include "GEOMImpl_CopyDriver.hxx"
#include "GEOMImpl_IInsertOperations.hxx"
#include "GEOM_wrap.hxx"
+#include "GEOMUtils_XmlHandler.hxx"
// Cascade headers
#include <BRep_Builder.hxx>
#include <TopExp.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <OSD.hxx>
+#include <TDataStd_ChildNodeIterator.hxx>
+#include <TDocStd_Owner.hxx>
+#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
#include <SALOMEDS_Tool.hxx>
#include <SALOMEDS_wrap.hxx>
#endif
OSD::SetSignal( raiseFPE );
}
+
+ GEOMUtils::PluginInfo plugins = GEOMUtils::ReadPluginInfo();
+ GEOMUtils::PluginInfo::const_iterator it;
+ for (it = plugins.begin(); it != plugins.end(); ++it)
+ {
+ try {
+ LoadPlugin((*it).serverLib);
+ }
+ catch (...) {
+ MESSAGE("Warning: can't load plugin library " << (*it).serverLib);
+ }
+ }
}
//============================================================================
} else if ( mytype == GEOM_MARKER ) {
aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_LCS");
aNamePrefix = "LocalCS_";
- } else if ( mytype > ADVANCED_BASE ) {
+ } else if ( mytype >= USER_TYPE_EX ) {
+ char buf[20];
+ sprintf( buf, "%d", aBaseObj->GetType() );
+ GEOM::CreationInformation_var info = aBaseObj->GetCreationInformation();
+ std::string plgId;
+ for ( size_t i = 0; i < info->params.length(); ++i ) {
+ std::string param_name = info->params[i].name.in();
+ std::string param_value = info->params[i].value.in();
+ if( param_name == PLUGIN_NAME) {
+ plgId = param_value;
+ break;
+ }
+ }
+ if(plgId.length() > 0 ) {
+ plgId += "::";
+ }
+ plgId +="ICON_OBJBROWSER_";
+ plgId += buf;
+ aResultSO->SetAttrString("AttributePixMap",plgId.c_str());
+ } else if ( mytype > USER_TYPE ) {
char buf[20];
sprintf( buf, "%d", aBaseObj->GetType() );
std::string advId = "ICON_OBJBROWSER_ADVANCED_"; advId += buf;
const char* theLibName)
throw ( SALOME::SALOME_Exception )
{
- std::string aPlatformLibName;
-#ifdef WIN32
- aPlatformLibName = theLibName;
- aPlatformLibName += ".dll" ;
-#else
- aPlatformLibName = "lib";
- aPlatformLibName += theLibName;
- aPlatformLibName += ".so";
-#endif
-
Unexpect aCatch(SALOME_SalomeException);
MESSAGE( "GEOM_Gen_i::GetPluginOperations" );
GEOM::GEOM_Gen_ptr engine = _this();
- GEOM_IOperations_i* aServant = 0;
GEOM::GEOM_IOperations_var operations;
- try {
- // check, if corresponding operations are already created
- if (myOpCreatorMap.find(std::string(theLibName)) == myOpCreatorMap.end()) {
- // load plugin library
- LibHandle libHandle = LoadLib( aPlatformLibName.c_str()/*theLibName*/ );
- if (!libHandle) {
- // report any error, if occured
-#ifndef WIN32
- const char* anError = dlerror();
- throw(SALOME_Exception(anError));
-#else
- throw(SALOME_Exception(LOCALIZED( "Can't load server geometry plugin library" )));
-#endif
- }
-
- // get method, returning operations creator
- typedef GEOM_GenericOperationsCreator* (*GetOperationsCreator)();
- GetOperationsCreator procHandle =
- (GetOperationsCreator)GetProc( libHandle, "GetOperationsCreator" );
- if (!procHandle) {
- throw(SALOME_Exception(LOCALIZED("bad geometry plugin library")));
- UnLoadLib(libHandle);
- }
-
- // get operations creator
- GEOM_GenericOperationsCreator* aCreator = procHandle();
- if (!aCreator) {
- throw(SALOME_Exception(LOCALIZED("bad geometry plugin library implementation")));
- }
-
- // map operations creator to a plugin name
- myOpCreatorMap[std::string(theLibName)] = aCreator;
- }
+ std::string aLibName = theLibName;
+ try {
+ // load plugin library
+ LoadPlugin(aLibName);
// create a new operations object, store its ref. in engine
- aServant = myOpCreatorMap[std::string(theLibName)]->Create(_poa, theStudyID, engine, _impl);
- //??? aServant->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance
+ if ( myOpCreatorMap.find(aLibName) != myOpCreatorMap.end() ) {
+ GEOM_IOperations_i* aServant = 0;
+ aServant = myOpCreatorMap[aLibName]->Create(_poa, theStudyID, engine, _impl);
+ // activate the CORBA servant
+ if (aServant)
+ operations = aServant->_this();
+ }
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
- if (!aServant)
- return operations._retn();
-
- // activate the CORBA servant
- operations = GEOM::GEOM_IOperations::_narrow( aServant->_this() );
return operations._retn();
}
+//============================================================================
+// function : LoadPlugin
+// purpose : load plugin library and retrieve an instance of operations creator
+//============================================================================
+void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
+{
+ std::string aPlatformLibName;
+#ifdef WIN32
+ aPlatformLibName = theLibName;
+ aPlatformLibName += ".dll" ;
+#else
+ aPlatformLibName = "lib";
+ aPlatformLibName += theLibName;
+ aPlatformLibName += ".so";
+#endif
+
+ // check, if corresponding operations are already created
+ if (myOpCreatorMap.find(theLibName) == myOpCreatorMap.end()) {
+ // load plugin library
+ LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
+ if (!libHandle) {
+ // report any error, if occured
+#ifndef WIN32
+ throw(SALOME_Exception(dlerror()));
+#else
+ throw(SALOME_Exception(LOCALIZED( "Can't load server geometry plugin library" )));
+#endif
+ }
+
+ // get method, returning operations creator
+ typedef GEOM_GenericOperationsCreator* (*GetOperationsCreator)();
+ GetOperationsCreator procHandle =
+ (GetOperationsCreator)GetProc( libHandle, "GetOperationsCreator" );
+ if (!procHandle) {
+ UnLoadLib(libHandle);
+ throw(SALOME_Exception(LOCALIZED("bad geometry plugin library")));
+ }
+
+ // get operations creator
+ GEOM_GenericOperationsCreator* aCreator = procHandle();
+ if (aCreator) {
+ // map operations creator to a plugin name
+ myOpCreatorMap[theLibName] = aCreator;
+ }
+ else {
+ throw(SALOME_Exception(LOCALIZED("bad geometry plugin library implementation")));
+ }
+ }
+}
+
//=============================================================================
/*!
* AddSubShape
aFile.write(aBuffer, aFileStream->length());
aFile.close();
- GEOM::GEOM_Object_var aShapeObj;
- GEOM::ListOfGO_var aSubShape = new GEOM::ListOfGO;
- GEOM::ListOfGO_var aGroups = new GEOM::ListOfGO;
- GEOM::ListOfFields_var aFields = new GEOM::ListOfFields;
-
- CORBA::Boolean isResultOK = aInsOp->ImportXAO(aFullPath.c_str(), aShapeObj.out(), aSubShape.out(), aGroups.out(), aFields.out());
-
- if ( isResultOK && !aShapeObj->_is_nil() && aInsOp->IsDone() ) {
- SALOMEDS::SObject_var aSO = PublishInStudy(aStudy, SALOMEDS::SObject::_nil(), aShapeObj, aShapeObj->GetName());
- aResult->length(aGroups->length() + 1);
- aResult[0] = aSO->GetID(); // unioque identifer of the object in GEOM is entry of SObject
- //Iteration for objects of the group.
- for (int i = 0; i < aGroups->length(); i++) {
- SALOMEDS::SObject_var aSOChild = AddInStudy(aStudy, aGroups[i], aGroups[i]->GetName(), aShapeObj);
- aResult[i+1] = aSOChild->GetID();
+ GEOM::ListOfGBO_var aObjects = aInsOp->ImportFile(aFullPath.c_str(), "XAO");
+
+ if ( aObjects->length() > 0 && aInsOp->IsDone() ) {
+ aResult->length(aObjects->length());
+ // publish main object (first in the list of returned geom objects)
+ CORBA::String_var aName = aObjects[0]->GetName();
+ SALOMEDS::SObject_var aSO = PublishInStudy(aStudy.in(), SALOMEDS::SObject::_nil(), aObjects[0].in(), aName.in());
+ aResult[0] = aSO->GetID();
+ // publish groups && fields
+ for (int i = 1; i < aObjects->length(); i++ ) {
+ aName = aObjects[i]->GetName();
+ aSO = AddInStudy(aStudy.in(), aObjects[0].in(), aName.in(), aObjects[0].in());
+ aResult[i] = aSO->GetID();
}
}
else {
- if (aShapeObj->_is_nil())
- MESSAGE("Result of the import operation is incorrect for file "<<aFullPath.c_str());
+ if (aObjects->length() == 0)
+ MESSAGE("ImportXAO operation is failed for file "<<aFullPath.c_str());
if (!aInsOp->IsDone())
MESSAGE("Import operation is not done for file "<<aFullPath.c_str());
- if (!isResultOK)
- MESSAGE("ImportXAO operation is failed for file "<<aFullPath.c_str());
return aResult._retn();
}
CORBA::Object_var aSMObject = name_service->Resolve("/myStudyManager");
SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
+ if (CORBA::is_nil(aStudyManager))
+ return aResult._retn();
SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
+ if (CORBA::is_nil(aStudy))
+ return aResult._retn();
SALOMEDS::SComponent_var aComponent = aStudy->FindComponent("GEOM");
if (CORBA::is_nil(aComponent))
return aResult._retn();
SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(aComponent); // check only published shapes
+ GEOM::GEOM_IInsertOperations_var aInsOp = GetIInsertOperations(aStudy->StudyId());
+ if (aInsOp->_is_nil()) {
+ MESSAGE("No insert operations!");
+ return aResult._retn();
+ }
+
GEOM::GEOM_Object_var shapeObj;
- GEOM::ListOfGO_var groups = new GEOM::ListOfGO;
- GEOM::ListOfFields_var fields = new GEOM::ListOfFields;
- std::string anAuthorName = "SIMAN Author";
- GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(aStudy->StudyId());
- GEOM::GEOM_IInsertOperations_var aInsOp = GetIInsertOperations(aStudy->StudyId());
-
- int aSeqLength = 0; // the sequence length
for(; anIter->More(); anIter->Next()) {
SALOMEDS::SObject_var aSO = anIter->Value();
SALOMEDS::SObject_var aRefSO;
GEOM::shape_type aCORBAShapeType = aCORBAMainShape->GetShapeType();
if (!aMainShape.IsNull() && !(aCORBAShapeType == GEOM::VERTEX) && !(aCORBAShapeType == GEOM::EDGE)) {
- aSeqLength++;
shapeObj = aCORBAMainShape;
- if (aShapesOp->_is_nil()) {
- MESSAGE("No shapes operations!");
- return aResult._retn();
- }
- groups = aShapesOp->GetExistingSubObjects(aCORBAMainShape, true);
break;
}
}
}
}
- if (aInsOp->_is_nil()) {
- MESSAGE("No insert operations!");
- return aResult._retn();
- }
-
- if (aSeqLength > 0) { // Shape is correct, write it to the temporary file
-
- std::string aFullXaoPath = Kernel_Utils::GetTmpFileName() + ".xao";
- CORBA::Boolean isResultOK = aInsOp->ExportXAO(shapeObj.in(), groups.in(), fields.in(), anAuthorName.c_str(), aFullXaoPath.c_str());
-
+ if (!CORBA::is_nil(shapeObj)) { // Shape is correct, write it to the temporary file
+ std::string aPath = Kernel_Utils::GetTmpFileName() + ".xao";
+ aInsOp->Export(shapeObj.in(), aPath.c_str(), "XAO");
aResult->length(1);
Engines::DataContainer_var aData = (new Engines_DataContainer_i(
- aFullXaoPath.c_str(), "", "", true))->_this();
+ aPath.c_str(), "", "", true))->_this();
aResult[0] = aData;
} else {
MESSAGE("No shapes to export");
return aResult._retn();
}
+//=======================================================================
+// 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 ) {
+ // fill in the tree structure
+ GEOMUtils::TreeModel tree;
+
+ std::string entry;
+ 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() );
+ if ( anObj->_is_nil() )
+ continue;
+ std::map< std::string, std::set<std::string> > passedEntries;
+ GEOMUtils::LevelsList upLevelList;
+ // get objects from which current one depends on recursively
+ getUpwardDependency( anObj, upLevelList, passedEntries );
+ GEOMUtils::LevelsList downLevelList;
+ // get objects that depends on current one recursively
+ getDownwardDependency( anObj, downLevelList, passedEntries );
+ tree.insert( std::pair<std::string, std::pair<GEOMUtils::LevelsList,GEOMUtils::LevelsList> >(entry, std::pair<GEOMUtils::LevelsList,GEOMUtils::LevelsList>( upLevelList, downLevelList ) ) );
+ }
+
+ // translation the tree into string
+ std::string treeStr;
+ GEOMUtils::ConvertTreeToString( tree, treeStr );
+
+ // put string into stream
+ char* aBuffer = (char*)CORBA::string_dup(treeStr.c_str());
+ int aBufferSize = strlen((char*)aBuffer);
+
+ CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
+
+ SALOMEDS::TMPFile_var aStream = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1);
+
+ return aStream._retn();
+}
+
+//=======================================================================
+// function : getUpwardDependency
+// purpose : Collects the entries of objects on that the given one depends
+//=======================================================================
+void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+ GEOMUtils::LevelsList &upLevelList,
+ std::map< std::string, std::set<std::string> > &passedEntries,
+ int level ) {
+ std::string aGboEntry = gbo->GetEntry();
+ GEOMUtils::NodeLinks anEntries;
+ GEOMUtils::LevelInfo aLevelMap;
+ if ( level > 0 ) {
+ if ( level-1 >= upLevelList.size() ) {
+ // create a new map
+ upLevelList.push_back( aLevelMap );
+ } else {
+ // get the existent map
+ aLevelMap = upLevelList.at(level-1);
+ if ( aLevelMap.count( aGboEntry ) > 0 ) {
+ anEntries = aLevelMap[ aGboEntry ];
+ }
+ }
+ }
+ // get objects on that the current one depends
+ GEOM::ListOfGBO_var depList = gbo->GetDependency();
+ std::string aDepEntry;
+ for( int j = 0; j < depList->length(); j++ ) {
+ if ( depList[j]->_is_nil() )
+ continue;
+ aDepEntry = depList[j]->GetEntry();
+ if ( passedEntries.count( aGboEntry ) > 0 &&
+ passedEntries[aGboEntry].count( aDepEntry ) > 0 ) {
+ //avoid checking the passed objects
+ continue;
+ }
+ passedEntries[aGboEntry].insert( aDepEntry );
+ if ( level > 0 ) {
+ anEntries.push_back( aDepEntry );
+ }
+ // get dependencies recursively
+ getUpwardDependency(depList[j], upLevelList, passedEntries, level+1);
+ }
+ if ( level > 0 ) {
+ aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGboEntry, anEntries) );
+ upLevelList[level-1] = aLevelMap;
+ }
+}
+
+//=======================================================================
+// function : getDownwardDependency
+// purpose : Collects the entries of objects that depends on the given one
+//=======================================================================
+void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+ GEOMUtils::LevelsList &downLevelList,
+ 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(TDataStd_TreeNode) aNode, aRoot;
+ Handle(GEOM_Function) aFunction;
+ if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
+ // go through the whole OCAF tree
+ TDataStd_ChildNodeIterator Itr( aRoot );
+ for (; Itr.More(); Itr.Next()) {
+ aNode = Itr.Value();
+ aFunction = GEOM_Function::GetFunction(aNode->Label());
+ if (aFunction.IsNull()) {
+ continue;
+ }
+ TDF_Label aLabel = aFunction->GetOwnerEntry();
+ if(aLabel.IsNull()) continue;
+ TCollection_AsciiString anEntry;
+ TDF_Tool::Entry(aLabel, anEntry);
+ GEOM::GEOM_BaseObject_var geomObj = GetObject( gbo->GetStudyID(), anEntry.ToCString() );
+ if( CORBA::is_nil( geomObj ) )
+ continue;
+ // get dependencies for current object in the tree
+ GEOM::ListOfGBO_var depList = geomObj->GetDependency();
+ if( depList->length() == 0 )
+ continue;
+ std::string aGoEntry = geomObj->GetEntry();
+ // go through dependencies of current object to check whether it depends on the given object
+ for( int i = 0; i < depList->length(); i++ ) {
+ if ( depList[i]->_is_nil() )
+ continue;
+ if ( depList[i]->_is_equivalent( gbo ) ) {
+ // yes, the current object depends on the given object
+ if ( passedEntries.count( aGoEntry ) > 0 &&
+ passedEntries[aGoEntry].count( aGboEntry ) > 0 ) {
+ //avoid checking the passed objects
+ continue;
+ }
+ passedEntries[aGoEntry].insert( aGboEntry );
+ GEOMUtils::NodeLinks anEntries;
+ GEOMUtils::LevelInfo aLevelMap;
+ anEntries.push_back( aGboEntry );
+ if ( level >= downLevelList.size() ) {
+ downLevelList.push_back( aLevelMap );
+ } else {
+ aLevelMap = downLevelList.at(level);
+ if ( aLevelMap.count( aGoEntry ) > 0 ) {
+ anEntries = aLevelMap[ aGoEntry ];
+ }
+ }
+ aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGoEntry, anEntries) );
+ downLevelList[level] = aLevelMap;
+ // get dependencies of the current object recursively
+ getDownwardDependency(geomObj, downLevelList, passedEntries, level+1);
+ break;
+ }
+ }
+ }
+ }
+}
+
+//==============================================================================
+// 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)
+{
+ 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(TDataStd_TreeNode) aNode, aRoot;
+ Handle(GEOM_Function) aFunction;
+ if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
+ // go through the whole OCAF tree
+ TDF_Label aLabel;
+ std::string anEntry;
+ TCollection_AsciiString anAsciiEntry;
+ TDataStd_ChildNodeIterator Itr( aRoot );
+ for (; Itr.More(); Itr.Next()) {
+ aNode = Itr.Value();
+ aFunction = GEOM_Function::GetFunction(aNode->Label());
+ if (aFunction.IsNull()) {
+ continue;
+ }
+ aLabel = aFunction->GetOwnerEntry();
+ if(aLabel.IsNull())
+ continue;
+ TDF_Tool::Entry(aLabel, anAsciiEntry);
+ anEntry = anAsciiEntry.ToCString();
+ GEOM::GEOM_BaseObject_var geomObj = GetObject( theStudy->StudyId(), anEntry.c_str() );
+ if( CORBA::is_nil( geomObj ) )
+ continue;
+
+ if ( aSelected.count( anEntry ) > 0 &&
+ aParents.count( anEntry ) == 0 ) {
+ includeParentDependencies( geomObj, aSelected, aParents, aChildren, anOthers );
+ } else if ( aParents.count( anEntry ) == 0 &&
+ aChildren.count( anEntry ) == 0 ) {
+ anOthers.insert( geomObj->GetEntry() );
+ }
+ }
+
+ std::set<std::string>::iterator it;
+ std::set<std::string>::iterator foundIt;
+ TCollection_AsciiString stringIOR;
+ GEOM::GEOM_Object_var geomObj;
+
+ // filling list of sub-objects
+ for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
+ includeSubObjects( theStudy, *it, aSelected, aParents, aChildren, anOthers );
+ }
+
+ // if some selected object is not a main shape,
+ // we move it's main shapes into 'selected' list,
+ // because they could not be modified anyhow.
+ std::set<std::string> aToBeInSelected;
+ for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
+ Handle(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), (*it).c_str(), false);
+ if ( handle_object.IsNull() )
+ continue;
+
+ stringIOR = handle_object->GetIOR();
+ if ( !stringIOR.Length() > 1 )
+ continue;
+
+ geomObj = GetIORFromString( stringIOR.ToCString() );
+ while ( !geomObj->IsMainShape() ) {
+ geomObj = geomObj->GetMainShape();
+ anEntry = geomObj->GetEntry();
+
+ foundIt = aParents.find( anEntry );
+ if ( foundIt != aParents.end() )
+ aParents.erase( foundIt );
+
+ foundIt = aChildren.find( anEntry );
+ if ( foundIt != aChildren.end() )
+ aChildren.erase( foundIt );
+
+ foundIt = anOthers.find( anEntry );
+ if ( foundIt != anOthers.end() )
+ anOthers.erase( foundIt );
+
+ aToBeInSelected.insert( anEntry );
+ }
+ }
+ aSelected.insert( aToBeInSelected.begin(), aToBeInSelected.end() );
+
+ // fill the CORBA arrays with values from sets
+ int i;
+ theSelectedEntries.length( aSelected.size() );
+ for ( i = 0, it = aSelected.begin(); it != aSelected.end(); ++it, i++ )
+ theSelectedEntries[i] = CORBA::string_dup( (*it).c_str() );
+ theParentEntries.length( aParents.size() );
+ for ( i = 0, it = aParents.begin(); it != aParents.end(); ++it, i++ )
+ theParentEntries[i] = CORBA::string_dup( (*it).c_str() );
+ theSubEntries.length( aChildren.size() );
+ for ( i = 0, it = aChildren.begin(); it != aChildren.end(); ++it, i++ )
+ theSubEntries[i] = CORBA::string_dup( (*it).c_str() );
+ theOtherEntries.length( anOthers.size() );
+ for ( i = 0, it = anOthers.begin(); it != anOthers.end(); ++it, i++ )
+ theOtherEntries[i] = CORBA::string_dup( (*it).c_str() );
+ }
+}
+
+//==============================================================================
+// function : includeParentDependencies
+// purpose :
+//==============================================================================
+void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
+ std::set<std::string>& aSelected,
+ std::set<std::string>& aParents,
+ std::set<std::string>& aChildren,
+ std::set<std::string>& anOthers)
+{
+ std::string anEntry = geomObj->GetEntry();
+ if ( aSelected.count( anEntry ) == 0 ) {
+ aParents.insert( anEntry );
+ std::set<std::string>::iterator it;
+ it = aChildren.find( anEntry );
+ if ( it != aChildren.end() )
+ aChildren.erase( it );
+ it = anOthers.find( anEntry );
+ if ( it != anOthers.end() )
+ anOthers.erase( it );
+ }
+ // get dependencies for current object in the tree
+ GEOM::ListOfGBO_var depList = geomObj->GetDependency();
+ if( depList->length() == 0 )
+ return;
+ // go through dependencies of current object to check whether it depends on the given object
+ std::string aDepEntry;
+ for( int i = 0; i < depList->length(); i++ ) {
+ aDepEntry = depList[i]->GetEntry();
+ if ( depList[i]->_is_nil() ||
+ aDepEntry == anEntry || // skip self-depending
+ aSelected.count( aDepEntry ) > 0 || // skip selected objects
+ aParents.count( aDepEntry ) > 0 // skip already processed objects
+ )
+ continue;
+ includeParentDependencies( depList[i], aSelected, aParents, aChildren, anOthers );
+ }
+}
+
+//==============================================================================
+// function : includeSubObjects
+// purpose :
+//==============================================================================
+void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
+ 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(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false);
+ if ( handle_object.IsNull() )
+ return;
+
+ Handle(GEOM_Function) aShapeFun = handle_object->GetFunction(1);
+ if ( aShapeFun.IsNull() || !aShapeFun->HasSubShapeReferences() )
+ return;
+
+ const TDataStd_ListOfExtendedString& aListEntries = aShapeFun->GetSubShapeReferences();
+ if ( aListEntries.IsEmpty() )
+ return;
+
+ TDataStd_ListIteratorOfListOfExtendedString anIt (aListEntries);
+ for ( ; anIt.More(); anIt.Next() ) {
+ TCollection_ExtendedString aSubEntry = anIt.Value();
+ Standard_Integer aStrLen = aSubEntry.LengthOfCString();
+ char* aSubEntryStr = new char[aStrLen+1];
+ aSubEntry.ToUTF8CString( aSubEntryStr );
+ foundIt = aParents.find( aSubEntryStr );
+ if ( foundIt == aParents.end() ) { // add to sub-objects if it is not in parents list
+ foundIt = aSelected.find( aSubEntryStr );
+ if ( foundIt == aSelected.end() ) { // add to sub-objects if it is not in selected list
+ aChildren.insert( aSubEntryStr );
+ foundIt = anOthers.find( aSubEntryStr );
+ if ( foundIt != anOthers.end() )
+ anOthers.erase( foundIt );
+ }
+ }
+ includeSubObjects( theStudy, aSubEntryStr, aSelected, aParents, aChildren, anOthers );
+ }
+}
//=====================================================================================
// EXPORTED METHODS
//=====================================================================================
#include "GEOM_IMeasureOperations_i.hh"
#include "GEOM_IGroupOperations_i.hh"
#include "GEOM_IFieldOperations_i.hh"
+#include "GEOMUtils.hxx"
#include <TopTools_IndexedMapOfShape.hxx>
#include <map>
#include <set>
+#include <list>
#include <string>
//#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
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);
+
//-----------------------------------------------------------------------//
// Transaction methods //
//-----------------------------------------------------------------------//
// SIMAN-related functions (check out/check in) : get modified data
virtual Engines::ListOfData* getModifiedData(CORBA::Long studyId);
+ /*! \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,
+ GEOM::string_array& theParentEntries,
+ GEOM::string_array& theSubEntries,
+ GEOM::string_array& theOtherEntries);
+
//-----------------------------------------------------------------------//
// Internal methods //
//-----------------------------------------------------------------------//
const Standard_CString& GrName,
GEOM::ListOfGO_var aResList);
+ void getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+ GEOMUtils::LevelsList &upLevelList,
+ std::map< std::string, std::set<std::string> > &passedEntries,
+ int level = 0 );
+
+ void getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+ GEOMUtils::LevelsList &downLevelList,
+ std::map< std::string, std::set<std::string> > &passedEntries,
+ int level = 0 );
+
+ void includeParentDependencies(GEOM::GEOM_BaseObject_ptr gbo,
+ std::set<std::string>& aSelected,
+ std::set<std::string>& aParents,
+ std::set<std::string>& aChildren,
+ std::set<std::string>& anOthers);
+
+ void includeSubObjects(SALOMEDS::Study_ptr theStudy,
+ const std::string& aSelectedEntry,
+ std::set<std::string>& aSelected,
+ std::set<std::string>& aParents,
+ std::set<std::string>& aChildren,
+ std::set<std::string>& anOthers);
+
+ void LoadPlugin(const std::string& theLibName);
+
private:
::GEOMImpl_Gen* _impl;
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeCylinderRHA
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderRHA (CORBA::Double theR,
+ CORBA::Double theH,
+ CORBA::Double theA)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Create the Cylinder
+ Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderRHA(theR, theH, theA);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakeCylinderPntVecRH
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeCylinderPntVecRHA
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeCylinderPntVecRHA
+ (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theR, CORBA::Double theH, CORBA::Double theA)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference points
+ Handle(GEOM_Object) aPnt = GetObjectImpl(thePnt);
+ Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
+
+ if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
+
+ //Create the Cylinder
+ Handle(GEOM_Object) anObject = GetOperations()->MakeCylinderPntVecRHA(aPnt, aVec, theR, theH, theA);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakeConeR1R2H
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theR,
CORBA::Double theH);
+
+ GEOM::GEOM_Object_ptr MakeCylinderRHA (CORBA::Double theR,
+ CORBA::Double theH,
+ CORBA::Double theA);
+
+ GEOM::GEOM_Object_ptr MakeCylinderPntVecRHA (GEOM::GEOM_Object_ptr thePnt,
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theR,
+ CORBA::Double theH,
+ CORBA::Double theA);
GEOM::GEOM_Object_ptr MakeConeR1R2H (CORBA::Double theR1,
CORBA::Double theR2,
#include "GEOM_Engine.hxx"
#include "GEOM_Object.hxx"
+#include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+
//=============================================================================
/*!
* constructor:
return GetObject(anObject);
}
+
+//=============================================================================
+/*!
+ * MakePolyline2D
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline2D
+ (const GEOM::ListOfListOfDouble &theCoordsList,
+ const GEOM::string_array &theNamesList,
+ const GEOM::short_array &theTypesList,
+ const GEOM::ListOfBool &theClosedList,
+ const GEOM::ListOfDouble &theWorkingPlane)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Convert input data
+ Handle(TColStd_HArray1OfExtendedString) aNames =
+ ConvertStringArray(theNamesList);
+ Handle(TColStd_HArray1OfByte) aTypes =
+ ConvertEnumArray(theTypesList);
+ Handle(TColStd_HArray1OfByte) aCloseds =
+ ConvertBoolArray(theClosedList);
+ std::list <std::list <double> > aCoords;
+
+ ConvertListListDouble(theCoordsList, aCoords);
+
+ Handle(TColStd_HArray1OfReal) aWorkingPlane;
+ const int n = theWorkingPlane.length();
+ int i;
+
+ if (n > 0) {
+ aWorkingPlane = new TColStd_HArray1OfReal(1, n);
+
+ for (i = 0; i < n; i++) {
+ aWorkingPlane->SetValue(i + 1, theWorkingPlane[i]);
+ }
+ }
+
+ // Make Polyline
+ Handle(GEOM_Object) anObject = GetOperations()->MakePolyline2D
+ (aCoords, aNames, aTypes, aCloseds, aWorkingPlane);
+
+ if (!GetOperations()->IsDone() || anObject.IsNull()) {
+ return GEOM::GEOM_Object::_nil();
+ }
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * MakePolylineOnPlane
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakePolyline2DOnPlane
+ (const GEOM::ListOfListOfDouble &theCoordsList,
+ const GEOM::string_array &theNamesList,
+ const GEOM::short_array &theTypesList,
+ const GEOM::ListOfBool &theClosedList,
+ GEOM::GEOM_Object_ptr theWorkingPlane)
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Convert input data
+ Handle(TColStd_HArray1OfExtendedString) aNames =
+ ConvertStringArray(theNamesList);
+ Handle(TColStd_HArray1OfByte) aTypes =
+ ConvertEnumArray(theTypesList);
+ Handle(TColStd_HArray1OfByte) aCloseds =
+ ConvertBoolArray(theClosedList);
+ std::list <std::list <double> > aCoords;
+ Handle(GEOM_Object) aWorkingPlane =
+ GetObjectImpl(theWorkingPlane);
+
+ ConvertListListDouble(theCoordsList, aCoords);
+
+ // Make Polyline
+ Handle(GEOM_Object) anObject = GetOperations()->MakePolyline2DOnPlane
+ (aCoords, aNames, aTypes, aCloseds, aWorkingPlane);
+
+ if (!GetOperations()->IsDone() || anObject.IsNull()) {
+ return GEOM::GEOM_Object::_nil();
+ }
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * ConvertEnumArray
+ */
+//=============================================================================
+Handle(TColStd_HArray1OfByte) GEOM_ICurvesOperations_i::ConvertEnumArray
+ (const GEOM::short_array &theInArray)
+{
+ Handle(TColStd_HArray1OfByte) anOutArray;
+ const int n = theInArray.length();
+ int i;
+
+ if (n <= 0) {
+ return anOutArray;
+ }
+
+ anOutArray = new TColStd_HArray1OfByte(1, n);
+
+ for (i = 0; i < n; i++) {
+ bool isOK = true;
+ GEOMImpl_ICurvesOperations::CurveType aType;
+
+ switch(theInArray[i]) {
+ case GEOM::Polyline:
+ aType = GEOMImpl_ICurvesOperations::Polyline;
+ break;
+ case GEOM::Bezier:
+ aType = GEOMImpl_ICurvesOperations::Bezier;
+ break;
+ case GEOM::Interpolation:
+ aType = GEOMImpl_ICurvesOperations::Interpolation;
+ break;
+ default:
+ isOK = false;
+ break;
+ }
+
+ if (isOK) {
+ anOutArray->SetValue(i + 1, aType);
+ } else {
+ anOutArray.Nullify();
+ break;
+ }
+ }
+
+ return anOutArray;
+}
+
+//=============================================================================
+/*!
+ * ConvertBoolArray
+ */
+//=============================================================================
+Handle(TColStd_HArray1OfByte) GEOM_ICurvesOperations_i::ConvertBoolArray
+ (const GEOM::ListOfBool &theInArray)
+{
+ Handle(TColStd_HArray1OfByte) anOutArray;
+ const int n = theInArray.length();
+ int i;
+
+ if (n <= 0) {
+ return anOutArray;
+ }
+
+ anOutArray = new TColStd_HArray1OfByte(1, n);
+
+ for (i = 0; i < n; i++) {
+ anOutArray->SetValue(i + 1, theInArray[i]);
+ }
+
+ return anOutArray;
+}
+
+//=============================================================================
+/*!
+ * ConvertListListDouble
+ */
+//=============================================================================
+void GEOM_ICurvesOperations_i::ConvertListListDouble
+ (const GEOM::ListOfListOfDouble &theInList,
+ std::list <std::list <double> > &theOutList)
+{
+ const int n = theInList.length();
+ int i;
+ std::list <double> anEmptyList;
+
+ for (i = 0; i < n; i++) {
+ theOutList.push_back(anEmptyList);
+
+ const int m = theInList[i].length();
+ int j;
+
+ for (j = 0; j < m; j++) {
+ theOutList.back().push_back(theInList[i][j]);
+ }
+ }
+}
GEOM::GEOM_Object_ptr Make3DSketcher (const GEOM::ListOfDouble& theCoordinates);
+ GEOM::GEOM_Object_ptr MakePolyline2D
+ (const GEOM::ListOfListOfDouble &theCoordsList,
+ const GEOM::string_array &theNamesList,
+ const GEOM::short_array &theTypesList,
+ const GEOM::ListOfBool &theClosedList,
+ const GEOM::ListOfDouble &theWorkingPlane);
+
+ GEOM::GEOM_Object_ptr MakePolyline2DOnPlane
+ (const GEOM::ListOfListOfDouble &theCoordsList,
+ const GEOM::string_array &theNamesList,
+ const GEOM::short_array &theTypesList,
+ const GEOM::ListOfBool &theClosedList,
+ GEOM::GEOM_Object_ptr theWorkingPlane);
+
::GEOMImpl_ICurvesOperations* GetOperations()
{ return (::GEOMImpl_ICurvesOperations*)GetImpl(); }
+
+private:
+
+ Handle(TColStd_HArray1OfByte)
+ ConvertEnumArray(const GEOM::short_array &theInArray);
+
+ Handle(TColStd_HArray1OfByte)
+ ConvertBoolArray(const GEOM::ListOfBool &theInArray);
+
+ void ConvertListListDouble
+ (const GEOM::ListOfListOfDouble &theCoordsList,
+ std::list <std::list <double> > &theCoords);
+
};
#endif
return anOutArray;
}
-//=============================================================================
-/*!
- * Convert
- */
-//=============================================================================
-Handle(TColStd_HArray1OfExtendedString) GEOM_IHealingOperations_i::Convert
- (const GEOM::string_array& theInArray)
-{
- Handle(TColStd_HArray1OfExtendedString) anOutArray;
- int n = theInArray.length();
- if ( n <= 0 )
- return anOutArray;
- anOutArray = new TColStd_HArray1OfExtendedString( 1, n );
- for ( int i = 0; i < n; i++ )
- anOutArray->SetValue( i+1, TCollection_ExtendedString( theInArray[i].in() ) );
-
- return anOutArray;
-}
-
//=============================================================================
/*!
* ProcessShape
// Perform
Handle(GEOM_Object) aNewObject = GetOperations()->ShapeProcess( anObject,
- Convert( theOperations ), Convert( theParams ), Convert( theValues ) );
+ ConvertStringArray( theOperations ), ConvertStringArray( theParams ),
+ ConvertStringArray( theValues ) );
if ( !GetOperations()->IsDone() || aNewObject.IsNull() )
return aGEOMObject._retn();
#include "GEOMImpl_IHealingOperations.hxx"
-#include <TColStd_HArray1OfExtendedString.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
-
class GEOM_I_EXPORT GEOM_IHealingOperations_i :
public virtual POA_GEOM::GEOM_IHealingOperations,
public virtual GEOM_IOperations_i
::GEOMImpl_IHealingOperations* GetOperations() { return (::GEOMImpl_IHealingOperations*)GetImpl(); }
private:
- Handle(TColStd_HArray1OfExtendedString) Convert( const GEOM::string_array& );
Handle(TColStd_HArray1OfInteger) Convert( const GEOM::short_array& );
};
#include "Utils_ExceptHandlers.hxx"
#include "GEOM_Engine.hxx"
-#include "GEOM_Object.hxx"
+#include "GEOM_BaseObject.hxx"
#include <Basics_OCCTVersion.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <TColStd_HArray1OfByte.hxx>
-#else
-#include <TDataStd_HArray1OfByte.hxx>
-#endif
//=============================================================================
/*!
if (anOriginal.IsNull()) return;
//Export the shape to the file
- char* aFileName = strdup(theFileName);
- char* aFormatName = strdup(theFormatName);
- GetOperations()->Export(anOriginal, aFileName, aFormatName);
- free(aFileName);
- free(aFormatName);
+ GetOperations()->Export(anOriginal, theFileName, theFormatName);
}
//=============================================================================
* ImportFile
*/
//=============================================================================
-GEOM::ListOfGO* GEOM_IInsertOperations_i::ImportFile
+GEOM::ListOfGBO* GEOM_IInsertOperations_i::ImportFile
(const char* theFileName,
const char* theFormatName)
{
- GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+ GEOM::ListOfGBO_var aSeq = new GEOM::ListOfGBO;
//Set a not done flag
GetOperations()->SetNotDone();
//Import the shape from the file
- char* aFileName = strdup(theFileName);
- char* aFormatName = strdup(theFormatName);
- Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->Import(aFileName, aFormatName);
-
- if( strcmp(aFormatName,"IGES_UNIT")==0 && !aHSeq.IsNull() ) {
- free(aFileName);
- free(aFormatName);
- return aSeq._retn();
- }
-
- free(aFileName);
- free(aFormatName);
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->Import(theFileName, theFormatName);
if (!GetOperations()->IsDone() || aHSeq.IsNull()) {
return aSeq._retn();
Standard_Integer aLength = aHSeq->Length();
aSeq->length(aLength);
-
- for (Standard_Integer i = 1; i <= aLength; i++) {
- aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
- }
+ for (Standard_Integer i = 1; i <= aLength; i++)
+ aSeq[i-1] = GetBaseObject(Handle(GEOM_BaseObject)::DownCast(aHSeq->Value(i)));
return aSeq._retn();
}
//Set a not done flag
GetOperations()->SetNotDone();
- char* aFileName = strdup(theFileName);
- char* aFormatName = strdup(theFormatName);
- char* aParameterName = strdup(theParameterName);
-
TCollection_AsciiString aUnits = GetOperations()->ReadValue
- (aFileName, aFormatName, aParameterName);
-
- free(aFileName);
- free(aFormatName);
- free(aParameterName);
+ (theFileName, theFormatName, theParameterName);
return CORBA::string_dup(aUnits.ToCString());
}
-//=============================================================================
-/*!
- * ImportTranslators
- */
-//=============================================================================
-void GEOM_IInsertOperations_i::ImportTranslators
- (GEOM::string_array_out theFormats, GEOM::string_array_out thePatterns)
-{
- // allocate the CORBA arrays
- GEOM::string_array_var aFormatsArray = new GEOM::string_array();
- GEOM::string_array_var aPatternsArray = new GEOM::string_array();
-
- // Get sequences of available formats
- Handle(TColStd_HSequenceOfAsciiString) aFormats = new TColStd_HSequenceOfAsciiString;
- Handle(TColStd_HSequenceOfAsciiString) aPatterns = new TColStd_HSequenceOfAsciiString;
- if (GetOperations()->ImportTranslators(aFormats, aPatterns)) {
- const int formSize = aFormats->Length();
- if (formSize == aPatterns->Length()) {
- aFormatsArray->length(formSize);
- aPatternsArray->length(formSize);
-
- // fill the local CORBA arrays with values from sequences
- CORBA::Long i = 1;
- for (; i <= formSize; i++) {
- aFormatsArray[i-1] = CORBA::string_dup(aFormats->Value(i).ToCString());
- aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
- }
- }
- }
-
- // initialize out-parameters with local arrays
- theFormats = aFormatsArray._retn();
- thePatterns = aPatternsArray._retn();
-}
-
-//=============================================================================
-/*!
- * ExportTranslators
- */
-//=============================================================================
-void GEOM_IInsertOperations_i::ExportTranslators
- (GEOM::string_array_out theFormats, GEOM::string_array_out thePatterns)
-{
- // allocate the CORBA arrays
- GEOM::string_array_var aFormatsArray = new GEOM::string_array();
- GEOM::string_array_var aPatternsArray = new GEOM::string_array();
-
- // Get sequences of available formats
- Handle(TColStd_HSequenceOfAsciiString) aFormats = new TColStd_HSequenceOfAsciiString;
- Handle(TColStd_HSequenceOfAsciiString) aPatterns = new TColStd_HSequenceOfAsciiString;
- if (GetOperations()->ExportTranslators(aFormats, aPatterns)) {
- const int formSize = aFormats->Length();
- if (formSize == aPatterns->Length()) {
- aFormatsArray->length(formSize);
- aPatternsArray->length(formSize);
-
- // fill the local CORBA arrays with values from sequences
- CORBA::Long i = 1;
- for (; i <= formSize; i++) {
- aFormatsArray[i-1] = CORBA::string_dup(aFormats->Value(i).ToCString());
- aPatternsArray[i-1] = CORBA::string_dup(aPatterns->Value(i).ToCString());
- }
- }
- }
-
- // initialize out-parameters with local arrays
- theFormats = aFormatsArray._retn();
- thePatterns = aPatternsArray._retn();
-}
-
//=============================================================================
/*!
* RestoreShape
{
GetOperations()->SetNotDone();
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTexture;
-#else
- Handle(TDataStd_HArray1OfByte) aTexture;
-#endif
if ( theTexture.length() > 0 ) {
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
aTexture = new TColStd_HArray1OfByte (1, theTexture.length());
-#else
- aTexture = new TDataStd_HArray1OfByte (1, theTexture.length());
-#endif
for ( int i = 0; i < theTexture.length(); i++ )
aTexture->SetValue( i+1, (Standard_Byte)theTexture[i] );
CORBA::Long& theHeight)
{
int aWidth, aHeight;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
Handle(TColStd_HArray1OfByte) aTextureImpl =
-#else
- Handle(TDataStd_HArray1OfByte) aTextureImpl =
-#endif
GetOperations()->GetTexture(theID, aWidth, aHeight);
theWidth = aWidth;
theHeight = aHeight;
return anIDs._retn();
}
-//=============================================================================
-/*!
- * Export a shape to XAO format
- * \param shape The shape to export
- * \param groups The list of groups to export
- * \param fields The list of fields to export
- * \param author The author of the export
- * \param fileName The name of the exported file
- * \return boolean indicating if export was succeful.
- */
-//=============================================================================
-CORBA::Boolean GEOM_IInsertOperations_i::ExportXAO(GEOM::GEOM_Object_ptr shape,
- const GEOM::ListOfGO& groups,
- const GEOM::ListOfFields& fields,
- const char* author,
- const char* fileName)
-{
- bool isGood = false;
- // Set a not done flag
- GetOperations()->SetNotDone();
-
- // Get the reference shape
- Handle(GEOM_Object) reference = GetObjectImpl(shape);
-
- // Get the reference groups
- int ind = 0;
- std::list<Handle(GEOM_Object)> groupsObj;
- for (; ind < groups.length(); ind++)
- {
- Handle(GEOM_Object) gobj = GetObjectImpl(groups[ind]);
- if (gobj.IsNull()) return false;
- groupsObj.push_back(gobj);
- }
- // Get the reference fields
- ind = 0;
- std::list<Handle(GEOM_Field)> fieldsObj;
- for (; ind < fields.length(); ind++)
- {
- Handle(GEOM_Field) fobj = Handle(GEOM_Field)::DownCast(GetBaseObjectImpl(fields[ind]));
- if (fobj.IsNull()) return false;
- fieldsObj.push_back(fobj);
- }
-
- if (!reference.IsNull())
- {
- // Export XAO
- isGood = GetOperations()->ExportXAO(reference, groupsObj, fieldsObj, author, fileName);
- }
-
- return isGood;
-}
-
-//=============================================================================
-/*!
- * Import a shape from XAO format
- * \param fileName The name of the file to import
- * \param shape The imported shape
- * \param subShapes The list of imported subShapes
- * \param groups The list of imported groups
- * \param fields The list of imported fields
- * \return boolean indicating if import was succeful.
- */
-//=============================================================================
-CORBA::Boolean GEOM_IInsertOperations_i::ImportXAO(const char* fileName,
- GEOM::GEOM_Object_out shape,
- GEOM::ListOfGO_out subShapes,
- GEOM::ListOfGO_out groups,
- GEOM::ListOfFields_out fields)
-{
- GEOM::GEOM_Object_var vshape;
- shape = vshape._retn();
-
- subShapes = new GEOM::ListOfGO;
- groups = new GEOM::ListOfGO;
- fields = new GEOM::ListOfFields;
-
- // Set a not done flag
- GetOperations()->SetNotDone();
-
- Handle(TColStd_HSequenceOfTransient) importedSubShapes = new TColStd_HSequenceOfTransient();
- Handle(TColStd_HSequenceOfTransient) importedGroups = new TColStd_HSequenceOfTransient();
- Handle(TColStd_HSequenceOfTransient) importedFields = new TColStd_HSequenceOfTransient();
- Handle(GEOM_Object) hshape;
- bool res = GetOperations()->ImportXAO(fileName, hshape, importedSubShapes, importedGroups, importedFields);
-
- if (!GetOperations()->IsDone() || !res)
- return false;
-
- // parse fields
- int n = importedSubShapes->Length();
- subShapes->length(n);
- for (int i = 1; i <= n; i++)
- {
- (*subShapes)[i - 1] = GetObject(Handle(GEOM_Object)::DownCast(importedSubShapes->Value(i)));
- }
-
- // parse groups
- n = importedGroups->Length();
- groups->length(n);
- for (int i = 1; i <= n; i++)
- {
- (*groups)[i - 1] = GetObject(Handle(GEOM_Object)::DownCast(importedGroups->Value(i)));
- }
-
- // parse fields
- n = importedFields->Length();
- fields->length(n);
- for (int i = 1; i <= n; i++)
- {
- (*fields)[i - 1] = GEOM::GEOM_Field::_narrow(
- GetBaseObject(Handle(GEOM_Field)::DownCast(importedFields->Value(i))));
- }
-
- shape = GetObject(hshape);
-
- return res;
-}
const char* theFileName,
const char* theFormatName);
- GEOM::ListOfGO* ImportFile (const char* theFileName,
- const char* theFormatName);
+ GEOM::ListOfGBO* ImportFile (const char* theFileName,
+ const char* theFormatName);
char* ReadValue (const char* theFileName,
const char* theFormatName,
const char* theParameterName);
- void ImportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
-
- void ExportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
-
GEOM::GEOM_Object_ptr RestoreShape (const SALOMEDS::TMPFile& theStream);
CORBA::Long LoadTexture(const char* theTextureFile);
GEOM::ListOfLong* GetAllTextures();
- CORBA::Boolean ExportXAO (GEOM::GEOM_Object_ptr shape,
- const GEOM::ListOfGO& groups,
- const GEOM::ListOfFields& fields,
- const char* author,
- const char* fileName);
-
- CORBA::Boolean ImportXAO (const char* fileName,
- GEOM::GEOM_Object_out shape,
- GEOM::ListOfGO_out subShapes,
- GEOM::ListOfGO_out groups,
- GEOM::ListOfFields_out fields);
-
::GEOMImpl_IInsertOperations* GetOperations()
{ return (::GEOMImpl_IInsertOperations*)GetImpl(); }
};
}
}
}
+
+//=============================================================================
+/*!
+ * ConvertStringArray
+ */
+//=============================================================================
+Handle(TColStd_HArray1OfExtendedString) GEOM_IOperations_i::ConvertStringArray
+ (const GEOM::string_array &theInArray)
+{
+ Handle(TColStd_HArray1OfExtendedString) anOutArray;
+ const int n = theInArray.length();
+ int i;
+
+ if (n <= 0) {
+ return anOutArray;
+ }
+
+ anOutArray = new TColStd_HArray1OfExtendedString( 1, n );
+
+ for (i = 0; i < n; i++) {
+ anOutArray->SetValue(i + 1, TCollection_ExtendedString(theInArray[i].in()));
+ }
+
+ return anOutArray;
+}
virtual GEOM::GEOM_Object_ptr GetObject(Handle(GEOM_Object) theObject);
virtual Handle(GEOM_Object) GetObjectImpl(GEOM::GEOM_Object_ptr theObject);
- virtual Handle(TColStd_HSequenceOfTransient)
- GetListOfObjectsImpl(const GEOM::ListOfGO& theObjects);
-
virtual void StartOperation();
virtual void FinishOperation();
virtual void UpdateGUIForObject(GEOM::GEOM_Object_ptr theObj);
+protected:
+
+ Handle(TColStd_HSequenceOfTransient)
+ GetListOfObjectsImpl(const GEOM::ListOfGO& theObjects);
+
+ Handle(TColStd_HArray1OfExtendedString)
+ ConvertStringArray(const GEOM::string_array &theInArray);
+
private:
::GEOM_IOperations* _impl;
class GEOM_IInsertOperations;
class GEOM_IMeasureOperations;
class GEOM_IGroupOperations;
- class GEOM_IAdvancedOperations;
class GEOM_IFieldOperations;
typedef SALOME::GenericObj_wrap< GEOM_IBasicOperations > GEOM_IBasicOperations_wrap;
typedef SALOME::GenericObj_wrap< GEOM_ITransformOperations> GEOM_ITransformOperations_wrap;
typedef SALOME::GenericObj_wrap< GEOM_IInsertOperations > GEOM_IInsertOperations_wrap;
typedef SALOME::GenericObj_wrap< GEOM_IMeasureOperations > GEOM_IMeasureOperations_wrap;
typedef SALOME::GenericObj_wrap< GEOM_IGroupOperations > GEOM_IGroupOperations_wrap;
- typedef SALOME::GenericObj_wrap< GEOM_IAdvancedOperations > GEOM_IAdvancedOperations_wrap;
typedef SALOME::GenericObj_wrap< GEOM_IFieldOperations > GEOM_IFieldOperations_wrap;
}
# libraries to link to
SET(_link_LIBRARIES
SalomeIDLGEOM
+ SalomeIDLGEOMSuperv
+ SalomeIDLAdvancedGEOM
+ SalomeIDLBREPPlugin
+ SalomeIDLIGESPlugin
+ SalomeIDLSTEPPlugin
+ SalomeIDLSTLPlugin
+ SalomeIDLVTKPlugin
+ SalomeIDLXAOPlugin
${KERNEL_SALOMELocalTrace}
${KERNEL_SalomeDSClient}
${KERNEL_SalomeLifeCycleCORBA}
{
if (CORBA::is_nil(myGeomEngine))
setGeomEngine();
- // get GEOM_IAdvancedOperations interface
+ // 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 = myGeomEngine->GetIAdvancedOperations(myStudyID);
- myAdvancedOp = GEOM::GEOM_IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "AdvancedEngine"));
+ myAdvancedOp = GEOM::IAdvancedOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "AdvancedEngine"));
+ }
+}
+
+//=============================================================================
+// getSTLPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getSTLPluginOp()
+{
+ 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"));
+ }
+}
+
+//=============================================================================
+// getBREPPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getBREPPluginOp()
+{
+ 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"));
+ }
+}
+
+//=============================================================================
+// getSTEPPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getSTEPPluginOp()
+{
+ 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"));
+ }
+}
+
+//=============================================================================
+// getIGESPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getIGESPluginOp()
+{
+ 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"));
+ }
+}
+
+//=============================================================================
+// getXAOPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getXAOPluginOp()
+{
+ 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"));
+ }
+}
+
+//=============================================================================
+// getVTKPluginOp:
+//=============================================================================
+void GEOM_Superv_i::getVTKPluginOp()
+{
+ 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"));
}
}
return anObj;
}
+//=============================================================================
+// MakeCylinderPntVecRHA:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderPntVecRHA (GEOM::GEOM_Object_ptr thePnt,
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theRadius,
+ CORBA::Double theHeight,
+ CORBA::Double theAngle)
+{
+ beginService( " GEOM_Superv_i::MakeCylinderPntVecRHA" );
+ MESSAGE("GEOM_Superv_i::MakeCylinderPntVecRHA");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderPntVecRHA(thePnt, theAxis, theRadius, theHeight, theAngle);
+ endService( " GEOM_Superv_i::MakeCylinderPntVecRHA" );
+ return anObj;
+}
+
+//=============================================================================
+// MakeCylinderRHA:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCylinderRHA (CORBA::Double theR,
+ CORBA::Double theH,
+ CORBA::Double theA)
+{
+ beginService( " GEOM_Superv_i::MakeCylinderRHA" );
+ MESSAGE("GEOM_Superv_i::MakeCylinderRHA");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeCylinderRHA(theR, theH, theA);
+ endService( " GEOM_Superv_i::MakeCylinderRHA" );
+ return anObj;
+}
+
//=============================================================================
// MakeSphere:
//=============================================================================
beginService( " GEOM_Superv_i::ImportFile" );
MESSAGE("GEOM_Superv_i::ImportFile");
getInsOp();
- GEOM::ListOfGO* aSeq = myInsOp->ImportFile(theFileName, theFormatName);
- GEOM::GEOM_Object_ptr anObj;
+ GEOM::ListOfGBO_var aSeq = myInsOp->ImportFile(theFileName, theFormatName);
+ GEOM::GEOM_Object_var anObj;
if (aSeq->length() > 0) {
- anObj = aSeq->operator[](0);
+ anObj = GEOM::GEOM_Object::_narrow(aSeq[0]);
}
endService( " GEOM_Superv_i::ImportFile" );
- return anObj;
-}
-
-//=============================================================================
-// ImportTranslators:
-//=============================================================================
-void GEOM_Superv_i::ImportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns)
-{
- beginService( " GEOM_Superv_i::ImportTranslators" );
- MESSAGE("GEOM_Superv_i::ImportTranslators");
- getInsOp();
- myInsOp->ImportTranslators(theFormats, thePatterns);
- endService( " GEOM_Superv_i::ImportTranslators" );
-}
-
-//=============================================================================
-// ExportTranslators:
-//=============================================================================
-void GEOM_Superv_i::ExportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns)
-{
- beginService( " GEOM_Superv_i::ExportTranslators" );
- MESSAGE("GEOM_Superv_i::ExportTranslators");
- getInsOp();
- myInsOp->ExportTranslators(theFormats, thePatterns);
- endService( " GEOM_Superv_i::ExportTranslators" );
+ return anObj._retn();
}
//============================= TransformOperations ===========================
return aListPtr->_this();
}
+//=============================== Import/Export Operations =============================
+//=============================================================================
+// Export STL
+//=============================================================================
+void GEOM_Superv_i::ExportSTL( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ const bool theIsASCII,
+ CORBA::Double theDeflection,
+ const bool theIsRelative )
+{
+ beginService( " GEOM_Superv_i::ExportSTL" );
+ MESSAGE("GEOM_Superv_i::ExportSTL");
+ getSTLPluginOp();
+ mySTLOp->ExportSTL( theObject, theFileName, theIsASCII, theDeflection, theIsRelative );
+ endService( " GEOM_Superv_i::ExportSTL" );
+}
+
+//=============================================================================
+// Import STL
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportSTL( const char* theFileName )
+{
+ beginService( " GEOM_Superv_i::ImportSTL" );
+ MESSAGE("GEOM_Superv_i::ImportSTL");
+ getSTLPluginOp();
+ GEOM::ListOfGO* aSeq = mySTLOp->ImportSTL(theFileName );
+ GEOM::GEOM_Object_ptr anObj;
+
+ if (aSeq->length() > 0) {
+ anObj = aSeq->operator[](0);
+ }
+
+ endService( " GEOM_Superv_i::ImportSTL" );
+ return anObj;
+}
+
+//=============================================================================
+// Export BREP
+//=============================================================================
+void GEOM_Superv_i::ExportBREP( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName )
+{
+ beginService( " GEOM_Superv_i::ExportBREP" );
+ MESSAGE("GEOM_Superv_i::ExportBREP");
+ getBREPPluginOp();
+ myBREPOp->ExportBREP( theObject, theFileName );
+ endService( " GEOM_Superv_i::ExportBREP" );
+}
+
+//=============================================================================
+// Import BREP
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportBREP( const char* theFileName )
+{
+ beginService( " GEOM_Superv_i::ImportBREP" );
+ MESSAGE("GEOM_Superv_i::ImportBREP");
+ getBREPPluginOp();
+ GEOM::ListOfGO* aSeq = myBREPOp->ImportBREP(theFileName );
+ GEOM::GEOM_Object_ptr anObj;
+
+ if (aSeq->length() > 0) {
+ anObj = aSeq->operator[](0);
+ }
+
+ endService( " GEOM_Superv_i::ImportBREP" );
+ return anObj;
+}
+
+//=============================================================================
+// Export STEP
+//=============================================================================
+void GEOM_Superv_i::ExportSTEP( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName )
+{
+ beginService( " GEOM_Superv_i::ExportSTEP" );
+ MESSAGE("GEOM_Superv_i::ExportSTEP");
+ getSTEPPluginOp();
+ mySTEPOp->ExportSTEP( theObject, theFileName );
+ endService( " GEOM_Superv_i::ExportSTEP" );
+}
+
+//=============================================================================
+// Import STEP
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportSTEP( const char* theFileName,
+ const bool theIsIgnoreUnits )
+{
+ beginService( " GEOM_Superv_i::ImportSTEP" );
+ MESSAGE("GEOM_Superv_i::ImportSTEP");
+ getSTEPPluginOp();
+ GEOM::ListOfGO* aSeq = mySTEPOp->ImportSTEP(theFileName, theIsIgnoreUnits );
+ GEOM::GEOM_Object_ptr anObj;
+
+ if (aSeq->length() > 0) {
+ anObj = aSeq->operator[](0);
+ }
+
+ endService( " GEOM_Superv_i::ImportSTEP" );
+ return anObj;
+}
+
+//=============================================================================
+// Export IGES
+//=============================================================================
+void GEOM_Superv_i::ExportIGES( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ const char* theVersion )
+{
+ beginService( " GEOM_Superv_i::ExportIGES" );
+ MESSAGE("GEOM_Superv_i::ExportIGES");
+ getIGESPluginOp();
+ myIGESOp->ExportIGES( theObject, theFileName, theVersion );
+ endService( " GEOM_Superv_i::ExportIGES" );
+}
+
//=============================================================================
-// ExportXAO
+// Import IGES
//=============================================================================
-CORBA::Boolean GEOM_Superv_i::ExportXAO (GEOM::GEOM_Object_ptr shape,
- const GEOM::ListOfGO& groups, const GEOM::ListOfFields& fields,
- const char* author, const char* fileName)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::ImportIGES( const char* theFileName,
+ const bool theIsIgnoreUnits )
+{
+ beginService( " GEOM_Superv_i::ImportIGES" );
+ MESSAGE("GEOM_Superv_i::ImportIGES");
+ getIGESPluginOp();
+ GEOM::ListOfGO* aSeq = myIGESOp->ImportIGES(theFileName, theIsIgnoreUnits );
+ GEOM::GEOM_Object_ptr anObj;
+
+ if (aSeq->length() > 0) {
+ anObj = aSeq->operator[](0);
+ }
+
+ endService( " GEOM_Superv_i::ImportIGES" );
+ return anObj;
+}
+
+//=============================================================================
+// Export XAO
+//=============================================================================
+CORBA::Boolean GEOM_Superv_i::ExportXAO( GEOM::GEOM_Object_ptr shape,
+ const GEOM::ListOfGO& groups,
+ const GEOM::ListOfFields& fields,
+ const char* author, const char* fileName )
{
beginService( " GEOM_Superv_i::ExportXAO" );
MESSAGE("GEOM_Superv_i::ExportXAO");
- getInsOp();
- CORBA::Boolean isGood = myInsOp->ExportXAO(shape, groups, fields, author, fileName);
+ getXAOPluginOp();
+ CORBA::Boolean isGood = myXAOOp->ExportXAO( shape, groups, fields, author, fileName );
endService( " GEOM_Superv_i::ExportXAO" );
return isGood;
}
//=============================================================================
-// ImportXAO
+// Import XAO
//=============================================================================
-CORBA::Boolean GEOM_Superv_i::ImportXAO (const char* fileName, GEOM::GEOM_Object_out shape,
- GEOM::ListOfGO_out subShapes, GEOM::ListOfGO_out groups, GEOM::ListOfFields_out fields)
+CORBA::Boolean GEOM_Superv_i::ImportXAO( const char* fileName,
+ GEOM::GEOM_Object_out shape,
+ GEOM::ListOfGO_out subShapes,
+ GEOM::ListOfGO_out groups,
+ GEOM::ListOfFields_out fields )
{
return false;
}
+//=============================================================================
+// Export VTK
+//=============================================================================
+void GEOM_Superv_i::ExportVTK( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ CORBA::Double theDeflection )
+{
+ beginService( " GEOM_Superv_i::ExportVTK" );
+ MESSAGE("GEOM_Superv_i::ExportVTK");
+ getVTKPluginOp();
+ myVTKOp->ExportVTK( theObject, theFileName, theDeflection );
+ endService( " GEOM_Superv_i::ExportVTK" );
+}
+
//=============================== Advanced Operations =============================
//=============================================================================
// MakePipeTShape
// IDL headers
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(GEOM_Gen)
+#include CORBA_CLIENT_HEADER(AdvancedGEOM)
+#include CORBA_CLIENT_HEADER(STLPlugin)
+#include CORBA_CLIENT_HEADER(BREPPlugin)
+#include CORBA_CLIENT_HEADER(STEPPlugin)
+#include CORBA_CLIENT_HEADER(IGESPlugin)
+#include CORBA_CLIENT_HEADER(XAOPlugin)
+#include CORBA_CLIENT_HEADER(VTKPlugin)
#include CORBA_SERVER_HEADER(GEOM_Superv)
#include "SALOME_Component_i.hxx"
void getLocalOp();
void getGroupOp();
void getAdvancedOp();
+ void getSTLPluginOp();
+ void getBREPPluginOp();
+ void getSTEPPluginOp();
+ void getIGESPluginOp();
+ void getXAOPluginOp();
+ void getVTKPluginOp();
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
PortableServer::POA_ptr thePOA);
CORBA::Double theHeight);
GEOM::GEOM_Object_ptr MakeCylinderRH (CORBA::Double theR,
CORBA::Double theH);
+ GEOM::GEOM_Object_ptr MakeCylinderPntVecRHA (GEOM::GEOM_Object_ptr thePnt,
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theRadius,
+ CORBA::Double theHeight,
+ CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr MakeCylinderRHA (CORBA::Double theR,
+ CORBA::Double theH,
+ CORBA::Double theA);
GEOM::GEOM_Object_ptr MakeSphere (CORBA::Double theX,
CORBA::Double theY,
CORBA::Double theZ,
const char* theFormatName);
GEOM::GEOM_Object_ptr ImportFile (const char* theFileName,
const char* theFormatName);
- void ImportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
- void ExportTranslators (GEOM::string_array_out theFormats,
- GEOM::string_array_out thePatterns);
//-----------------------------------------------------------//
// TransformOperations //
//-----------------------------------------------------------//
// ImportExport Operations //
//-----------------------------------------------------------//
- CORBA::Boolean ExportXAO(GEOM::GEOM_Object_ptr shape,
- const GEOM::ListOfGO& groups, const GEOM::ListOfFields& fields,
- const char* author, const char* fileName);
- CORBA::Boolean ImportXAO(const char* fileName, GEOM::GEOM_Object_out shape,
- GEOM::ListOfGO_out subShapes, GEOM::ListOfGO_out groups, GEOM::ListOfFields_out fields);
+
+ void ExportSTL( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ const bool theIsASCII,
+ CORBA::Double theDeflection,
+ const bool theIsRelative );
+
+ GEOM::GEOM_Object_ptr ImportSTL( const char* theFileName );
+
+ void ExportBREP( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName );
+
+ GEOM::GEOM_Object_ptr ImportBREP( const char* theFileName );
+
+ void ExportSTEP( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName );
+
+ GEOM::GEOM_Object_ptr ImportSTEP( const char* theFileName,
+ const bool theIsIgnoreUnits );
+
+ void ExportIGES( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ const char* theVersion );
+
+ GEOM::GEOM_Object_ptr ImportIGES( const char* theFileName,
+ const bool theIsIgnoreUnits );
+
+ CORBA::Boolean ExportXAO( GEOM::GEOM_Object_ptr shape,
+ const GEOM::ListOfGO& groups,
+ const GEOM::ListOfFields& fields,
+ const char* author,
+ const char* fileName);
+ CORBA::Boolean ImportXAO( const char* fileName,
+ GEOM::GEOM_Object_out shape,
+ GEOM::ListOfGO_out subShapes,
+ GEOM::ListOfGO_out groups,
+ GEOM::ListOfFields_out fields );
+
+ void ExportVTK( GEOM::GEOM_Object_ptr theObject,
+ const char* theFileName,
+ CORBA::Double theDeflection );
//-----------------------------------------------------------//
// Advanced Operations //
GEOM::GEOM_ICurvesOperations_var myCurvesOp;
GEOM::GEOM_ILocalOperations_var myLocalOp;
GEOM::GEOM_IGroupOperations_var myGroupOp;
- GEOM::GEOM_IAdvancedOperations_var myAdvancedOp;
+ GEOM::IAdvancedOperations_var myAdvancedOp;
+ GEOM::ISTLOperations_var mySTLOp;
+ GEOM::IBREPOperations_var myBREPOp;
+ GEOM::ISTEPOperations_var mySTEPOp;
+ GEOM::IIGESOperations_var myIGESOp;
+ GEOM::IXAOOperations_var myXAOOp;
+ GEOM::IVTKOperations_var myVTKOp;
};
#endif
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+from GEOM import IAdvancedOperations
+
+# Engine Library Name
+__libraryName__ = "AdvancedEngine"
+
+def GetAdvancedOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IAdvancedOperations)
+
+## Create a T-shape object with specified caracteristics for the main
+# and the incident pipes (radius, width, half-length).
+# The extremities of the main pipe are located on junctions points P1 and P2.
+# The extremity of the incident pipe is located on junction point P3.
+# If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+# the main plane of the T-shape is XOY.
+#
+# @param theR1 Internal radius of main pipe
+# @param theW1 Width of main pipe
+# @param theL1 Half-length of main pipe
+# @param theR2 Internal radius of incident pipe (R2 < R1)
+# @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+# @param theL2 Half-length of incident pipe
+#
+# @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+# @param theP1 1st junction point of main pipe
+# @param theP2 2nd junction point of main pipe
+# @param theP3 Junction point of incident pipe
+#
+# @param theRL Internal radius of left thickness reduction
+# @param theWL Width of left thickness reduction
+# @param theLtransL Length of left transition part
+# @param theLthinL Length of left thin part
+#
+# @param theRR Internal radius of right thickness reduction
+# @param theWR Width of right thickness reduction
+# @param theLtransR Length of right transition part
+# @param theLthinR Length of right thin part
+#
+# @param theRI Internal radius of incident thickness reduction
+# @param theWI Width of incident thickness reduction
+# @param theLtransI Length of incident transition part
+# @param theLthinI Length of incident thin part
+#
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
+#
+# @ref tui_creation_pipetshape "Example"
+# @ingroup l4_advanced
+def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
+ theHexMesh=True, theP1=None, theP2=None, theP3=None,
+ theRL=0, theWL=0, theLtransL=0, theLthinL=0,
+ theRR=0, theWR=0, theLtransR=0, theLthinR=0,
+ theRI=0, theWI=0, theLtransI=0, theLthinI=0,
+ theName=None):
+ """
+ Create a T-shape object with specified caracteristics for the main
+ and the incident pipes (radius, width, half-length).
+ The extremities of the main pipe are located on junctions points P1 and P2.
+ The extremity of the incident pipe is located on junction point P3.
+ If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ the main plane of the T-shape is XOY.
+
+ Parameters:
+ theR1 Internal radius of main pipe
+ theW1 Width of main pipe
+ theL1 Half-length of main pipe
+ theR2 Internal radius of incident pipe (R2 < R1)
+ theW2 Width of incident pipe (R2+W2 < R1+W1)
+ theL2 Half-length of incident pipe
+ theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ theP1 1st junction point of main pipe
+ theP2 2nd junction point of main pipe
+ theP3 Junction point of incident pipe
+
+ theRL Internal radius of left thickness reduction
+ theWL Width of left thickness reduction
+ theLtransL Length of left transition part
+ theLthinL Length of left thin part
+
+ theRR Internal radius of right thickness reduction
+ theWR Width of right thickness reduction
+ theLtransR Length of right transition part
+ theLthinR Length of right thin part
+
+ theRI Internal radius of incident thickness reduction
+ theWI Width of incident thickness reduction
+ theLtransI Length of incident transition part
+ theLthinI Length of incident thin part
+
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ List of GEOM_Object, containing the created shape and propagation groups.
+
+ Example of usage:
+ # create PipeTShape object
+ pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
+ # create PipeTShape object with position
+ pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
+ # create PipeTShape object with left thickness reduction
+ pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
+ anOp = GetAdvancedOperations(self)
+ if (theP1 and theP2 and theP3):
+ anObj = anOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = anOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theHexMesh)
+ pass
+ RaiseIfFailed("MakePipeTShape", anOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
+ self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
+ anOp.UnRegister()
+ return anObj
+
+## Create a T-shape object with chamfer and with specified caracteristics for the main
+# and the incident pipes (radius, width, half-length). The chamfer is
+# created on the junction of the pipes.
+# The extremities of the main pipe are located on junctions points P1 and P2.
+# The extremity of the incident pipe is located on junction point P3.
+# If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+# the main plane of the T-shape is XOY.
+# @param theR1 Internal radius of main pipe
+# @param theW1 Width of main pipe
+# @param theL1 Half-length of main pipe
+# @param theR2 Internal radius of incident pipe (R2 < R1)
+# @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+# @param theL2 Half-length of incident pipe
+# @param theH Height of the chamfer.
+# @param theW Width of the chamfer.
+# @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+# @param theP1 1st junction point of main pipe
+# @param theP2 2nd junction point of main pipe
+# @param theP3 Junction point of incident pipe
+#
+# @param theRL Internal radius of left thickness reduction
+# @param theWL Width of left thickness reduction
+# @param theLtransL Length of left transition part
+# @param theLthinL Length of left thin part
+#
+# @param theRR Internal radius of right thickness reduction
+# @param theWR Width of right thickness reduction
+# @param theLtransR Length of right transition part
+# @param theLthinR Length of right thin part
+#
+# @param theRI Internal radius of incident thickness reduction
+# @param theWI Width of incident thickness reduction
+# @param theLtransI Length of incident transition part
+# @param theLthinI Length of incident thin part
+#
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
+#
+# @ref tui_creation_pipetshape "Example"
+# @ingroup l4_advanced
+def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
+ theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
+ theRL=0, theWL=0, theLtransL=0, theLthinL=0,
+ theRR=0, theWR=0, theLtransR=0, theLthinR=0,
+ theRI=0, theWI=0, theLtransI=0, theLthinI=0,
+ theName=None):
+ """
+ Create a T-shape object with chamfer and with specified caracteristics for the main
+ and the incident pipes (radius, width, half-length). The chamfer is
+ created on the junction of the pipes.
+ The extremities of the main pipe are located on junctions points P1 and P2.
+ The extremity of the incident pipe is located on junction point P3.
+ If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ the main plane of the T-shape is XOY.
+
+ Parameters:
+ theR1 Internal radius of main pipe
+ theW1 Width of main pipe
+ theL1 Half-length of main pipe
+ theR2 Internal radius of incident pipe (R2 < R1)
+ theW2 Width of incident pipe (R2+W2 < R1+W1)
+ theL2 Half-length of incident pipe
+ theH Height of the chamfer.
+ theW Width of the chamfer.
+ theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ theP1 1st junction point of main pipe
+ theP2 2nd junction point of main pipe
+ theP3 Junction point of incident pipe
+
+ theRL Internal radius of left thickness reduction
+ theWL Width of left thickness reduction
+ theLtransL Length of left transition part
+ theLthinL Length of left thin part
+
+ theRR Internal radius of right thickness reduction
+ theWR Width of right thickness reduction
+ theLtransR Length of right transition part
+ theLthinR Length of right thin part
+
+ theRI Internal radius of incident thickness reduction
+ theWI Width of incident thickness reduction
+ theLtransI Length of incident transition part
+ theLthinI Length of incident thin part
+
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ List of GEOM_Object, containing the created shape and propagation groups.
+
+ Example of usage:
+ # create PipeTShape with chamfer object
+ pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
+ # create PipeTShape with chamfer object with position
+ pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
+ # create PipeTShape with chamfer object with left thickness reduction
+ pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
+ anOp = GetAdvancedOperations(self)
+ if (theP1 and theP2 and theP3):
+ anObj = anOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theH, theW, theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = anOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theH, theW, theHexMesh)
+ pass
+
+ RaiseIfFailed("MakePipeTShapeChamfer", anOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
+ self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
+ anOp.UnRegister()
+ return anObj
+
+## Create a T-shape object with fillet and with specified caracteristics for the main
+# and the incident pipes (radius, width, half-length). The fillet is
+# created on the junction of the pipes.
+# The extremities of the main pipe are located on junctions points P1 and P2.
+# The extremity of the incident pipe is located on junction point P3.
+# If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+# the main plane of the T-shape is XOY.
+# @param theR1 Internal radius of main pipe
+# @param theW1 Width of main pipe
+# @param theL1 Half-length of main pipe
+# @param theR2 Internal radius of incident pipe (R2 < R1)
+# @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+# @param theL2 Half-length of incident pipe
+# @param theRF Radius of curvature of fillet.
+# @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+# @param theP1 1st junction point of main pipe
+# @param theP2 2nd junction point of main pipe
+# @param theP3 Junction point of incident pipe
+#
+# @param theRL Internal radius of left thickness reduction
+# @param theWL Width of left thickness reduction
+# @param theLtransL Length of left transition part
+# @param theLthinL Length of left thin part
+#
+# @param theRR Internal radius of right thickness reduction
+# @param theWR Width of right thickness reduction
+# @param theLtransR Length of right transition part
+# @param theLthinR Length of right thin part
+#
+# @param theRI Internal radius of incident thickness reduction
+# @param theWI Width of incident thickness reduction
+# @param theLtransI Length of incident transition part
+# @param theLthinI Length of incident thin part
+#
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
+#
+# @ref tui_creation_pipetshape "Example"
+# @ingroup l4_advanced
+def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
+ theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
+ theRL=0, theWL=0, theLtransL=0, theLthinL=0,
+ theRR=0, theWR=0, theLtransR=0, theLthinR=0,
+ theRI=0, theWI=0, theLtransI=0, theLthinI=0,
+ theName=None):
+ """
+ Create a T-shape object with fillet and with specified caracteristics for the main
+ and the incident pipes (radius, width, half-length). The fillet is
+ created on the junction of the pipes.
+ The extremities of the main pipe are located on junctions points P1 and P2.
+ The extremity of the incident pipe is located on junction point P3.
+
+ Parameters:
+ If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ the main plane of the T-shape is XOY.
+ theR1 Internal radius of main pipe
+ theW1 Width of main pipe
+ heL1 Half-length of main pipe
+ theR2 Internal radius of incident pipe (R2 < R1)
+ theW2 Width of incident pipe (R2+W2 < R1+W1)
+ theL2 Half-length of incident pipe
+ theRF Radius of curvature of fillet.
+ theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ theP1 1st junction point of main pipe
+ theP2 2nd junction point of main pipe
+ theP3 Junction point of incident pipe
+
+ theRL Internal radius of left thickness reduction
+ theWL Width of left thickness reduction
+ theLtransL Length of left transition part
+ theLthinL Length of left thin part
+
+ theRR Internal radius of right thickness reduction
+ theWR Width of right thickness reduction
+ theLtransR Length of right transition part
+ theLthinR Length of right thin part
+
+ theRI Internal radius of incident thickness reduction
+ theWI Width of incident thickness reduction
+ theLtransI Length of incident transition part
+ theLthinI Length of incident thin part
+
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ List of GEOM_Object, containing the created shape and propagation groups.
+
+ Example of usage:
+ # create PipeTShape with fillet object
+ pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
+ # create PipeTShape with fillet object with position
+ pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
+ # create PipeTShape with fillet object with left thickness reduction
+ pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
+ anOp = GetAdvancedOperations(self)
+ if (theP1 and theP2 and theP3):
+ anObj = anOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theRF, theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = anOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
+ theRL, theWL, theLtransL, theLthinL,
+ theRR, theWR, theLtransR, theLthinR,
+ theRI, theWI, theLtransI, theLthinI,
+ theRF, theHexMesh)
+ pass
+ RaiseIfFailed("MakePipeTShapeFillet", anOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ self.def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
+ self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), self.def_names)
+ anOp.UnRegister()
+ return anObj
+
+## This function allows creating a disk already divided into blocks. It
+# can be used to create divided pipes for later meshing in hexaedra.
+# @param theR Radius of the disk
+# @param theOrientation Orientation of the plane on which the disk will be built
+# 1 = XOY, 2 = OYZ, 3 = OZX
+# @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM_Object, containing the created shape.
+#
+# @ref tui_creation_divideddisk "Example"
+# @ingroup l4_advanced
+def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
+ """
+ Creates a disk, divided into blocks. It can be used to create divided pipes
+ for later meshing in hexaedra.
+
+ Parameters:
+ theR Radius of the disk
+ theOrientation Orientation of the plane on which the disk will be built:
+ 1 = XOY, 2 = OYZ, 3 = OZX
+ thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM_Object, containing the created shape.
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theR, Parameters = ParseParameters(theR)
+ anOp = GetAdvancedOperations(self)
+ anObj = anOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
+ RaiseIfFailed("MakeDividedDisk", anOp)
+ if Parameters: anObj.SetParameters(Parameters)
+ self._autoPublish(anObj, theName, "dividedDisk")
+ anOp.UnRegister()
+ return anObj
+
+## This function allows creating a disk already divided into blocks. It
+# can be used to create divided pipes for later meshing in hexaedra.
+# @param theCenter Center of the disk
+# @param theVector Normal vector to the plane of the created disk
+# @param theRadius Radius of the disk
+# @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM_Object, containing the created shape.
+#
+# @ref tui_creation_divideddisk "Example"
+# @ingroup l4_advanced
+def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
+ """
+ Creates a disk already divided into blocks. It can be used to create divided pipes
+ for later meshing in hexaedra.
+
+ Parameters:
+ theCenter Center of the disk
+ theVector Normal vector to the plane of the created disk
+ theRadius Radius of the disk
+ thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM_Object, containing the created shape.
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theRadius, Parameters = ParseParameters(theRadius)
+ anOp = GetAdvancedOperations(self)
+ anObj = anOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
+ RaiseIfFailed("MakeDividedDiskPntVecR", anOp)
+ if Parameters: anObj.SetParameters(Parameters)
+ self._autoPublish(anObj, theName, "dividedDisk")
+ anOp.UnRegister()
+ return anObj
+
+## Builds a cylinder prepared for hexa meshes
+# @param theR Radius of the cylinder
+# @param theH Height of the cylinder
+# @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM_Object, containing the created shape.
+#
+# @ref tui_creation_dividedcylinder "Example"
+# @ingroup l4_advanced
+def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
+ """
+ Builds a cylinder prepared for hexa meshes
+
+ Parameters:
+ theR Radius of the cylinder
+ theH Height of the cylinder
+ thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM_Object, containing the created shape.
+ """
+ from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed, _toListOfNames
+ theR, theH, Parameters = ParseParameters(theR, theH)
+ anOp = GetAdvancedOperations(self)
+ anObj = anOp.MakeDividedCylinder(theR, theH, thePattern)
+ RaiseIfFailed("MakeDividedCylinder", anOp)
+ if Parameters: anObj.SetParameters(Parameters)
+ self._autoPublish(anObj, theName, "dividedCylinder")
+ anOp.UnRegister()
+ return anObj
+
+## Create a surface from a cloud of points
+# @param thelPoints list of points. Compounds of points are
+# accepted as well.
+# @param theNbMax maximum number of Bezier pieces in the resulting
+# surface.
+# @param theDegMax maximum degree of the resulting BSpline surface.
+# @param theDMax 3D tolerance of initial approximation.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+# @return New GEOM_Object, containing the created shape.
+# @note 3D tolerance of initial approximation represents a tolerance of
+# initial plate surface approximation. If this parameter is equal
+# to 0 (default value) it is computed. In this case an error of
+# initial plate surface computation is used as the approximation
+# tolerance. This error represents a maximal distance between
+# computed plate surface and given points.
+#
+# @ref tui_creation_smoothingsurface "Example"
+# @ingroup l4_advanced
+def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
+ theDMax=0.0, theName=None):
+ """
+ Create a surface from a cloud of points
+
+ Parameters:
+ thelPoints list of points. Compounds of points are
+ accepted as well.
+ theNbMax maximum number of Bezier pieces in the resulting
+ surface.
+ theDegMax maximum degree of the resulting BSpline surface.
+ theDMax 3D tolerance of initial approximation.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM_Object, containing the created shape.
+
+ Note:
+ 3D tolerance of initial approximation represents a tolerance of
+ initial plate surface approximation. If this parameter is equal
+ to 0 (default value) it is computed. In this case an error of
+ initial plate surface computation is used as the approximation
+ tolerance. This error represents a maximal distance between
+ computed plate surface and given points.
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetAdvancedOperations(self)
+ anObj = anOp.MakeSmoothingSurface(thelPoints, theNbMax,
+ theDegMax, theDMax)
+ RaiseIfFailed("MakeSmoothingSurface", anOp)
+ self._autoPublish(anObj, theName, "smoothing")
+ anOp.UnRegister()
+ return anObj
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import IBREPOperations
+
+# Engine Library Name
+__libraryName__ = "BREPPluginEngine"
+
+def GetBREPPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IBREPOperations)
+
+## Export the given shape into a file with given name in BREP format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+# @ingroup l2_import_export
+def ExportBREP(self, theObject, theFileName):
+ """
+ Export the given shape into a file with given name in BREP format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ """
+ anOp = GetBREPPluginOperations(self)
+ anOp.ExportBREP(theObject, theFileName)
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
+
+
+## Import a shape from the BREP file
+# @param theFileName The file, containing the shape.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM.GEOM_Object, containing the imported shape.
+# If material names are imported it returns the list of
+# objects. The first one is the imported object followed by
+# material groups.
+# @note Auto publishing is allowed for the shape itself. Imported
+# material groups are not automatically published.
+# @ingroup l2_import_export
+def ImportBREP(self, theFileName, theName=None):
+ """
+ Import a shape from the BREP file
+
+ Parameters:
+ theFileName The file, containing the shape.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the imported shape.
+ If material names are imported it returns the list of
+ objects. The first one is the imported object followed by
+ material groups.
+ Note:
+ Auto publishing is allowed for the shape itself. Imported
+ material groups are not automatically published.
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetBREPPluginOperations(self)
+ aListObj = anOp.ImportBREP(theFileName)
+ RaiseIfFailed("ImportBREP", anOp)
+ aNbObj = len(aListObj)
+ if aNbObj > 0:
+ self._autoPublish(aListObj[0], theName, "imported")
+ if aNbObj == 1:
+ return aListObj[0]
+ return aListObj
gsketcher.py
)
+# Advanced scripts
+
+SET(_python_advanced_SCRIPTS
+ AdvancedGEOMBuilder.py
+ __init__.py
+)
+
+# STL plugin scripts
+
+SET(_python_STL_SCRIPTS
+ STLPluginBuilder.py
+ __init__.py
+)
+
+# BREP plugin scripts
+
+SET(_python_BREP_SCRIPTS
+ BREPPluginBuilder.py
+ __init__.py
+)
+
+# STEP plugin scripts
+
+SET(_python_STEP_SCRIPTS
+ STEPPluginBuilder.py
+ __init__.py
+)
+
+# IGES plugin scripts
+
+SET(_python_IGES_SCRIPTS
+ IGESPluginBuilder.py
+ __init__.py
+)
+
+# XAO plugin scripts
+
+SET(_python_XAO_SCRIPTS
+ XAOPluginBuilder.py
+ __init__.py
+)
+
+# VTK plugin scripts
+
+SET(_python_VTK_SCRIPTS
+ VTKPluginBuilder.py
+ __init__.py
+)
+
# scripts / shared
SET(_shared_SCRIPTS
SALOME_INSTALL_SCRIPTS("${_other_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA} DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_shared_SCRIPTS}" ${SALOME_INSTALL_PYTHON_SHARED} DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_python_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/geom DEF_PERMS)
+
+# Install plugin scripts
+SALOME_INSTALL_SCRIPTS("${_python_advanced_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/AdvancedGEOM DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_STL_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/STLPlugin DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_BREP_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/BREPPlugin DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_STEP_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/STEPPlugin DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_IGES_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/IGESPlugin DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_XAO_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/XAOPlugin DEF_PERMS)
+SALOME_INSTALL_SCRIPTS("${_python_VTK_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/VTKPlugin DEF_PERMS)
tan_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
#Create base geometry 3D
- Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object)->GEOM_Object
- Box1 = geompy.MakeBoxDXDYDZ(10, 20, 30) #(3 Doubles)->GEOM_Object
- Box2 = geompy.MakeBox(10,20,30, 15,25,35) #(6 Doubles)->GEOM_Object
- Cylinder = geompy.MakeCylinder(p0, vz, radius1, height) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
- Cyl1 = geompy.MakeCylinderRH(radius2, height) #(2 Doubles)->GEOM_Object
- Sphere = geompy.MakeSpherePntR(p0, radius1) #(GEOM_Object, Double)->GEOM_Object
- Sphere1 = geompy.MakeSphereR(radius) #(Double)->GEOM_Object
- Sphere2 = geompy.MakeSphere(50, 70, 30, radius) #(4 Doubles)->GEOM_Object
- Cone = geompy.MakeCone(p0, vz, radius2, radius, height) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
- Cone1 = geompy.MakeConeR1R2H(radius1, radius, height) #(3 Doubles)->GEOM_Object
- Torus = geompy.MakeTorus(p0, vz, radius2, radius) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
- Torus1 = geompy.MakeTorusRR(radius2, radius1) #(2 Doubles)->GEOM_Object
+ Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object)->GEOM_Object
+ Box1 = geompy.MakeBoxDXDYDZ(10, 20, 30) #(3 Doubles)->GEOM_Object
+ Box2 = geompy.MakeBox(10,20,30, 15,25,35) #(6 Doubles)->GEOM_Object
+ Cylinder = geompy.MakeCylinder(p0, vz, radius1, height) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
+ Cyl1 = geompy.MakeCylinderRH(radius2, height) #(2 Doubles)->GEOM_Object
+ Cylinder1= geompy.MakeCylinderA(p0, vz, radius1, height, angle1) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
+ Cyl2 = geompy.MakeCylinderRHA(radius2, height, angle2) #(3 Doubles)->GEOM_Object
+ Sphere = geompy.MakeSpherePntR(p0, radius1) #(GEOM_Object, Double)->GEOM_Object
+ Sphere1 = geompy.MakeSphereR(radius) #(Double)->GEOM_Object
+ Sphere2 = geompy.MakeSphere(50, 70, 30, radius) #(4 Doubles)->GEOM_Object
+ Cone = geompy.MakeCone(p0, vz, radius2, radius, height) #(2 GEOM_Object, 3 Doubles)->GEOM_Object
+ Cone1 = geompy.MakeConeR1R2H(radius1, radius, height) #(3 Doubles)->GEOM_Object
+ Torus = geompy.MakeTorus(p0, vz, radius2, radius) #(2 GEOM_Object, 2 Doubles)->GEOM_Object
+ Torus1 = geompy.MakeTorusRR(radius2, radius1) #(2 Doubles)->GEOM_Object
#Boolean (Common, Cut, Fuse, Section)
Common = geompy.MakeBoolean(Box, Sphere, 1) #(2 GEOM_Object, Short)->GEOM_Object
id_Box2 = geompy.addToStudy(Box2, "Box (10,20,30)-(15,25,35)")
id_Cylinder = geompy.addToStudy(Cylinder, "Cylinder")
id_Cyl1 = geompy.addToStudy(Cyl1, "Cylinder RH")
+ id_Cylinder1= geompy.addToStudy(Cylinder1,"CylinderA")
+ id_Cyl2 = geompy.addToStudy(Cyl2, "Cylinder RHA")
id_Sphere = geompy.addToStudy(Sphere, "Sphere Pnt R")
id_Sphere1 = geompy.addToStudy(Sphere1, "Sphere R")
id_Sphere2 = geompy.addToStudy(Sphere2, "Sphere")
gg.setDisplayMode(id_torus1,1)
gg.setDisplayMode(id_torus2,1)
gg.setVectorsMode(id_acyl,1,1)
+ gg.setVerticesMode(id_acyl,1,1)
#gg.setDisplayMode(id_cage,1)
gg.setColor(id_torus1,0,0,255)
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import IIGESOperations
+
+# Engine Library Name
+__libraryName__ = "IGESPluginEngine"
+
+def GetIGESPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IIGESOperations)
+
+## Export the given shape into a file with given name in IGES format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+# @param theVersion Version of IGES format which defines, whether to write
+# only faces (5.1 IGES format) or shells and solids also (5.3 IGES format).
+# @ingroup l2_import_export
+def ExportIGES(self, theObject, theFileName, theVersion="5.1"):
+ """
+ Export the given shape into a file with given name in IGES format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ theVersion Version of IGES format which defines, whether to write
+ only faces (5.1 IGES format) or shells and solids also (5.3 IGES format).
+ """
+ anOp = GetIGESPluginOperations(self)
+ anOp.ExportIGES(theObject, theFileName, theVersion)
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
+
+## Import a shape from the IGES file with given name.
+# @param theFileName The file, containing the shape.
+# @param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+# and result model will be scaled, if its units are not meters.
+# If False (default), file length units will be taken into account.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM.GEOM_Object, containing the imported shape.
+# If material names are imported it returns the list of
+# objects. The first one is the imported object followed by
+# material groups.
+# @note Auto publishing is allowed for the shape itself. Imported
+# material groups are not automatically published.
+#
+# @ref swig_Import_Export "Example"
+# @ingroup l2_import_export
+def ImportIGES(self, theFileName, theIsIgnoreUnits = False, theName=None):
+ """
+ Import a shape from the IGES file with given name.
+
+ Parameters:
+ theFileName The file, containing the shape.
+ ignoreUnits If True, file length units will be ignored (set to 'meter')
+ and result model will be scaled, if its units are not meters.
+ If False (default), file length units will be taken into account.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the imported shape.
+ If material names are imported it returns the list of
+ objects. The first one is the imported object followed by
+ material groups.
+ Note:
+ Auto publishing is allowed for the shape itself. Imported
+ material groups are not automatically published.
+ """
+ # Example: see GEOM_TestOthers.py
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetIGESPluginOperations(self)
+
+ anIsIgnoreUnits = theIsIgnoreUnits
+ aName = theName
+ if isinstance( theIsIgnoreUnits, basestring ):
+ anIsIgnoreUnits = False
+ aName = theIsIgnoreUnits
+ pass
+
+ aListObj = anOp.ImportIGES(theFileName,anIsIgnoreUnits)
+ RaiseIfFailed("ImportIGES", anOp)
+ aNbObj = len(aListObj)
+ if aNbObj > 0:
+ self._autoPublish(aListObj[0], aName, "imported")
+ if aNbObj == 1:
+ return aListObj[0]
+ return aListObj
+
+## Return length unit from given IGES file
+# @param theFileName The file, containing the shape.
+# @return String, containing the units name.
+#
+# @ref swig_Import_Export "Example"
+# @ingroup l2_import_export
+def GetIGESUnit(self, theFileName):
+ """
+ Return length units from given IGES file
+
+ Parameters:
+ theFileName The file, containing the shape.
+
+ Returns:
+ String, containing the units name.
+ """
+ # Example: see GEOM_TestOthers.py
+ anOp = GetIGESPluginOperations(self)
+ aUnitName = anOp.ReadValue( theFileName, "LEN_UNITS")
+ return aUnitName
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import ISTEPOperations
+
+# Engine Library Name
+__libraryName__ = "STEPPluginEngine"
+
+def GetSTEPPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(ISTEPOperations)
+
+## Export the given shape into a file with given name in STEP format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+# @ingroup l2_import_export
+def ExportSTEP(self, theObject, theFileName):
+ """
+ Export the given shape into a file with given name in STEP format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ """
+ anOp = GetSTEPPluginOperations(self)
+ anOp.ExportSTEP(theObject, theFileName)
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
+
+## Import a shape from the STEP file with given name.
+# @param theFileName The file, containing the shape.
+# @param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+# and result model will be scaled, if its units are not meters.
+# If False (default), file length units will be taken into account.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM.GEOM_Object, containing the imported shape.
+# If material names are imported it returns the list of
+# objects. The first one is the imported object followed by
+# material groups.
+# @note Auto publishing is allowed for the shape itself. Imported
+# material groups are not automatically published.
+#
+# @ref swig_Import_Export "Example"
+# @ingroup l2_import_export
+def ImportSTEP(self, theFileName, theIsIgnoreUnits = False, theName=None):
+ """
+ Import a shape from the STEP file with given name.
+
+ Parameters:
+ theFileName The file, containing the shape.
+ ignoreUnits If True, file length units will be ignored (set to 'meter')
+ and result model will be scaled, if its units are not meters.
+ If False (default), file length units will be taken into account.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the imported shape.
+ If material names are imported it returns the list of
+ objects. The first one is the imported object followed by
+ material groups.
+ Note:
+ Auto publishing is allowed for the shape itself. Imported
+ material groups are not automatically published.
+ """
+ # Example: see GEOM_TestOthers.py
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetSTEPPluginOperations(self)
+
+ anIsIgnoreUnits = theIsIgnoreUnits
+ aName = theName
+ if isinstance( theIsIgnoreUnits, basestring ):
+ anIsIgnoreUnits = False
+ aName = theIsIgnoreUnits
+ pass
+
+ aListObj = anOp.ImportSTEP(theFileName,anIsIgnoreUnits)
+ RaiseIfFailed("ImportSTEP", anOp)
+ aNbObj = len(aListObj)
+ if aNbObj > 0:
+ self._autoPublish(aListObj[0], aName, "imported")
+ if aNbObj == 1:
+ return aListObj[0]
+ return aListObj
+
+## Return length unit from given STEP file
+# @param theFileName The file, containing the shape.
+# @return String, containing the units name.
+#
+# @ref swig_Import_Export "Example"
+# @ingroup l2_import_export
+def GetSTEPUnit(self, theFileName):
+ """
+ Return length units from given STEP file
+
+ Parameters:
+ theFileName The file, containing the shape.
+
+ Returns:
+ String, containing the units name.
+ """
+ # Example: see GEOM_TestOthers.py
+ anOp = GetSTEPPluginOperations(self)
+ aUnitName = anOp.ReadValue( theFileName, "LEN_UNITS")
+ return aUnitName
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import ISTLOperations
+
+# Engine Library Name
+__libraryName__ = "STLPluginEngine"
+
+def GetSTLPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(ISTLOperations)
+
+## Export the given shape into a file with given name in STL format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+# @param theIsASCII The format of the exported file (ASCII or Binary)
+# @param theDeflection Deflection of the given shape.
+# @param theIsRelative If True (default value), the deflection
+# is calculated relatively to the size of the shape;
+# if False, the user defined deflection is used.
+# @ingroup l2_import_export
+def ExportSTL(self, theObject, theFileName, theIsASCII = True, theDeflection = 0.001, theIsRelative = True ):
+ """
+ Export the given shape into a file with given name in STL format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ theIsASCII The format of the exported file (ASCII or Binary).
+ theDeflection Deflection of the given shape.
+ theRelative If True (default value), the deflection
+ is calculated relatively to the size of the shape;
+ if False, the user defined deflection is used.
+ """
+ anOp = GetSTLPluginOperations(self)
+ anOp.ExportSTL(theObject, theFileName, theIsASCII, theDeflection, theIsRelative )
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
+
+## Import a shape from the STL file
+# @param theFileName The file, containing the shape.
+# @param theName Object name; when specified, this parameter is used
+# for result publication in the study. Otherwise, if automatic
+# publication is switched on, default value is used for result name.
+#
+# @return New GEOM.GEOM_Object, containing the imported shape.
+# If material names are imported it returns the list of
+# objects. The first one is the imported object followed by
+# material groups.
+# @note Auto publishing is allowed for the shape itself. Imported
+# material groups are not automatically published.
+# @ingroup l2_import_export
+def ImportSTL(self, theFileName, theName=None):
+ """
+ Import a shape from the STL file
+
+ Parameters:
+ theFileName The file, containing the shape.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the imported shape.
+ If material names are imported it returns the list of
+ objects. The first one is the imported object followed by
+ material groups.
+ Note:
+ Auto publishing is allowed for the shape itself. Imported
+ material groups are not automatically published.
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetSTLPluginOperations(self)
+ aListObj = anOp.ImportSTL(theFileName)
+ RaiseIfFailed("ImportSTL", anOp)
+ aNbObj = len(aListObj)
+ if aNbObj > 0:
+ self._autoPublish(aListObj[0], theName, "imported")
+ if aNbObj == 1:
+ return aListObj[0]
+ return aListObj
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import IVTKOperations
+
+# Engine Library Name
+__libraryName__ = "VTKPluginEngine"
+
+def GetVTKPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IVTKOperations)
+
+## Export the given shape into a file with given name in VTK format.
+# @param theObject Shape to be stored in the file.
+# @param theFileName Name of the file to store the given shape in.
+# @param theDeflection Deflection of the given shape.
+# @ingroup l2_import_export
+def ExportVTK(self, theObject, theFileName, theDeflection=0.001):
+ """
+ Export the given shape into a file with given name in VTK format.
+
+ Parameters:
+ theObject Shape to be stored in the file.
+ theFileName Name of the file to store the given shape in.
+ theIsASCII The format of the exported file (ASCII or Binary).
+ theDeflection Deflection of the given shape.
+ """
+ anOp = GetVTKPluginOperations(self)
+ anOp.ExportVTK(theObject, theFileName, theDeflection)
+ if anOp.IsDone() == 0:
+ raise RuntimeError, "Export : " + anOp.GetErrorCode()
+ pass
+ pass
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from GEOM import IXAOOperations
+
+# Engine Library Name
+__libraryName__ = "XAOPluginEngine"
+
+def GetXAOPluginOperations(self):
+ anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
+ return anOp._narrow(IXAOOperations)
+
+## Export a shape to XAO format
+# @param shape The shape to export
+# @param groups The list of groups to export
+# @param fields The list of fields to export
+# @param author The author of the export
+# @param fileName The name of the file to export
+# @return boolean
+#
+# @ingroup l2_import_export
+def ExportXAO(self, shape, groups, fields, author, fileName):
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetXAOPluginOperations(self)
+ res = anOp.ExportXAO(shape, groups, fields, author, fileName)
+ RaiseIfFailed("ExportXAO", anOp)
+ return res
+
+## Import a shape from XAO format
+# @param fileName The name of the file to import
+# @return tuple (res, shape, subShapes, groups, fields)
+# res Flag indicating if the import was successful
+# shape The imported shape
+# subShapes The list of imported subShapes
+# groups The list of imported groups
+# fields The list of imported fields
+#
+# @ingroup l2_import_export
+def ImportXAO(self, fileName):
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetXAOPluginOperations(self)
+ res = anOp.ImportXAO(fileName)
+ RaiseIfFailed("ImportXAO", anOp)
+ return res
## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
## functions.
-##
+##
## However, it is possible to publish result data in the study
## automatically. For this, almost each function of
## \ref geomBuilder.geomBuilder "geomBuilder" class has
## an additional @a theName parameter (@c None by default).
## As soon as non-empty string value is passed to this parameter,
## the result object is published in the study automatically.
-##
+##
## For example, consider the following Python script:
-##
+##
## @code
## import salome
## from salome.geom import geomBuilder
## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
## geompy.addToStudy(box, "box") # explicit publishing
## @endcode
-##
+##
## Last two lines can be replaced by one-line instruction:
-##
+##
## @code
## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
## @endcode
-##
+##
## ... or simply
-##
+##
## @code
## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
## @endcode
## value passed as parameter has the same effect.
## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
## maximum number of sub-shapes allowed for publishing is set to specified value.
-##
-## When automatic publishing is enabled, you even do not need to pass @a theName parameter
+##
+## When automatic publishing is enabled, you even do not need to pass @a theName parameter
## to the functions creating objects, instead default names will be used. However, you
## can always change the behavior, by passing explicit name to the @a theName parameter
## and it will be used instead default one.
## from salome.geom import geomBuilder
## geompy = geomBuilder.New(salome.myStudy)
## geompy.addToStudyAuto() # enable automatic publication
-## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
+## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
## # the box is created and published in the study with default name
## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
##
## It is possible to customize the representation of the geometrical
## data in the data tree; this can be done by using folders. A folder can
-## be created in the study tree using function
-## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
-## (by default it is created under the "Geometry" root object).
-## As soon as folder is created, any published geometry object
+## be created in the study tree using function
+## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
+## (by default it is created under the "Geometry" root object).
+## As soon as folder is created, any published geometry object
## can be moved into it.
-##
+##
## For example:
-##
+##
## @code
## import salome
## from salome.geom import geomBuilder
## geompy = geomBuilder.New(salome.myStudy)
-## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
+## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
## # the box was created and published in the study
## folder = geompy.NewFolder("Primitives")
## # an empty "Primitives" folder was created under default "Geometry" root object
## geompy.PutToFolder(box, folder)
## # the box was moved into "Primitives" folder
## @endcode
-##
+##
## Subfolders are also can be created by specifying another folder as a parent:
-##
+##
## @code
## subfolder = geompy.NewFolder("3D", folder)
## # "3D" folder was created under "Primitives" folder
## @endcode
-##
+##
## @note
## - Folder container is just a representation layer object that
-## deals with already published objects only. So, any geometry object
-## should be published in the study (for example, with
+## deals with already published objects only. So, any geometry object
+## should be published in the study (for example, with
## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
## BEFORE moving it into any existing folder.
## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
## does not change physical position of geometry object in the study tree,
## it only affects on the representation of the data tree.
## - It is impossible to publish geometry object using any folder as father.
-##
+##
## \defgroup l1_publish_data
## \defgroup l1_geomBuilder_auxiliary
## \defgroup l1_geomBuilder_purpose
import GEOM
import math
import os
+import functools
-from salome.geom.gsketcher import Sketcher3D, Sketcher2D
+from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
# service function
def _toListOfNames(_names, _size=-1):
for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
return l
+# Decorator function to manage transactions for all geometric operations.
+def ManageTransactions(theOpeName):
+ def MTDecorator(theFunction):
+ # To keep the original function name an documentation.
+ @functools.wraps(theFunction)
+ def OpenCallClose(self, *args, **kwargs):
+ # Open transaction
+ anOperation = getattr(self, theOpeName)
+ anOperation.StartOperation()
+ try:
+ # Call the function
+ res = theFunction(self, *args, **kwargs)
+ # Commit transaction
+ anOperation.FinishOperation()
+ return res
+ except:
+ # Abort transaction
+ anOperation.AbortOperation()
+ raise
+ return OpenCallClose
+ return MTDecorator
+
## Raise an Error, containing the Method_name, if Operation is Failed
## @ingroup l1_geomBuilder_auxiliary
def RaiseIfFailed (Method_name, Operation):
if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
- Operation.AbortOperation()
raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
- else:
- Operation.FinishOperation()
- pass
## Return list of variables value from salome notebook
## @ingroup l1_geomBuilder_auxiliary
Returns:
data packed to the byte stream
-
+
Example of usage:
val = PackData("10001110") # val = 0xAE
val = PackData("1") # val = 0x80
texture bitmap itself.
This function can be used to read the texture to the byte stream in order to pass it to
the AddTexture() function of geomBuilder class.
-
+
Parameters:
fname texture file name
Returns:
sequence of tree values: texture's width, height in pixels and its byte stream
-
+
Example of usage:
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
self.function = function
pass
+ @ManageTransactions("operation")
def __call__(self, *args):
res = self.function(self.operation, *args)
RaiseIfFailed(self.function.__name__, self.operation)
self.MeasuOp = None
self.BlocksOp = None
self.GroupOp = None
- self.AdvOp = None
self.FieldOp = None
pass
self.GroupOp = self.GetIGroupOperations (self.myStudyId)
self.FieldOp = self.GetIFieldOperations (self.myStudyId)
- # The below line is a right way to map all plugin functions to geomBuilder,
- # but AdvancedOperations are already mapped, that is why this line is commented
- # and presents here only as an axample
- #self.AdvOp = self.GetPluginOperations (self.myStudyId, "AdvancedEngine")
-
- # self.AdvOp is used by functions MakePipeTShape*, MakeDividedDisk, etc.
- self.AdvOp = GEOM._objref_GEOM_Gen.GetPluginOperations (self, self.myStudyId, "AdvancedEngine")
-
# set GEOM as root in the use case tree
self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
self.myUseCaseBuilder.SetRootCurrent()
def GetPluginOperations(self, studyID, libraryName):
op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
- if op:
- # bind methods of operations to self
- methods = op.__class__.__dict__['__methods__']
- avoid_methods = self.BasicOp.__class__.__dict__['__methods__']
- for meth_name in methods:
- if not meth_name in avoid_methods: # avoid basic methods
- function = getattr(op.__class__, meth_name)
- if callable(function):
- #self.__dict__[meth_name] = self.__PluginOperation(op, function)
- self.__dict__[meth_name] = PluginOperation(op, function)
return op
## Enable / disable results auto-publishing
- #
+ #
# The automatic publishing is managed in the following way:
# - if @a maxNbSubShapes = 0, automatic publishing is disabled.
# - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
## Get name for sub-shape aSubObj of shape aMainObj
#
# @ref swig_SubShapeName "Example"
+ @ManageTransactions("ShapesOp")
def SubShapeName(self,aSubObj, aMainObj):
"""
Get name for sub-shape aSubObj of shape aMainObj
genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
drwAttribute.SetDrawable(False)
+ # hide references if any
+ vso = self.myStudy.FindDependances(aSObject);
+ for refObj in vso :
+ genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
+ drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
+ drwAttribute.SetDrawable(False)
+ pass
pass
# end of l1_geomBuilder_auxiliary
theAddPrefix add prefix "from_" to names of restored sub-shapes,
and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
- Returns:
+ Returns:
list of published sub-shapes
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
+ @ManageTransactions("BasicOp")
def MakeVertex(self, theX, theY, theZ, theName=None):
"""
Create point by three coordinates.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
- Returns:
+
+ Returns:
New GEOM.GEOM_Object, containing the created point.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
"""
Create a point, distant from the referenced point
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
"""
Create a point, corresponding to the given parameter on the given curve.
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
"""
Create a point by projection give coordinates on the given curve
-
+
Parameters:
theRefCurve The referenced curve.
theX X-coordinate in 3D space
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
"""
Create a point, corresponding to the given length on the given curve.
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref swig_MakeVertexOnSurface "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
"""
Create a point, corresponding to the given parameters on the
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref swig_MakeVertexOnSurfaceByCoord "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
"""
Create a point by projection give coordinates on the given surface
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref swig_MakeVertexInsideFace "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexInsideFace (self, theFace, theName=None):
"""
Create a point, which lays on the given face.
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref swig_MakeVertexOnLinesIntersection "Example"
+ @ManageTransactions("BasicOp")
def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
"""
Create a point on intersection of two lines.
# @return New GEOM.GEOM_Object, containing the created tangent.
#
# @ref swig_MakeTangentOnCurve "Example"
+ @ManageTransactions("BasicOp")
def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
"""
Create a tangent, corresponding to the given parameter on the given curve.
# @return New GEOM.GEOM_Object, containing the created tangent.
#
# @ref swig_MakeTangentPlaneOnFace "Example"
+ @ManageTransactions("BasicOp")
def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
"""
Create a tangent plane, corresponding to the given parameter on the given face.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created tangent.
Example of usage:
# @return New GEOM.GEOM_Object, containing the created vector.
#
# @ref tui_creation_vector "Example"
+ @ManageTransactions("BasicOp")
def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
"""
Create a vector with the given components.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created vector.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created vector.
#
# @ref tui_creation_vector "Example"
+ @ManageTransactions("BasicOp")
def MakeVector(self, thePnt1, thePnt2, theName=None):
"""
Create a vector between two points.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created vector.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created line.
#
# @ref tui_creation_line "Example"
+ @ManageTransactions("BasicOp")
def MakeLine(self, thePnt, theDir, theName=None):
"""
Create a line, passing through the given point
# @return New GEOM.GEOM_Object, containing the created line.
#
# @ref tui_creation_line "Example"
+ @ManageTransactions("BasicOp")
def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
"""
Create a line, passing through the given points
# @return New GEOM.GEOM_Object, containing the created line.
#
# @ref swig_MakeLineTwoFaces "Example"
+ @ManageTransactions("BasicOp")
def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
"""
Create a line on two faces intersection.
# @return New GEOM.GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
+ @ManageTransactions("BasicOp")
def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
"""
Create a plane, passing through the given point
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created plane.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
+ @ManageTransactions("BasicOp")
def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
"""
Create a plane, passing through the three given points
# @return New GEOM.GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
+ @ManageTransactions("BasicOp")
def MakePlaneFace(self, theFace, theTrimSize, theName=None):
"""
Create a plane, similar to the existing one, but with another size of representing face.
# @return New GEOM.GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
+ @ManageTransactions("BasicOp")
def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
"""
Create a plane, passing through the 2 vectors
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created plane.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
+ @ManageTransactions("BasicOp")
def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
"""
Create a plane, based on a Local coordinate system.
- Parameters:
+ Parameters:
theLCS coordinate system, defining plane.
theTrimSize Half size of a side of quadrangle face, representing the plane.
theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created plane.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created coordinate system.
#
# @ref swig_MakeMarker "Example"
+ @ManageTransactions("BasicOp")
def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
"""
Create a local coordinate system.
- Parameters:
+ Parameters:
OX,OY,OZ Three coordinates of coordinate system origin.
XDX,XDY,XDZ Three components of OX direction
YDX,YDY,YDZ Three components of OY direction
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created coordinate system.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created coordinate system.
#
# @ref tui_creation_lcs "Example"
+ @ManageTransactions("BasicOp")
def MakeMarkerFromShape(self, theShape, theName=None):
"""
Create a local coordinate system from shape.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
- Returns:
+
+ Returns:
New GEOM.GEOM_Object, containing the created coordinate system.
"""
anObj = self.BasicOp.MakeMarkerFromShape(theShape)
# @return New GEOM.GEOM_Object, containing the created coordinate system.
#
# @ref tui_creation_lcs "Example"
+ @ManageTransactions("BasicOp")
def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
"""
Create a local coordinate system from point and two vectors.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created coordinate system.
"""
# @return New GEOM.GEOM_Object, containing the created arc.
#
# @ref swig_MakeArc "Example"
+ @ManageTransactions("CurvesOp")
def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
"""
Create an arc of circle, passing through three given points.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created arc.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created arc.
#
# @ref swig_MakeArc "Example"
+ @ManageTransactions("CurvesOp")
def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
"""
Create an arc of circle from a center and 2 points.
# @return New GEOM.GEOM_Object, containing the created arc.
#
# @ref swig_MakeArc "Example"
+ @ManageTransactions("CurvesOp")
def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
"""
Create an arc of ellipse, of center and two points.
# @return New GEOM.GEOM_Object, containing the created circle.
#
# @ref tui_creation_circle "Example"
+ @ManageTransactions("CurvesOp")
def MakeCircle(self, thePnt, theVec, theR, theName=None):
"""
Create a circle with given center, normal vector and radius.
# publication is switched on, default value is used for result name.
#
# @return New GEOM.GEOM_Object, containing the created circle.
+ @ManageTransactions("CurvesOp")
def MakeCircleR(self, theR, theName=None):
"""
Create a circle with given radius.
# @return New GEOM.GEOM_Object, containing the created circle.
#
# @ref tui_creation_circle "Example"
+ @ManageTransactions("CurvesOp")
def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
"""
Create a circle, passing through three given points
# @return New GEOM.GEOM_Object, containing the created circle.
#
# @ref swig_MakeCircle "Example"
+ @ManageTransactions("CurvesOp")
def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
"""
Create a circle, with given point1 as center,
# @return New GEOM.GEOM_Object, containing the created ellipse.
#
# @ref tui_creation_ellipse "Example"
+ @ManageTransactions("CurvesOp")
def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
"""
Create an ellipse with given center, normal vector and radiuses.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created ellipse.
"""
# Example: see GEOM_TestAll.py
# publication is switched on, default value is used for result name.
#
# @return New GEOM.GEOM_Object, containing the created ellipse.
+ @ManageTransactions("CurvesOp")
def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
"""
Create an ellipse with given radiuses.
# @return New GEOM.GEOM_Object, containing the created polyline.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
"""
Create a polyline on the set of points.
# @return New GEOM.GEOM_Object, containing the created bezier curve.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
"""
Create bezier curve on the set of points.
# @return New GEOM.GEOM_Object, containing the created B-Spline curve.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
"""
Create B-Spline curve on the set of points.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created B-Spline curve.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created B-Spline curve.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
"""
Create B-Spline curve on the set of points.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created B-Spline curve.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created curve.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
"""
if theNewMethod:
anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
else:
- anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
+ anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "curve")
# a compound of edges.
#
# @ref tui_creation_curve "Example"
+ @ManageTransactions("CurvesOp")
def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
"""
Create an isoline curve on a face.
# @return New GEOM.GEOM_Object, containing the created wire.
#
# @ref tui_sketcher_page "Example"
+ @ManageTransactions("CurvesOp")
def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
"""
Create a sketcher (wire or face), following the textual description, passed
- CMD is one of
- "R angle" : Set the direction by angle
- "D dx dy" : Set the direction by DX & DY
-
+
- "TT x y" : Create segment by point at X & Y
- "T dx dy" : Create segment by point with DX & DY
- "L length" : Create segment by direction & Length
- "WW" : Close Wire (to finish)
- "WF" : Close Wire and build face (to finish)
-
+
- Flag1 (= reverse) is 0 or 2 ...
- if 0 the drawn arc is the one of lower angle (< Pi)
- if 2 the drawn arc ius the one of greater angle (> Pi)
-
+
- Flag2 (= control tolerance) is 0 or 1 ...
- if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
- if 1 the wire is built only if the end point is on the arc
# @return New GEOM.GEOM_Object, containing the created wire.
#
# @ref tui_sketcher_page "Example"
+ @ManageTransactions("CurvesOp")
def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
"""
Create a sketcher (wire or face), following the textual description,
return anObj
## Obtain a 2D sketcher interface
- # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
+ # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
def Sketcher2D (self):
"""
Obtain a 2D sketcher interface.
"""
sk = Sketcher2D (self)
return sk
-
+
## Create a sketcher wire, following the numerical description,
# passed through <VAR>theCoordinates</VAR> argument. \n
# @param theCoordinates double values, defining points to create a wire,
# @return New GEOM.GEOM_Object, containing the created wire.
#
# @ref tui_3dsketcher_page "Example"
+ @ManageTransactions("CurvesOp")
def Make3DSketcher(self, theCoordinates, theName=None):
"""
Create a sketcher wire, following the numerical description,
sk = Sketcher3D (self)
return sk
+ ## Obtain a 2D polyline creation interface
+ # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
+ #
+ # @ref tui_3dsketcher_page "Example"
+ def Polyline2D (self):
+ """
+ Obtain a 2D polyline creation interface.
+
+ Example of usage:
+ pl = geompy.Polyline2D()
+ pl.addSection("section 1", GEOM.Polyline, True)
+ pl.addPoints(0, 0, 10, 0, 10, 10)
+ pl.addSection("section 2", GEOM.Interpolation, False)
+ pl.addPoints(20, 0, 30, 0, 30, 10)
+ resultObj = pl.result(WorkingPlane)
+ """
+ pl = Polyline2D (self)
+ return pl
+
# end of l3_sketcher
## @}
def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
"""
Create a box by coordinates of two opposite vertices.
-
+
Parameters:
x1,y1,z1 double values, defining first point.
x2,y2,z2 double values, defining second point.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
+
Returns:
New GEOM.GEOM_Object, containing the created box.
"""
# @return New GEOM.GEOM_Object, containing the created box.
#
# @ref tui_creation_box "Example"
+ @ManageTransactions("PrimOp")
def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
"""
Create a box with specified dimensions along the coordinate axes
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created box.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created box.
#
# @ref tui_creation_box "Example"
+ @ManageTransactions("PrimOp")
def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
"""
Create a box with two specified opposite vertices,
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
+ @ManageTransactions("PrimOp")
def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
"""
Create a face with specified dimensions with edges parallel to coordinate axes.
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
+ @ManageTransactions("PrimOp")
def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
"""
Create a face from another plane and two sizes,
# @return New GEOM.GEOM_Object, containing the created disk.
#
# @ref tui_creation_disk "Example"
+ @ManageTransactions("PrimOp")
def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
"""
Create a disk with given center, normal vector and radius.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created disk.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created disk.
#
# @ref tui_creation_disk "Example"
+ @ManageTransactions("PrimOp")
def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
"""
Create a disk, passing through three given points
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created disk.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created disk.
#
# @ref tui_creation_face "Example"
+ @ManageTransactions("PrimOp")
def MakeDiskR(self, theR, theOrientation, theName=None):
"""
Create a disk with specified dimensions along OX-OY coordinate axes.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created disk.
Example of usage:
# @return New GEOM.GEOM_Object, containing the created cylinder.
#
# @ref tui_creation_cylinder "Example"
+ @ManageTransactions("PrimOp")
def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
"""
Create a cylinder with given base point, axis, radius and height.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created cylinder.
"""
# Example: see GEOM_TestAll.py
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder")
return anObj
+
+ ## Create a portion of cylinder with given base point, axis, radius, height and angle.
+ # @param thePnt Central point of cylinder base.
+ # @param theAxis Cylinder axis.
+ # @param theR Cylinder radius.
+ # @param theH Cylinder height.
+ # @param theA Cylinder angle in radians.
+ # @param theName Object name; when specified, this parameter is used
+ # for result publication in the study. Otherwise, if automatic
+ # publication is switched on, default value is used for result name.
+ #
+ # @return New GEOM.GEOM_Object, containing the created cylinder.
+ #
+ # @ref tui_creation_cylinder "Example"
+ @ManageTransactions("PrimOp")
+ def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
+ """
+ Create a a portion of cylinder with given base point, axis, radius, height and angle.
+
+ Parameters:
+ thePnt Central point of cylinder base.
+ theAxis Cylinder axis.
+ theR Cylinder radius.
+ theH Cylinder height.
+ theA Cylinder angle in radians.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the created cylinder.
+ """
+ # Example: see GEOM_TestAll.py
+ flag = False
+ if isinstance(theA,str):
+ flag = True
+ theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
+ if flag:
+ theA = theA*math.pi/180.
+ anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
+ RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
+ anObj.SetParameters(Parameters)
+ self._autoPublish(anObj, theName, "cylinder")
+ return anObj
## Create a cylinder with given radius and height at
# the origin of coordinate system. Axis of the cylinder
# @return New GEOM.GEOM_Object, containing the created cylinder.
#
# @ref tui_creation_cylinder "Example"
+ @ManageTransactions("PrimOp")
def MakeCylinderRH(self, theR, theH, theName=None):
"""
Create a cylinder with given radius and height at
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created cylinder.
"""
# Example: see GEOM_TestAll.py
anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "cylinder")
return anObj
+
+ ## Create a portion of cylinder with given radius, height and angle at
+ # the origin of coordinate system. Axis of the cylinder
+ # will be collinear to the OZ axis of the coordinate system.
+ # @param theR Cylinder radius.
+ # @param theH Cylinder height.
+ # @param theA Cylinder angle in radians.
+ # @param theName Object name; when specified, this parameter is used
+ # for result publication in the study. Otherwise, if automatic
+ # publication is switched on, default value is used for result name.
+ #
+ # @return New GEOM.GEOM_Object, containing the created cylinder.
+ #
+ # @ref tui_creation_cylinder "Example"
+ @ManageTransactions("PrimOp")
+ def MakeCylinderRHA(self, theR, theH, theA, theName=None):
+ """
+ Create a portion of cylinder with given radius, height and angle at
+ the origin of coordinate system. Axis of the cylinder
+ will be collinear to the OZ axis of the coordinate system.
+
+ Parameters:
+ theR Cylinder radius.
+ theH Cylinder height.
+ theA Cylinder angle in radians.
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM.GEOM_Object, containing the created cylinder.
+ """
+ # Example: see GEOM_TestAll.py
+ flag = False
+ if isinstance(theA,str):
+ flag = True
+ theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
+ if flag:
+ theA = theA*math.pi/180.
+ anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
+ RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
+ anObj.SetParameters(Parameters)
+ self._autoPublish(anObj, theName, "cylinder")
+ return anObj
## Create a sphere with given center and radius.
# @param thePnt Sphere center.
# @return New GEOM.GEOM_Object, containing the created sphere.
#
# @ref tui_creation_sphere "Example"
+ @ManageTransactions("PrimOp")
def MakeSpherePntR(self, thePnt, theR, theName=None):
"""
Create a sphere with given center and radius.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
- New GEOM.GEOM_Object, containing the created sphere.
+ Returns:
+ New GEOM.GEOM_Object, containing the created sphere.
"""
# Example: see GEOM_TestAll.py
theR,Parameters = ParseParameters(theR)
"""
Create a sphere with given center and radius.
- Parameters:
+ Parameters:
x,y,z Coordinates of sphere center.
theR Sphere radius.
theName Object name; when specified, this parameter is used
# @return New GEOM.GEOM_Object, containing the created sphere.
#
# @ref tui_creation_sphere "Example"
+ @ManageTransactions("PrimOp")
def MakeSphereR(self, theR, theName=None):
"""
Create a sphere with given radius at the origin of coordinate system.
- Parameters:
+ Parameters:
theR Sphere radius.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
Returns:
- New GEOM.GEOM_Object, containing the created sphere.
+ New GEOM.GEOM_Object, containing the created sphere.
"""
# Example: see GEOM_TestAll.py
theR,Parameters = ParseParameters(theR)
# @return New GEOM.GEOM_Object, containing the created cone.
#
# @ref tui_creation_cone "Example"
+ @ManageTransactions("PrimOp")
def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
"""
Create a cone with given base point, axis, height and radiuses.
- Parameters:
+ Parameters:
thePnt Central point of the first cone base.
theAxis Cone axis.
theR1 Radius of the first cone base.
# @return New GEOM.GEOM_Object, containing the created cone.
#
# @ref tui_creation_cone "Example"
+ @ManageTransactions("PrimOp")
def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
"""
Create a cone with given height and radiuses at
the origin of coordinate system. Axis of the cone will
be collinear to the OZ axis of the coordinate system.
- Parameters:
+ Parameters:
theR1 Radius of the first cone base.
theR2 Radius of the second cone base.
theH Cone height.
# @return New GEOM.GEOM_Object, containing the created torus.
#
# @ref tui_creation_torus "Example"
+ @ManageTransactions("PrimOp")
def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
"""
Create a torus with given center, normal vector and radiuses.
- Parameters:
+ Parameters:
thePnt Torus central point.
theVec Torus axis of symmetry.
theRMajor Torus major radius.
# @return New GEOM.GEOM_Object, containing the created torus.
#
# @ref tui_creation_torus "Example"
+ @ManageTransactions("PrimOp")
def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
"""
Create a torus with given radiuses at the origin of coordinate system.
- Parameters:
+ Parameters:
theRMajor Torus major radius.
theRMinor Torus minor radius.
theName Object name; when specified, this parameter is used
publication is switched on, default value is used for result name.
Returns:
- New GEOM.GEOM_Object, containing the created torus.
+ New GEOM.GEOM_Object, containing the created torus.
"""
# Example: see GEOM_TestAll.py
theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
"""
Create a shape by extrusion of the base shape along a vector, defined by two points.
- Parameters:
+ Parameters:
theBase Base shape to be extruded.
thePoint1 First end of extrusion vector.
thePoint2 Second end of extrusion vector.
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
"""
Create a shape by extrusion of the base shape along a
vector, defined by two points, in 2 Ways (forward/backward).
- Parameters:
+ Parameters:
theBase Base shape to be extruded.
thePoint1 First end of extrusion vector.
thePoint2 Second end of extrusion vector.
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
"""
Create a shape by extrusion of the base shape along the vector,
i.e. all the space, transfixed by the base shape during its translation
along the vector on the given distance.
- Parameters:
+ Parameters:
theBase Base shape to be extruded.
theVec Direction of extrusion.
theH Prism dimension along theVec.
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
"""
Create a shape by extrusion of the base shape along the vector,
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
"""
Create a shape by extrusion of the base shape along the dx, dy, dz direction
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created prism.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created prism.
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
"""
Create a shape by extrusion of the base shape along the dx, dy, dz direction
# @return New GEOM.GEOM_Object, containing the created revolution.
#
# @ref tui_creation_revolution "Example"
+ @ManageTransactions("PrimOp")
def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
"""
Create a shape by revolution of the base shape around the axis
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created revolution.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created revolution.
#
# @ref tui_creation_revolution "Example"
+ @ManageTransactions("PrimOp")
def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
"""
Create a shape by revolution of the base shape around the axis
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created revolution.
"""
theAngle,Parameters = ParseParameters(theAngle)
# @return New GEOM.GEOM_Object, containing the created filling surface.
#
# @ref tui_creation_filling "Example"
+ @ManageTransactions("PrimOp")
def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
"""
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created filling surface.
Example of usage:
# @return New GEOM.GEOM_Object, containing the created filling surface.
#
# @ref tui_creation_filling "Example"
+ @ManageTransactions("PrimOp")
def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
"""
Create a filling from the given compound of contours.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created filling surface.
Example of usage:
# @return New GEOM.GEOM_Object, containing the created shell or solid.
#
# @ref swig_todo "Example"
+ @ManageTransactions("PrimOp")
def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
"""
Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
# @return New GEOM.GEOM_Object, containing the created pipe.
#
# @ref tui_creation_pipe "Example"
+ @ManageTransactions("PrimOp")
def MakePipe(self, theBase, thePath, theName=None):
"""
Create a shape by extrusion of the base shape along
# @return New GEOM.GEOM_Object, containing the created pipe.
#
# @ref tui_creation_pipe_with_diff_sec "Example"
+ @ManageTransactions("PrimOp")
def MakePipeWithDifferentSections(self, theSeqBases,
theLocations, thePath,
theWithContact, theWithCorrection, theName=None):
# @return New GEOM.GEOM_Object, containing the created solids.
#
# @ref tui_creation_pipe_with_shell_sec "Example"
+ @ManageTransactions("PrimOp")
def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
theLocations, thePath,
theWithContact, theWithCorrection, theName=None):
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created solids.
"""
anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
# functionality - it is a version of function MakePipeWithShellSections()
# which give a possibility to recieve information about
# creating pipe between each pair of sections step by step.
+ @ManageTransactions("PrimOp")
def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
theLocations, thePath,
theWithContact, theWithCorrection, theName=None):
# @return New GEOM.GEOM_Object, containing the created solids.
#
# @ref tui_creation_pipe_without_path "Example"
+ @ManageTransactions("PrimOp")
def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
"""
Create solids between given sections
# @return New GEOM.GEOM_Object, containing the created pipe.
#
# @ref tui_creation_pipe "Example"
+ @ManageTransactions("PrimOp")
def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
"""
Create a shape by extrusion of the base shape along
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created pipe.
"""
# Example: see GEOM_TestAll.py
RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj
-
+
## Makes a thick solid from a face or a shell
# @param theShape Face or Shell to be thicken
# @param theThickness Thickness of the resulting solid
#
# @return New GEOM.GEOM_Object, containing the created solid
#
+ @ManageTransactions("PrimOp")
def MakeThickSolid(self, theShape, theThickness, theName=None):
"""
Make a thick solid from a face or a shell
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
+
Returns:
New GEOM.GEOM_Object, containing the created solid
"""
RaiseIfFailed("MakeThickening", self.PrimOp)
self._autoPublish(anObj, theName, "pipe")
return anObj
-
+
## Modifies a face or a shell to make it a thick solid
# @param theShape Face or Shell to be thicken
#
# @return The modified shape
#
+ @ManageTransactions("PrimOp")
def Thicken(self, theShape, theThickness):
"""
Modifies a face or a shell to make it a thick solid
# source pipe's "path".
#
# @ref tui_creation_pipe_path "Example"
+ @ManageTransactions("PrimOp")
def RestorePath (self, theShape, theBase1, theBase2, theName=None):
"""
Build a middle path of a pipe-like shape.
# source pipe's "path".
#
# @ref tui_creation_pipe_path "Example"
+ @ManageTransactions("PrimOp")
def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
"""
Build a middle path of a pipe-like shape.
# @return New GEOM.GEOM_Object, containing the created edge.
#
# @ref tui_creation_edge "Example"
+ @ManageTransactions("ShapesOp")
def MakeEdge(self, thePnt1, thePnt2, theName=None):
"""
Create a linear edge with specified ends.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created edge.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created edge.
#
# @ref tui_creation_edge "Example"
+ @ManageTransactions("ShapesOp")
def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
"""
Create a new edge, corresponding to the given length on the given curve.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created edge.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created edge.
#
# @ref tui_creation_edge "Example"
+ @ManageTransactions("ShapesOp")
def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
"""
Create an edge from specified wire.
# @return New GEOM.GEOM_Object, containing the created wire.
#
# @ref tui_creation_wire "Example"
+ @ManageTransactions("ShapesOp")
def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
"""
Create a wire from the set of edges and wires.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created wire.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
+ @ManageTransactions("ShapesOp")
def MakeFace(self, theWire, isPlanarWanted, theName=None):
"""
Create a face on the given wire.
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
+ @ManageTransactions("ShapesOp")
def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
"""
Create a face on the given wires set.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created face.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the created shell.
#
# @ref tui_creation_shell "Example"
+ @ManageTransactions("ShapesOp")
def MakeShell(self, theFacesAndShells, theName=None):
"""
Create a shell from the set of faces and shells.
# @return New GEOM.GEOM_Object, containing the created solid.
#
# @ref tui_creation_solid "Example"
+ @ManageTransactions("ShapesOp")
def MakeSolid(self, theShells, theName=None):
"""
Create a solid, bounded by the given shells.
"""
# Example: see GEOM_TestAll.py
if len(theShells) == 1:
- descr = self.MeasuOp.IsGoodForSolid(theShells[0])
+ descr = self._IsGoodForSolid(theShells[0])
#if len(descr) > 0:
# raise RuntimeError, "MakeSolidShells : " + descr
if descr == "WRN_SHAPE_UNCLOSED":
# @return New GEOM.GEOM_Object, containing the created compound.
#
# @ref tui_creation_compound "Example"
+ @ManageTransactions("ShapesOp")
def MakeCompound(self, theShapes, theName=None):
"""
Create a compound of the given shapes.
New GEOM.GEOM_Object, containing the created compound.
"""
# Example: see GEOM_TestAll.py
- self.ShapesOp.StartOperation()
anObj = self.ShapesOp.MakeCompound(theShapes)
RaiseIfFailed("MakeCompound", self.ShapesOp)
self._autoPublish(anObj, theName, "compound")
# @return Quantity of faces.
#
# @ref swig_NumberOf "Example"
+ @ManageTransactions("ShapesOp")
def NumberOfFaces(self, theShape):
"""
Gives quantity of faces in the given shape.
Parameters:
theShape Shape to count faces of.
- Returns:
+ Returns:
Quantity of faces.
"""
# Example: see GEOM_TestOthers.py
# @return Quantity of edges.
#
# @ref swig_NumberOf "Example"
+ @ManageTransactions("ShapesOp")
def NumberOfEdges(self, theShape):
"""
Gives quantity of edges in the given shape.
Parameters:
theShape Shape to count edges of.
- Returns:
+ Returns:
Quantity of edges.
"""
# Example: see GEOM_TestOthers.py
# @return Quantity of sub-shapes of given type.
#
# @ref swig_NumberOf "Example"
+ @ManageTransactions("ShapesOp")
def NumberOfSubShapes(self, theShape, theShapeType):
"""
Gives quantity of sub-shapes of type theShapeType in the given shape.
# @return Quantity of solids.
#
# @ref swig_NumberOf "Example"
+ @ManageTransactions("ShapesOp")
def NumberOfSolids(self, theShape):
"""
Gives quantity of solids in the given shape.
# @return The reversed copy of theShape.
#
# @ref swig_ChangeOrientation "Example"
+ @ManageTransactions("ShapesOp")
def ChangeOrientation(self, theShape, theName=None):
"""
Reverses an orientation the given shape.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
The reversed copy of theShape.
"""
# Example: see GEOM_TestAll.py
# @return List of IDs of all free faces, contained in theShape.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("ShapesOp")
def GetFreeFacesIDs(self,theShape):
"""
Retrieve all free faces from the given shape.
# @return List of sub-shapes of theShape1, shared with theShape2.
#
# @ref swig_GetSharedShapes "Example"
+ @ManageTransactions("ShapesOp")
def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
"""
Get all sub-shapes of theShape1 of the given type, shared with theShape2.
# @return List of objects, that are sub-shapes of all given shapes.
#
# @ref swig_GetSharedShapes "Example"
+ @ManageTransactions("ShapesOp")
def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
"""
Get all sub-shapes, shared by all shapes in the list theShapes.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
"""
# Example: see GEOM_TestOthers.py
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnPlane "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnPlaneIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnPlaneWithLocation "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnCylinder "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnCylinderIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnCylinderWithLocation "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes indices
#
# @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
theState The state of the sub-shapes to find (see GEOM::shape_state)
Returns:
- List of all found sub-shapes indices.
+ List of all found sub-shapes indices.
"""
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnSphere "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnSphereIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnQuadrangle "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnQuadrangle(self, theShape, theShapeType,
theTopLeftPoint, theTopRigthPoint,
theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnQuadrangleIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
theTopLeftPoint, theTopRigthPoint,
theBottomLeftPoint, theBottomRigthPoint, theState):
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnBox "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnBoxIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
"""
Find in theShape all sub-shapes of type theShapeType, situated relatively
# certain way, defined through \a theState parameter.
# @param theCheckShape Shape for relative comparing. It must be a solid.
# @param theShape Shape to find sub-shapes of.
- # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
+ # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
# @param theState The state of the sub-shapes to find (see GEOM::shape_state)
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# @return List of all found sub-shapes.
#
# @ref swig_GetShapesOnShape "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return All found sub-shapes as compound.
#
# @ref swig_GetShapesOnShapeAsCompound "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
"""
Find in theShape all sub-shapes of type theShapeType,
# @return List of all found sub-shapes indices.
#
# @ref swig_GetShapesOnShapeIDs "Example"
+ @ManageTransactions("ShapesOp")
def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
"""
Find in theShape all sub-shapes of type theShapeType,
# @image html get_in_place_lost_part.png
#
# @ref swig_GetInPlace "Example"
+ @ManageTransactions("ShapesOp")
def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
"""
Get sub-shape(s) of theShapeWhere, which are
Returns:
Group of all found sub-shapes or a single found sub-shape.
-
+
Note:
This function has a restriction on argument shapes.
If theShapeWhere has curved parts with significantly
# @return Group of all found sub-shapes or a single found sub-shape.
#
# @ref swig_GetInPlace "Example"
+ @ManageTransactions("ShapesOp")
def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
"""
Implementation of this method is based on a saved history of an operation,
# @return New GEOM.GEOM_Object for found sub-shape.
#
# @ref swig_GetSame "Example"
+ @ManageTransactions("ShapesOp")
def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
"""
Get sub-shape of theShapeWhere, which is
# equal to \a theShapeWhat.
# @param theShapeWhere Shape to find sub-shape of.
# @param theShapeWhat Shape, specifying what to find.
- # @return List of all found sub-shapes indices.
+ # @return List of all found sub-shapes indices.
#
# @ref swig_GetSame "Example"
+ @ManageTransactions("ShapesOp")
def GetSameIDs(self, theShapeWhere, theShapeWhat):
"""
Get sub-shape indices of theShapeWhere, which is
# @return ID of found sub-shape.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("LocalOp")
def GetSubShapeID(self, aShape, aSubShape):
"""
Obtain unique ID of sub-shape aSubShape inside aShape
anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
return anID
-
+
## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
# This function is provided for performance purpose. The complexity is O(n) with n
# the number of subobjects of aShape
# @return list of IDs of found sub-shapes.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def GetSubShapesIDs(self, aShape, aSubShapes):
"""
Obtain a list of IDs of sub-shapes aSubShapes inside aShape
# @return List of existing sub-objects of \a theShape.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
"""
Get all sub-shapes and groups of theShape,
# @return List of existing groups of \a theShape.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def GetGroups(self, theShape):
"""
Get all groups of theShape,
## Explode a shape on sub-shapes of a given type.
# If the shape itself matches the type, it is also returned.
# @param aShape Shape to be exploded.
- # @param aType Type of sub-shapes to be retrieved (see ShapeType())
+ # @param aType Type of sub-shapes to be retrieved (see ShapeType())
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
# @return List of sub-shapes of type theShapeType, contained in theShape.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def SubShapeAll(self, aShape, aType, theName=None):
"""
Explode a shape on sub-shapes of a given type.
Parameters:
aShape Shape to be exploded.
- aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
+ aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
# @return List of IDs of sub-shapes.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def SubShapeAllIDs(self, aShape, aType):
"""
Explode a shape on sub-shapes of a given type.
Obtain a compound of sub-shapes of aShape,
selected by their indices in list of all sub-shapes of type aType.
Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
-
+
Parameters:
aShape Shape to get sub-shape of.
ListOfID List of sub-shapes indices.
return anObj
## Explode a shape on sub-shapes of a given type.
- # Sub-shapes will be sorted by coordinates of their gravity centers.
+ # Sub-shapes will be sorted taking into account their gravity centers,
+ # to provide stable order of sub-shapes.
# If the shape itself matches the type, it is also returned.
# @param aShape Shape to be exploded.
# @param aType Type of sub-shapes to be retrieved (see ShapeType())
# @return List of sub-shapes of type theShapeType, contained in theShape.
#
# @ref swig_SubShapeAllSorted "Example"
+ @ManageTransactions("ShapesOp")
def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
"""
Explode a shape on sub-shapes of a given type.
- Sub-shapes will be sorted by coordinates of their gravity centers.
+ Sub-shapes will be sorted taking into account their gravity centers,
+ to provide stable order of sub-shapes.
If the shape itself matches the type, it is also returned.
- Parameters:
+ Parameters:
aShape Shape to be exploded.
aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
List of sub-shapes of type theShapeType, contained in theShape.
"""
# Example: see GEOM_TestAll.py
return ListObj
## Explode a shape on sub-shapes of a given type.
- # Sub-shapes will be sorted by coordinates of their gravity centers.
+ # Sub-shapes will be sorted taking into account their gravity centers,
+ # to provide stable order of sub-shapes.
# @param aShape Shape to be exploded.
# @param aType Type of sub-shapes to be retrieved (see ShapeType())
# @return List of IDs of sub-shapes.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def SubShapeAllSortedCentresIDs(self, aShape, aType):
"""
Explode a shape on sub-shapes of a given type.
- Sub-shapes will be sorted by coordinates of their gravity centers.
+ Sub-shapes will be sorted taking into account their gravity centers,
+ to provide stable order of sub-shapes.
- Parameters:
+ Parameters:
aShape Shape to be exploded.
aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
- Returns:
+ Returns:
List of IDs of sub-shapes.
"""
ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
# @return List of sub-shapes of type aType, contained in aShape.
#
# @ref swig_FilletChamfer "Example"
+ @ManageTransactions("ShapesOp")
def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
"""
Extract shapes (excluding the main shape) of given type.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
List of sub-shapes of type aType, contained in aShape.
"""
# Example: see GEOM_TestAll.py
# @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
#
# @ref swig_all_decompose "Example"
+ @ManageTransactions("ShapesOp")
def SubShapes(self, aShape, anIDs, theName=None):
"""
Get a set of sub-shapes defined by their unique IDs inside theMainShape
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
List of GEOM.GEOM_Object, corresponding to found sub-shapes.
"""
# Example: see GEOM_TestAll.py
## Deprecated method
# It works like SubShapeAllSortedCentres(), but wrongly
# defines centres of faces, shells and solids.
+ @ManageTransactions("ShapesOp")
def SubShapeAllSorted(self, aShape, aType, theName=None):
"""
Deprecated method
## Deprecated method
# It works like SubShapeAllSortedCentresIDs(), but wrongly
# defines centres of faces, shells and solids.
+ @ManageTransactions("ShapesOp")
def SubShapeAllSortedIDs(self, aShape, aType):
"""
Deprecated method
# are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
# \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
# ruling out sharp edges).\n
- # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
+ # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
# are of the same magnitude).\n
# \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
# or surfaces (d/du C(u)) are the same at junction. \n
# @return New GEOM.GEOM_Object, containing processed shape.
#
# \n @ref tui_shape_processing "Example"
+ @ManageTransactions("HealOp")
def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
"""
Apply a sequence of Shape Healing operators to the given object.
* SplitContinuity.SurfaceContinuity - required continuity for surfaces.
* SplitContinuity.CurveContinuity - required continuity for curves.
This and the previous parameters can take the following values:
-
+
Parametric Continuity:
C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
coincidental. The curves or surfaces may still meet at an angle,
or surfaces are of the same magnitude).
CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
curves or surfaces (d/du C(u)) are the same at junction.
-
+
Geometric Continuity:
G1: first derivatives are proportional at junction.
The curve tangents thus have the same direction, but not necessarily the same magnitude.
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_suppress_faces "Example"
+ @ManageTransactions("HealOp")
def SuppressFaces(self, theObject, theFaces, theName=None):
"""
Remove faces from the given object (shape).
# publication is switched on, default value is used for result name.
#
# @return New GEOM.GEOM_Object, containing processed shape.
+ @ManageTransactions("HealOp")
def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
"""
Sewing of the given object.
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_remove_webs "Example"
+ @ManageTransactions("HealOp")
def RemoveInternalFaces (self, theCompound, theName=None):
"""
Rebuild the topology of theCompound of solids by removing
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_suppress_internal_wires "Example"
+ @ManageTransactions("HealOp")
def SuppressInternalWires(self, theObject, theWires, theName=None):
"""
Remove internal wires and edges from the given object (face).
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing processed shape.
"""
# Example: see GEOM_TestHealing.py
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_suppress_holes "Example"
+ @ManageTransactions("HealOp")
def SuppressHoles(self, theObject, theWires, theName=None):
"""
Remove internal closed contours (holes) from the given object.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing processed shape.
"""
# Example: see GEOM_TestHealing.py
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_close_contour "Example"
+ @ManageTransactions("HealOp")
def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
"""
Close an open wire.
- Parameters:
+ Parameters:
theObject Shape to be processed.
theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
if [ ], then theObject itself is a wire.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
- New GEOM.GEOM_Object, containing processed shape.
+ Returns:
+ New GEOM.GEOM_Object, containing processed shape.
"""
# Example: see GEOM_TestHealing.py
anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_add_point_on_edge "Example"
+ @ManageTransactions("HealOp")
def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
"""
Addition of a point to a given edge object.
- Parameters:
+ Parameters:
theObject Shape to be processed.
theEdgeIndex Index of edge to be divided within theObject's shape,
if -1, then theObject itself is the edge.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing processed shape.
"""
# Example: see GEOM_TestHealing.py
# @return New GEOM.GEOM_Object with modified wire.
#
# @ref tui_fuse_collinear_edges "Example"
+ @ManageTransactions("HealOp")
def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
"""
Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
- Parameters:
+ Parameters:
theWire Wire to minimize the number of C1 continuous edges in.
theVertices A list of vertices to suppress. If the list
is empty, all vertices in a wire will be assumed.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object with modified wire.
"""
anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
# @return Updated <var>theObject</var>
#
# @ref swig_todo "Example"
+ @ManageTransactions("HealOp")
def ChangeOrientationShell(self,theObject):
"""
Change orientation of the given object. Updates given shape.
- Parameters:
+ Parameters:
theObject Shape to be processed.
- Returns:
+ Returns:
Updated theObject
"""
theObject = self.HealOp.ChangeOrientation(theObject)
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref swig_todo "Example"
+ @ManageTransactions("HealOp")
def ChangeOrientationShellCopy(self, theObject, theName=None):
"""
Change orientation of the given object.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing processed shape.
"""
anObj = self.HealOp.ChangeOrientationCopy(theObject)
# @return New GEOM.GEOM_Object, containing processed shape.
#
# @ref tui_limit_tolerance "Example"
+ @ManageTransactions("HealOp")
def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
"""
Try to limit tolerance of the given object by value theTolerance.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing processed shape.
"""
anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
# \n \a theOpenWires: Open wires on the free boundary of the given shape.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("HealOp")
def GetFreeBoundary(self, theObject, theName=None):
"""
Get a list of wires (wrapped in GEOM.GEOM_Object-s),
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
[status, theClosedWires, theOpenWires]
status: FALSE, if an error(s) occured during the method execution.
theClosedWires: Closed wires on the free boundary of the given shape.
# @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
#
# @ref tui_glue_faces "Example"
+ @ManageTransactions("ShapesOp")
def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
"""
Replace coincident faces in theShape by one face.
# @return GEOM.ListOfGO
#
# @ref tui_glue_faces "Example"
+ @ManageTransactions("ShapesOp")
def GetGlueFaces(self, theShape, theTolerance, theName=None):
"""
Find coincident faces in theShape for possible gluing.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
GEOM.ListOfGO
"""
anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
# without some faces.
#
# @ref tui_glue_faces "Example"
+ @ManageTransactions("ShapesOp")
def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
"""
# @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
#
# @ref tui_glue_edges "Example"
+ @ManageTransactions("ShapesOp")
def MakeGlueEdges(self, theShape, theTolerance, theName=None):
"""
Replace coincident edges in theShape by one edge.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
"""
theTolerance,Parameters = ParseParameters(theTolerance)
# @return GEOM.ListOfGO
#
# @ref tui_glue_edges "Example"
+ @ManageTransactions("ShapesOp")
def GetGlueEdges(self, theShape, theTolerance, theName=None):
"""
Find coincident edges in theShape for possible gluing.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
GEOM.ListOfGO
"""
anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
# without some edges.
#
# @ref tui_glue_edges "Example"
+ @ManageTransactions("ShapesOp")
def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
"""
Replace coincident edges in theShape by one edge
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing a copy of theShape
without some edges.
"""
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fuse "Example"
+ @ManageTransactions("BoolOp")
def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
"""
Perform one of boolean operations on two given shapes.
- Parameters:
+ Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
theOperation Indicates the operation to be done:
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
"""
Perform Common boolean operation on two given shapes.
- Parameters:
+ Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
checkSelfInte The flag that tells if the arguments should
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestOthers.py
"""
Perform Cut boolean operation on two given shapes.
- Parameters:
+ Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
checkSelfInte The flag that tells if the arguments should
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
+ @ManageTransactions("BoolOp")
def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
rmExtraEdges=False, theName=None):
"""
Perform Fuse boolean operation on two given shapes.
- Parameters:
+ Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
checkSelfInte The flag that tells if the arguments should
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
"""
Perform Section boolean operation on two given shapes.
- Parameters:
+ Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
checkSelfInte The flag that tells if the arguments should
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
+ @ManageTransactions("BoolOp")
def MakeFuseList(self, theShapesList, checkSelfInte=False,
rmExtraEdges=False, theName=None):
"""
Perform Fuse boolean operation on the list of shapes.
- Parameters:
+ Parameters:
theShapesList Shapes to be fused.
checkSelfInte The flag that tells if the arguments should
be checked for self-intersection prior to
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
#
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
+ @ManageTransactions("BoolOp")
def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Common boolean operation on the list of shapes.
- Parameters:
+ Parameters:
theShapesList Shapes for Common operation.
checkSelfInte The flag that tells if the arguments should
be checked for self-intersection prior to
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
#
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
+ @ManageTransactions("BoolOp")
def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Cut boolean operation on one object and the list of tools.
- Parameters:
+ Parameters:
theMainShape The object of the operation.
theShapesList The list of tools of the operation.
checkSelfInte The flag that tells if the arguments should
To find all self-intersections please use
CheckSelfIntersections() method.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
-
+
"""
# Example: see GEOM_TestOthers.py
anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
# @return New GEOM.GEOM_Object, containing the result shapes.
#
# @ref tui_partition "Example"
+ @ManageTransactions("BoolOp")
def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
KeepNonlimitShapes=0, theName=None):
"""
Perform partition operation.
- Parameters:
+ Parameters:
ListShapes Shapes to be intersected.
ListTools Shapes to intersect theShapes.
Limit Type of resulting shapes (see geompy.ShapeType)
Each compound from ListShapes and ListTools will be exploded
in order to avoid possible intersection between shapes from
this compound.
-
+
After implementation new version of PartitionAlgo (October 2006) other
parameters are ignored by current functionality. They are kept in this
function only for support old versions.
-
+
Ignored parameters:
ListKeepInside Shapes, outside which the results will be deleted.
Each shape from theKeepInside must belong to theShapes also.
RemoveWebs If TRUE, perform Glue 3D algorithm.
ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shapes.
"""
# Example: see GEOM_TestAll.py
# @return New GEOM.GEOM_Object, containing the result shapes.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BoolOp")
def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0,
compound contains nonintersected shapes. Performance will be better
since intersection between shapes from compound is not performed.
- Parameters:
+ Parameters:
Description of all parameters as in method geompy.MakePartition.
One additional parameter is provided:
checkSelfInte The flag that tells if the arguments should
time-consuming operation that gives an impact on performance.
To find all self-intersections please use
CheckSelfIntersections() method.
-
+
NOTE:
Passed compounds (via ListShapes or via ListTools)
have to consist of nonintersecting shapes.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shapes.
"""
if Limit == self.ShapeType["AUTO"]:
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_partition "Example"
+ @ManageTransactions("BoolOp")
def MakeHalfPartition(self, theShape, thePlane, theName=None):
"""
Perform partition of the Shape with the Plane
- Parameters:
+ Parameters:
theShape Shape to be intersected.
thePlane Tool shape, to intersect theShape.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to translate object itself or create a copy.
# @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
"""
Translate the given object along the vector, specified by its end points.
- Parameters:
+ Parameters:
theObject The object to be translated.
thePoint1 Start point of translation vector.
thePoint2 End point of translation vector.
theCopy Flag used to translate object itself or create a copy.
- Returns:
+ Returns:
Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
"""
#
# @ref tui_translation "Example 1"
# \n @ref swig_MakeTranslationTwoPoints "Example 2"
+ @ManageTransactions("TrsfOp")
def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
"""
Translate the given object along the vector, specified
by its end points, creating its copy before the translation.
- Parameters:
+ Parameters:
theObject The object to be translated.
thePoint1 Start point of translation vector.
thePoint2 End point of translation vector.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the translated object.
"""
# Example: see GEOM_TestAll.py
# new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
#
# @ref tui_translation "Example"
+ @ManageTransactions("TrsfOp")
def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
"""
Translate the given object along the vector, specified by its components.
- Parameters:
+ Parameters:
theObject The object to be translated.
theDX,theDY,theDZ Components of translation vector.
theCopy Flag used to translate object itself or create a copy.
- Returns:
+ Returns:
Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the translated object.
#
# @ref tui_translation "Example"
+ @ManageTransactions("TrsfOp")
def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
"""
Translate the given object along the vector, specified
by its components, creating its copy before the translation.
- Parameters:
+ Parameters:
theObject The object to be translated.
theDX,theDY,theDZ Components of translation vector.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the translated object.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to translate object itself or create a copy.
# @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def TranslateVector(self, theObject, theVector, theCopy=False):
"""
Translate the given object along the given vector.
- Parameters:
+ Parameters:
theObject The object to be translated.
theVector The translation vector.
theCopy Flag used to translate object itself or create a copy.
- Returns:
+ Returns:
Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the translated object.
#
# @ref tui_translation "Example"
+ @ManageTransactions("TrsfOp")
def MakeTranslationVector(self, theObject, theVector, theName=None):
"""
Translate the given object along the given vector,
creating its copy before the translation.
- Parameters:
+ Parameters:
theObject The object to be translated.
theVector The translation vector.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the translated object.
"""
# Example: see GEOM_TestAll.py
# new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
#
# @ref tui_translation "Example"
+ @ManageTransactions("TrsfOp")
def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
"""
Translate the given object along the given vector on given distance.
- Parameters:
+ Parameters:
theObject The object to be translated.
theVector The translation vector.
theDistance The translation distance.
theCopy Flag used to translate object itself or create a copy.
- Returns:
+ Returns:
Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the translated object.
#
# @ref tui_translation "Example"
+ @ManageTransactions("TrsfOp")
def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
"""
Translate the given object along the given vector on given distance,
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the translated object.
"""
# Example: see GEOM_TestAll.py
# new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
#
# @ref tui_rotation "Example"
+ @ManageTransactions("TrsfOp")
def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
"""
Rotate the given object around the given axis on the given angle.
return anObj
## Rotate the given object around the given axis
- # on the given angle, creating its copy before the rotatation.
+ # on the given angle, creating its copy before the rotation.
# @param theObject The object to be rotated.
# @param theAxis Rotation axis.
# @param theAngle Rotation angle in radians.
# @return New GEOM.GEOM_Object, containing the rotated object.
#
# @ref tui_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
"""
Rotate the given object around the given axis
# @param theCopy Flag used to rotate object itself or create a copy.
# @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
"""
Rotate given object around vector perpendicular to plane
# @return New GEOM.GEOM_Object, containing the rotated object.
#
# @ref tui_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
"""
Rotate given object around vector perpendicular to plane
# @param theCopy Flag used to scale object itself or create a copy.
# @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def Scale(self, theObject, thePoint, theFactor, theCopy=False):
"""
Scale the given object by the specified factor.
theFactor Scaling factor value.
theCopy Flag used to scale object itself or create a copy.
- Returns:
+ Returns:
Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the scaled shape.
#
# @ref tui_scale "Example"
+ @ManageTransactions("TrsfOp")
def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
"""
Scale the given object by the factor, creating its copy before the scaling.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the scaled shape.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to scale object itself or create a copy.
# @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
"""
Scale the given object by different factors along coordinate axes.
theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
theCopy Flag used to scale object itself or create a copy.
- Returns:
+ Returns:
Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the scaled shape.
#
# @ref swig_scale "Example"
+ @ManageTransactions("TrsfOp")
def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
"""
Scale the given object by different factors along coordinate axes,
# @param theCopy Flag used to mirror object itself or create a copy.
# @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def MirrorByPlane(self, theObject, thePlane, theCopy=False):
"""
Mirror an object relatively the given plane.
# @return New GEOM.GEOM_Object, containing the mirrored shape.
#
# @ref tui_mirror "Example"
+ @ManageTransactions("TrsfOp")
def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
"""
Create an object, symmetrical to the given one relatively the given plane.
# @param theCopy Flag used to mirror object itself or create a copy.
# @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def MirrorByAxis(self, theObject, theAxis, theCopy=False):
"""
Mirror an object relatively the given axis.
# @return New GEOM.GEOM_Object, containing the mirrored shape.
#
# @ref tui_mirror "Example"
+ @ManageTransactions("TrsfOp")
def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
"""
Create an object, symmetrical to the given one relatively the given axis.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the mirrored shape.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to mirror object itself or create a copy.
# @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def MirrorByPoint(self, theObject, thePoint, theCopy=False):
"""
Mirror an object relatively the given point.
# @return New GEOM.GEOM_Object, containing the mirrored shape.
#
# @ref tui_mirror "Example"
+ @ManageTransactions("TrsfOp")
def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
"""
Create an object, symmetrical
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the mirrored shape.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to displace object itself or create a copy.
# @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
"""
Modify the Location of the given object by LCS, creating its copy before the setting.
# @return New GEOM.GEOM_Object, containing the displaced shape.
#
# @ref tui_modify_location "Example"
+ @ManageTransactions("TrsfOp")
def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
"""
Modify the Location of the given object by LCS, creating its copy before the setting.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the displaced shape.
Example of usage:
# new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
#
# @ref tui_modify_location "Example"
+ @ManageTransactions("TrsfOp")
def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
"""
Modify the Location of the given object by Path.
theCopy is to create a copy objects if true.
theReverse 0 - for usual direction, 1 - to reverse path direction.
- Returns:
+ Returns:
Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
# publication is switched on, default value is used for result name.
#
# @return New GEOM.GEOM_Object, containing the displaced shape.
+ @ManageTransactions("TrsfOp")
def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
"""
Modify the Location of the given object by Path, creating its copy before the operation.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the displaced shape.
"""
# Example: see GEOM_TestAll.py
# @param theCopy Flag used to offset object itself or create a copy.
# @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
# new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
+ @ManageTransactions("TrsfOp")
def Offset(self, theObject, theOffset, theCopy=False):
"""
Offset given shape.
theOffset Offset value.
theCopy Flag used to offset object itself or create a copy.
- Returns:
+ Returns:
Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
"""
# @return New GEOM.GEOM_Object, containing the offset object.
#
# @ref tui_offset "Example"
+ @ManageTransactions("TrsfOp")
def MakeOffset(self, theObject, theOffset, theName=None):
"""
Create new object as offset of the given one.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the offset object.
Example of usage:
# @return New GEOM.GEOM_Object, containing the projection.
#
# @ref tui_projection "Example"
+ @ManageTransactions("TrsfOp")
def MakeProjection(self, theSource, theTarget, theName=None):
"""
Create new object as projection of the given one on a 2D surface.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the projection.
"""
# Example: see GEOM_TestAll.py
RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
self._autoPublish(anObj, theName, "projection")
return anObj
-
+
## Create a projection projection of the given point on a wire or an edge.
# If there are no solutions or there are 2 or more solutions It throws an
# exception.
# \n \a EdgeInWireIndex: The index of an edge in a wire.
#
# @ref tui_projection "Example"
+ @ManageTransactions("TrsfOp")
def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
"""
Create a projection projection of the given point on a wire or an edge.
If there are no solutions or there are 2 or more solutions It throws an
exception.
-
+
Parameters:
thePoint the point to be projected.
theWire the wire. The edge is accepted as well.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
+
Returns:
[u, PointOnEdge, EdgeInWireIndex]
u: The parameter of projection point on edge.
# the shapes, obtained after each translation.
#
# @ref tui_multi_translation "Example"
+ @ManageTransactions("TrsfOp")
def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
"""
Translate the given object along the given vector a given number times
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing compound of all
the shapes, obtained after each translation.
# the shapes, obtained after each translation.
#
# @ref tui_multi_translation "Example"
+ @ManageTransactions("TrsfOp")
def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
theVector2, theStep2, theNbTimes2, theName=None):
"""
# shapes, obtained after each rotation.
#
# @ref tui_multi_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
"""
Rotate the given object around the given axis a given number times.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing compound of all the
shapes, obtained after each rotation.
# shapes, obtained after each rotation.
#
# @ref tui_multi_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
"""
Rotate the given object around the given axis
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing compound of all the
shapes, obtained after each rotation.
# shapes, obtained after each transformation.
#
# @ref tui_multi_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
"""
Rotate the given object around the
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing compound of all the
shapes, obtained after each transformation.
# shapes, obtained after each transformation.
#
# @ref tui_multi_rotation "Example"
+ @ManageTransactions("TrsfOp")
def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
"""
Rotate the given object around the
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing compound of all the
shapes, obtained after each transformation.
def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
"""
The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
-
+
Example of usage:
pz = geompy.MakeVertex(0, 0, 100)
vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
"""
The same, as MultiRotate2DByStep(), but axis is given by direction and point
-
+
Example of usage:
pz = geompy.MakeVertex(0, 0, 100)
vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
# This method is DEPRECATED. Use MultiRotate2DByStep() instead.
+ @ManageTransactions("TrsfOp")
def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
"""
The same, as MultiRotate2DByStep(), but theAngle is in degrees.
"""
The same, as MultiRotate2D(), but axis is given by direction and point
This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
-
+
Example of usage:
pz = geompy.MakeVertex(0, 0, 100)
vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
#
# @ref tui_fillet "Example 1"
# \n @ref swig_MakeFilletAll "Example 2"
+ @ManageTransactions("LocalOp")
def MakeFilletAll(self, theShape, theR, theName=None):
"""
Perform a fillet on all edges of the given shape.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
- Example of usage:
+ Example of usage:
filletall = geompy.MakeFilletAll(prism, 10.)
"""
# Example: see GEOM_TestOthers.py
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fillet "Example"
+ @ManageTransactions("LocalOp")
def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
"""
Perform a fillet on the specified edges/faces of the given shape
Note:
Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
return anObj
## The same that MakeFillet() but with two Fillet Radius R1 and R2
+ @ManageTransactions("LocalOp")
def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
"""
The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fillet2d "Example"
+ @ManageTransactions("LocalOp")
def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
"""
Perform a fillet on the specified edges of the given shape
The list of vertices could be empty,in this case fillet will done done at all vertices in wire
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
- Example of usage:
+ Example of usage:
# create wire
Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
# make fillet at given wire vertices with giver radius
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fillet2d "Example"
+ @ManageTransactions("LocalOp")
def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
"""
Perform a fillet at the specified vertices of the given face/shell.
Note:
Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
#
# @ref tui_chamfer "Example 1"
# \n @ref swig_MakeChamferAll "Example 2"
+ @ManageTransactions("LocalOp")
def MakeChamferAll(self, theShape, theD, theName=None):
"""
Perform a symmetric chamfer on all edges of the given shape.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_chamfer "Example"
+ @ManageTransactions("LocalOp")
def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
"""
Perform a chamfer on edges, common to the specified faces,
Note:
Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
# @note Global index of sub-shape can be obtained, using method GetSubShapeID().
#
# @return New GEOM.GEOM_Object, containing the result shape.
+ @ManageTransactions("LocalOp")
def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
"""
Perform a chamfer on edges
Note:
Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
Example of usage:
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_chamfer "Example"
+ @ManageTransactions("LocalOp")
def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
"""
Perform a chamfer on all edges of the specified faces,
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
-
+
Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
# theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
#
# @ref swig_FilletChamfer "Example"
+ @ManageTransactions("LocalOp")
def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
"""
The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref swig_FilletChamfer "Example"
+ @ManageTransactions("LocalOp")
def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
"""
Perform a chamfer on edges,
with distance D1 on the first specified face (if several for one edge)
-
+
Parameters:
theShape Shape, to perform chamfer on.
theD1,theD2 Chamfer size
## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
# theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
+ @ManageTransactions("LocalOp")
def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
"""
The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
else:
anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
return anObj
-
+
## Remove material from a solid by extrusion of the base shape on the given distance.
- # @param theInit Shape to remove material from. It must be a solid or
+ # @param theInit Shape to remove material from. It must be a solid or
# a compound made of a single solid.
# @param theBase Closed edge or wire defining the base shape to be extruded.
# @param theH Prism dimension along the normal to theBase
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
- # @return New GEOM.GEOM_Object, containing the initial shape with removed material
+ # @return New GEOM.GEOM_Object, containing the initial shape with removed material
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
"""
Add material to a solid by extrusion of the base shape on the given distance.
RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
#anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "extrudedCut")
- return anObj
-
+ return anObj
+
## Add material to a solid by extrusion of the base shape on the given distance.
- # @param theInit Shape to add material to. It must be a solid or
+ # @param theInit Shape to add material to. It must be a solid or
# a compound made of a single solid.
# @param theBase Closed edge or wire defining the base shape to be extruded.
# @param theH Prism dimension along the normal to theBase
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
- # @return New GEOM.GEOM_Object, containing the initial shape with added material
+ # @return New GEOM.GEOM_Object, containing the initial shape with added material
#
# @ref tui_creation_prism "Example"
+ @ManageTransactions("PrimOp")
def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
"""
Add material to a solid by extrusion of the base shape on the given distance.
RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
#anObj.SetParameters(Parameters)
self._autoPublish(anObj, theName, "extrudedBoss")
- return anObj
+ return anObj
# end of l3_local
## @}
# by a plane, corresponding to water level.
#
# @ref tui_archimede "Example"
+ @ManageTransactions("LocalOp")
def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
"""
Perform an Archimde operation on the given shape with given parameters.
The object presenting the resulting face is returned.
- Parameters:
+ Parameters:
theShape Shape to be put in water.
theWeight Weight og the shape.
theWaterDensity Density of the water.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing a section of theShape
by a plane, corresponding to water level.
"""
# @return [x, y, z]
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def PointCoordinates(self,Point):
"""
Get point coordinates
# Example: see GEOM_TestMeasures.py
aTuple = self.MeasuOp.PointCoordinates(Point)
RaiseIfFailed("PointCoordinates", self.MeasuOp)
- return aTuple
-
+ return aTuple
+
## Get vector coordinates
# @return [x, y, z]
#
p1=self.GetFirstVertex(Vector)
p2=self.GetLastVertex(Vector)
-
+
X1=self.PointCoordinates(p1)
X2=self.PointCoordinates(p2)
#
# @ref tui_measurement_tools_page "Example"
def CrossProduct(self, Vector1, Vector2):
- """
+ """
Compute cross product
-
+
Returns: vector w=u^v
"""
u=self.VectorCoordinates(Vector1)
v=self.VectorCoordinates(Vector2)
w=self.MakeVectorDXDYDZ(u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[0]*v[1]-u[1]*v[0])
-
+
return w
-
+
## Compute cross product
# @return dot product p=u.v
#
# @ref tui_measurement_tools_page "Example"
def DotProduct(self, Vector1, Vector2):
- """
+ """
Compute cross product
-
+
Returns: dot product p=u.v
"""
u=self.VectorCoordinates(Vector1)
v=self.VectorCoordinates(Vector2)
p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
-
+
return p
# theVolume: Volume of the given shape.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def BasicProperties(self,theShape):
"""
Get summarized length of all wires,
area of surface and volume of the given shape.
- Parameters:
+ Parameters:
theShape Shape to define properties of.
Returns:
# Zmin,Zmax: Limits of shape along OZ axis.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def BoundingBox (self, theShape, precise=False):
"""
Get parameters of bounding box of the given shape
- Parameters:
+ Parameters:
theShape Shape to obtain bounding box of.
precise TRUE for precise computation; FALSE for fast one.
# @return New GEOM.GEOM_Object, containing the created box.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def MakeBoundingBox (self, theShape, precise=False, theName=None):
"""
Get bounding box of the given shape
- Parameters:
+ Parameters:
theShape Shape to obtain bounding box of.
precise TRUE for precise computation; FALSE for fast one.
theName Object name; when specified, this parameter is used
# Ix,Iy,Iz: Moments of inertia of the given shape.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def Inertia(self,theShape):
"""
Get inertia matrix and moments of inertia of theShape.
- Parameters:
+ Parameters:
theShape Shape to calculate inertia of.
Returns:
# @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
# @param tolerance to be used (default is 1.0e-7)
# @return list_of_boolean = [res1, res2, ...]
+ @ManageTransactions("MeasuOp")
def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
"""
Get if coords are included in the shape (ST_IN or ST_ON)
-
- Parameters:
+
+ Parameters:
theShape Shape
coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
tolerance to be used (default is 1.0e-7)
# @return Value of the minimal distance between the given shapes.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def MinDistance(self, theShape1, theShape2):
"""
Get minimal distance between the given shapes.
-
- Parameters:
+
+ Parameters:
theShape1,theShape2 Shapes to find minimal distance between.
- Returns:
+ Returns:
Value of the minimal distance between the given shapes.
"""
# Example: see GEOM_TestMeasures.py
# [Distance, DX, DY, DZ].
#
# @ref swig_all_measure "Example"
+ @ManageTransactions("MeasuOp")
def MinDistanceComponents(self, theShape1, theShape2):
"""
Get minimal distance between the given shapes.
- Parameters:
+ Parameters:
theShape1,theShape2 Shapes to find minimal distance between.
- Returns:
+ Returns:
Value of the minimal distance between the given shapes, in form of list
[Distance, DX, DY, DZ]
"""
# solutions) and a list of (X, Y, Z) coordinates for all couples of points.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def ClosestPoints (self, theShape1, theShape2):
"""
Get closest points of the given shapes.
- Parameters:
+ Parameters:
theShape1,theShape2 Shapes to find closest points of.
- Returns:
+ Returns:
The number of found solutions (-1 in case of infinite number of
solutions) and a list of (X, Y, Z) coordinates for all couples of points.
"""
# @return Value of the angle between the given shapes in degrees.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def GetAngle(self, theShape1, theShape2):
"""
Get angle between the given shapes in degrees.
- Parameters:
+ Parameters:
theShape1,theShape2 Lines or linear edges to find angle between.
Note:
If both arguments are vectors, the angle is computed in accordance
with their orientations, otherwise the minimum angle is computed.
- Returns:
+ Returns:
Value of the angle between the given shapes in degrees.
"""
# Example: see GEOM_TestMeasures.py
# @return Value of the angle between the given shapes in radians.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def GetAngleRadians(self, theShape1, theShape2):
"""
Get angle between the given shapes in radians.
- Parameters:
+ Parameters:
theShape1,theShape2 Lines or linear edges to find angle between.
-
+
Note:
If both arguments are vectors, the angle is computed in accordance
with their orientations, otherwise the minimum angle is computed.
- Returns:
+ Returns:
Value of the angle between the given shapes in radians.
"""
# Example: see GEOM_TestMeasures.py
# @return Value of the angle between the given vectors in degrees.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
"""
Get angle between the given vectors in degrees.
- Parameters:
+ Parameters:
theShape1,theShape2 Vectors to find angle between.
theFlag If True, the normal vector is defined by the two vectors cross,
if False, the opposite vector to the normal vector is used.
- Returns:
+ Returns:
Value of the angle between the given vectors in degrees.
"""
anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
"""
Get angle between the given vectors in radians.
- Parameters:
+ Parameters:
theShape1,theShape2 Vectors to find angle between.
theFlag If True, the normal vector is defined by the two vectors cross,
if False, the opposite vector to the normal vector is used.
- Returns:
+ Returns:
Value of the angle between the given vectors in radians.
"""
anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
# @return radius of curvature of \a theCurve.
#
# @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def CurveCurvatureByParam(self, theCurve, theParam):
"""
Measure curvature of a curve at a point, set by parameter.
- Parameters:
+ Parameters:
theCurve a curve.
theParam parameter.
- Returns:
+ Returns:
radius of curvature of theCurve.
"""
# Example: see GEOM_TestMeasures.py
# @return radius of curvature of \a theCurve.
#
# @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def CurveCurvatureByPoint(self, theCurve, thePoint):
"""
Measure curvature of a curve at a point.
- Parameters:
+ Parameters:
theCurve a curve.
thePoint given point.
- Returns:
- radius of curvature of theCurve.
+ Returns:
+ radius of curvature of theCurve.
"""
aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
# @return max radius of curvature of theSurf.
#
## @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
"""
Measure max radius of curvature of surface.
- Parameters:
+ Parameters:
theSurf the given surface.
theUParam Value of U-parameter on the referenced surface.
theVParam Value of V-parameter on the referenced surface.
-
- Returns:
+
+ Returns:
max radius of curvature of theSurf.
"""
# Example: see GEOM_TestMeasures.py
# @return max radius of curvature of theSurf.
#
## @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
"""
Measure max radius of curvature of surface in the given point.
- Parameters:
+ Parameters:
theSurf the given surface.
thePoint given point.
-
- Returns:
- max radius of curvature of theSurf.
+
+ Returns:
+ max radius of curvature of theSurf.
"""
aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
# @param theUParam Value of U-parameter on the referenced surface.
# @param theVParam Value of V-parameter on the referenced surface.
# @return min radius of curvature of theSurf.
- #
+ #
## @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
"""
Measure min radius of curvature of surface.
- Parameters:
+ Parameters:
theSurf the given surface.
theUParam Value of U-parameter on the referenced surface.
theVParam Value of V-parameter on the referenced surface.
-
- Returns:
+
+ Returns:
Min radius of curvature of theSurf.
"""
aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
# @return min radius of curvature of theSurf.
#
## @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
"""
Measure min radius of curvature of surface in the given point.
- Parameters:
+ Parameters:
theSurf the given surface.
thePoint given point.
-
- Returns:
- Min radius of curvature of theSurf.
+
+ Returns:
+ Min radius of curvature of theSurf.
"""
aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
# VertMin,VertMax: Min and max tolerances of the vertices.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def Tolerance(self,theShape):
"""
Get min and max tolerances of sub-shapes of theShape
- Parameters:
+ Parameters:
theShape Shape, to get tolerances of.
- Returns:
+ Returns:
[FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
FaceMin,FaceMax: Min and max tolerances of the faces.
EdgeMin,EdgeMax: Min and max tolerances of the edges.
# @return Description of the given shape.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def WhatIs(self,theShape):
"""
Obtain description of the given shape (number of sub-shapes of each type)
# @return New GEOM.GEOM_Object, containing the created point.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def MakeCDG(self, theShape, theName=None):
"""
Get a point, situated at the centre of mass of theShape.
# @return New GEOM.GEOM_Object, containing the created vertex.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def GetVertexByIndex(self, theShape, theIndex, theName=None):
"""
Get a vertex sub-shape by index depended with orientation.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created vertex.
"""
# Example: see GEOM_TestMeasures.py
# note: auto-publishing is done in self.GetVertexByIndex()
- anObj = self.GetVertexByIndex(theShape, 0, theName)
- RaiseIfFailed("GetFirstVertex", self.MeasuOp)
- return anObj
+ return self.GetVertexByIndex(theShape, 0, theName)
## Get the last vertex of wire/edge depended orientation.
# @param theShape Shape to find last vertex.
"""
Get the last vertex of wire/edge depended orientation.
- Parameters:
+ Parameters:
theShape Shape to find last vertex.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created vertex.
"""
# Example: see GEOM_TestMeasures.py
- nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
+ nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
# note: auto-publishing is done in self.GetVertexByIndex()
- anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
- RaiseIfFailed("GetLastVertex", self.MeasuOp)
- return anObj
+ return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
## Get a normale to the given face. If the point is not given,
# the normale is calculated at the center of mass.
# @return New GEOM.GEOM_Object, containing the created vector.
#
# @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
"""
Get a normale to the given face. If the point is not given,
the normale is calculated at the center of mass.
-
- Parameters:
+
+ Parameters:
theFace Face to define normale of.
theOptionalPoint Point to compute the normale at.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created vector.
"""
# Example: see GEOM_TestMeasures.py
# Otherwise doesn't return anything.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
"""
Print shape errors obtained from CheckShape.
# returned along with IsValid flag.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
"""
Check a topology of the given shape.
- Parameters:
+ Parameters:
theShape Shape to check validity of.
theIsCheckGeom If FALSE, only the shape's topology will be checked,
if TRUE, the shape's geometry will be checked also.
If 2 IsValid flag and the list of error data
is returned.
- Returns:
+ Returns:
TRUE, if the shape "seems to be valid".
If theShape is invalid, prints a description of problem.
If theReturnStatus is equal to 1 the description is returned
# @return TRUE, if the shape contains no self-intersections.
#
# @ref tui_measurement_tools_page "Example"
+ @ManageTransactions("MeasuOp")
def CheckSelfIntersections(self, theShape):
"""
Detect self-intersections in the given shape.
- Parameters:
+ Parameters:
theShape Shape to check.
- Returns:
+ Returns:
TRUE, if the shape contains no self-intersections.
"""
# Example: see GEOM_TestMeasures.py
# Xx,Xy,Xz: Coordinates of shape's LCS X direction.
#
# @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def GetPosition(self,theShape):
"""
Get position (LCS) of theShape.
Axes of the LCS are obtained from shape's location or,
if the shape is a planar face, from position of its plane.
- Parameters:
+ Parameters:
theShape Shape to calculate position of.
- Returns:
+ Returns:
[Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
Ox,Oy,Oz: Coordinates of shape's LCS origin.
Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
# or \a theDoubles list depends on the kind() of the shape.
#
# @ref swig_todo "Example"
+ @ManageTransactions("MeasuOp")
def KindOfShape(self,theShape):
"""
Get kind of theShape.
-
- Parameters:
+
+ Parameters:
theShape Shape to get a kind of.
Returns:
return aKindTuple
+ ## Returns the string that describes if the shell is good for solid.
+ # This is a support method for MakeSolid.
+ #
+ # @param theShell the shell to be checked.
+ # @return Returns a string that describes the shell validity for
+ # solid construction.
+ @ManageTransactions("MeasuOp")
+ def _IsGoodForSolid(self, theShell):
+ """
+ Returns the string that describes if the shell is good for solid.
+ This is a support method for MakeSolid.
+
+ Parameter:
+ theShell the shell to be checked.
+
+ Returns:
+ Returns a string that describes the shell validity for
+ solid construction.
+ """
+ aDescr = self.MeasuOp.IsGoodForSolid(theShell)
+ return aDescr
+
# end of l2_measure
## @}
## @addtogroup l2_import_export
## @{
- ## Import a shape from the BREP or IGES or STEP file
+ ## Import a shape from the BREP, IGES, STEP or other file
# (depends on given format) with given name.
+ #
+ # Note: this function is deprecated, it is kept for backward compatibility only
+ # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
+ #
# @param theFileName The file, containing the shape.
# @param theFormatName Specify format for the file reading.
# Available formats can be obtained with InsertOp.ImportTranslators() method.
# material groups are not automatically published.
#
# @ref swig_Import_Export "Example"
+ @ManageTransactions("InsertOp")
def ImportFile(self, theFileName, theFormatName, theName=None):
"""
- Import a shape from the BREP or IGES or STEP file
+ Import a shape from the BREP, IGES, STEP or other file
(depends on given format) with given name.
+ Note: this function is deprecated, it is kept for backward compatibility only
+ Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
+
Parameters:
theFileName The file, containing the shape.
theFormatName Specify format for the file reading.
material groups are not automatically published.
"""
# Example: see GEOM_TestOthers.py
+ print """
+ WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
+ where <FormatName> is a name of desirable format for importing.
+ """
aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
RaiseIfFailed("ImportFile", self.InsertOp)
aNbObj = len(aListObj)
"""
Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
"""
- print "WARNING: Function Import is deprecated, use ImportFile instead"
# note: auto-publishing is done in self.ImportFile()
return self.ImportFile(theFileName, theFormatName, theName)
- ## Shortcut to ImportFile() for BREP format.
- # Import a shape from the BREP file with given name.
- # @param theFileName The file, containing the shape.
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM.GEOM_Object, containing the imported shape.
- #
- # @ref swig_Import_Export "Example"
- def ImportBREP(self, theFileName, theName=None):
- """
- geompy.ImportFile(...) function for BREP format
- Import a shape from the BREP file with given name.
-
- Parameters:
- theFileName The file, containing the shape.
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM.GEOM_Object, containing the imported shape.
- """
- # Example: see GEOM_TestOthers.py
- # note: auto-publishing is done in self.ImportFile()
- return self.ImportFile(theFileName, "BREP", theName)
-
- ## Shortcut to ImportFile() for IGES format
- # Import a shape from the IGES file with given name.
- # @param theFileName The file, containing the shape.
- # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
- # and result model will be scaled, if its units are not meters.
- # If False (default), file length units will be taken into account.
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM.GEOM_Object, containing the imported shape.
- #
- # @ref swig_Import_Export "Example"
- def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
- """
- geompy.ImportFile(...) function for IGES format
-
- Parameters:
- theFileName The file, containing the shape.
- ignoreUnits If True, file length units will be ignored (set to 'meter')
- and result model will be scaled, if its units are not meters.
- If False (default), file length units will be taken into account.
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM.GEOM_Object, containing the imported shape.
- """
- # Example: see GEOM_TestOthers.py
- # note: auto-publishing is done in self.ImportFile()
- if ignoreUnits:
- return self.ImportFile(theFileName, "IGES_SCALE", theName)
- return self.ImportFile(theFileName, "IGES", theName)
-
- ## Return length unit from given IGES file
- # @param theFileName The file, containing the shape.
- # @return String, containing the units name.
- #
- # @ref swig_Import_Export "Example"
- def GetIGESUnit(self, theFileName):
- """
- Return length units from given IGES file
-
- Parameters:
- theFileName The file, containing the shape.
-
- Returns:
- String, containing the units name.
- """
- # Example: see GEOM_TestOthers.py
- aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
- return aUnitName
-
- ## Shortcut to ImportFile() for STEP format
- # Import a shape from the STEP file with given name.
- # @param theFileName The file, containing the shape.
- # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
- # and result model will be scaled, if its units are not meters.
- # If False (default), file length units will be taken into account.
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM.GEOM_Object, containing the imported shape.
- # If material names are imported it returns the list of
- # objects. The first one is the imported object followed by
- # material groups.
- # @note Auto publishing is allowed for the shape itself. Imported
- # material groups are not automatically published.
- #
- # @ref swig_Import_Export "Example"
- def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
- """
- geompy.ImportFile(...) function for STEP format
-
- Parameters:
- theFileName The file, containing the shape.
- ignoreUnits If True, file length units will be ignored (set to 'meter')
- and result model will be scaled, if its units are not meters.
- If False (default), file length units will be taken into account.
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM.GEOM_Object, containing the imported shape.
- If material names are imported it returns the list of
- objects. The first one is the imported object followed by
- material groups.
- Note:
- Auto publishing is allowed for the shape itself. Imported
- material groups are not automatically published.
- """
- # Example: see GEOM_TestOthers.py
- # note: auto-publishing is done in self.ImportFile()
- if ignoreUnits:
- return self.ImportFile(theFileName, "STEP_SCALE", theName)
- return self.ImportFile(theFileName, "STEP", theName)
-
- ## Return length unit from given IGES or STEP file
- # @param theFileName The file, containing the shape.
- # @return String, containing the units name.
- #
- # @ref swig_Import_Export "Example"
- def GetSTEPUnit(self, theFileName):
- """
- Return length units from given STEP file
-
- Parameters:
- theFileName The file, containing the shape.
-
- Returns:
- String, containing the units name.
- """
- # Example: see GEOM_TestOthers.py
- aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
- return aUnitName
-
## Read a shape from the binary stream, containing its bounding representation (BRep).
# @note This method will not be dumped to the python script by DumpStudy functionality.
# @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
# @return New GEOM_Object, containing the shape, read from theStream.
#
# @ref swig_Import_Export "Example"
+ @ManageTransactions("InsertOp")
def RestoreShape (self, theStream, theName=None):
"""
Read a shape from the binary stream, containing its bounding representation (BRep).
Note:
shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
- Parameters:
+ Parameters:
theStream The BRep binary stream.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
return anObj
## Export the given shape into a file with given name.
+ #
+ # Note: this function is deprecated, it is kept for backward compatibility only
+ # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
+ #
# @param theObject Shape to be stored in the file.
# @param theFileName Name of the file to store the given shape in.
# @param theFormatName Specify format for the shape storage.
# geompy.InsertOp.ExportTranslators()[0] method.
#
# @ref swig_Import_Export "Example"
+ @ManageTransactions("InsertOp")
def Export(self, theObject, theFileName, theFormatName):
"""
Export the given shape into a file with given name.
+ Note: this function is deprecated, it is kept for backward compatibility only
+ Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
+
Parameters:
theObject Shape to be stored in the file.
theFileName Name of the file to store the given shape in.
geompy.InsertOp.ExportTranslators()[0] method.
"""
# Example: see GEOM_TestOthers.py
+ print """
+ WARNING: Function Export is deprecated, use Export<FormatName> instead,
+ where <FormatName> is a name of desirable format for exporting.
+ """
self.InsertOp.Export(theObject, theFileName, theFormatName)
if self.InsertOp.IsDone() == 0:
raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
pass
pass
- ## Shortcut to Export() for BREP format
- #
- # @ref swig_Import_Export "Example"
- def ExportBREP(self,theObject, theFileName):
- """
- geompy.Export(...) function for BREP format
- """
- # Example: see GEOM_TestOthers.py
- return self.Export(theObject, theFileName, "BREP")
-
- ## Shortcut to Export() for IGES format
- #
- # @ref swig_Import_Export "Example"
- def ExportIGES(self,theObject, theFileName):
- """
- geompy.Export(...) function for IGES format
- """
- # Example: see GEOM_TestOthers.py
- return self.Export(theObject, theFileName, "IGES")
-
- ## Shortcut to Export() for STEP format
- #
- # @ref swig_Import_Export "Example"
- def ExportSTEP(self,theObject, theFileName):
- """
- geompy.Export(...) function for STEP format
- """
- # Example: see GEOM_TestOthers.py
- return self.Export(theObject, theFileName, "STEP")
-
# end of l2_import_export
## @}
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_building_by_blocks_page "Example"
+ @ManageTransactions("BlocksOp")
def MakeQuad(self, E1, E2, E3, E4, theName=None):
"""
Create a quadrangle face from four edges. Order of Edges is not
important. It is not necessary that edges share the same vertex.
- Parameters:
+ Parameters:
E1,E2,E3,E4 Edges for the face bound.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created face.
- Example of usage:
+ Example of usage:
qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
"""
# Example: see GEOM_Spanner.py
# @return New GEOM.GEOM_Object, containing the created face.
#
# @ref tui_building_by_blocks_page "Example"
+ @ManageTransactions("BlocksOp")
def MakeQuad2Edges(self, E1, E2, theName=None):
"""
Create a quadrangle face on two edges.
The missing edges will be built by creating the shortest ones.
- Parameters:
+ Parameters:
E1,E2 Two opposite edges for the face.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created face.
-
+
Example of usage:
# create vertices
p1 = geompy.MakeVertex( 0., 0., 0.)
#
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeQuad4Vertices "Example 2"
+ @ManageTransactions("BlocksOp")
def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
"""
Create a quadrangle face with specified corners.
The missing edges will be built by creating the shortest ones.
- Parameters:
+ Parameters:
V1,V2,V3,V4 Corner vertices for the face.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created face.
Example of usage:
#
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeHexa "Example 2"
+ @ManageTransactions("BlocksOp")
def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
"""
Create a hexahedral solid, bounded by the six given faces. Order of
faces is not important. It is not necessary that Faces share the same edge.
- Parameters:
+ Parameters:
F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the created solid.
Example of usage:
#
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeHexa2Faces "Example 2"
+ @ManageTransactions("BlocksOp")
def MakeHexa2Faces(self, F1, F2, theName=None):
"""
Create a hexahedral solid between two given faces.
The missing faces will be built by creating the smallest ones.
- Parameters:
+ Parameters:
F1,F2 Two opposite faces for the hexahedral solid.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
# @return New GEOM.GEOM_Object, containing the found vertex.
#
# @ref swig_GetPoint "Example"
+ @ManageTransactions("BlocksOp")
def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
"""
Get a vertex, found in the given shape by its coordinates.
- Parameters:
+ Parameters:
theShape Block or a compound of blocks.
theX,theY,theZ Coordinates of the sought vertex.
theEpsilon Maximum allowed distance between the resulting
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the found vertex.
Example of usage:
# @return New GEOM.GEOM_Object, containing the found vertex.
#
# @ref swig_GetVertexNearPoint "Example"
+ @ManageTransactions("BlocksOp")
def GetVertexNearPoint(self, theShape, thePoint, theName=None):
"""
Find a vertex of the given shape, which has minimal distance to the given point.
- Parameters:
+ Parameters:
theShape Any shape.
thePoint Point, close to the desired vertex.
theName Object name; when specified, this parameter is used
# @return New GEOM.GEOM_Object, containing the found edge.
#
# @ref swig_GetEdge "Example"
+ @ManageTransactions("BlocksOp")
def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
"""
Get an edge, found in the given shape by two given vertices.
- Parameters:
+ Parameters:
theShape Block or a compound of blocks.
thePoint1,thePoint2 Points, close to the ends of the desired edge.
theName Object name; when specified, this parameter is used
# @return New GEOM.GEOM_Object, containing the found edge.
#
# @ref swig_GetEdgeNearPoint "Example"
+ @ManageTransactions("BlocksOp")
def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
"""
Find an edge of the given shape, which has minimal distance to the given point.
- Parameters:
+ Parameters:
theShape Block or a compound of blocks.
thePoint Point, close to the desired edge.
theName Object name; when specified, this parameter is used
# @return New GEOM.GEOM_Object, containing the found face.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BlocksOp")
def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
"""
Returns a face, found in the given shape by four given corner vertices.
# @return New GEOM.GEOM_Object, containing the found face.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BlocksOp")
def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
"""
Get a face of block, found in the given shape by two given edges.
# @return New GEOM.GEOM_Object, containing the found face.
#
# @ref swig_GetOppositeFace "Example"
+ @ManageTransactions("BlocksOp")
def GetOppositeFace(self, theBlock, theFace, theName=None):
"""
Find a face, opposite to the given one in the given block.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM.GEOM_Object, containing the found face.
"""
# Example: see GEOM_Spanner.py
# @return New GEOM.GEOM_Object, containing the found face.
#
# @ref swig_GetFaceNearPoint "Example"
+ @ManageTransactions("BlocksOp")
def GetFaceNearPoint(self, theShape, thePoint, theName=None):
"""
Find a face of the given shape, which has minimal distance to the given point.
# @return New GEOM.GEOM_Object, containing the found face.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BlocksOp")
def GetFaceByNormale(self, theBlock, theVector, theName=None):
"""
Find a face of block, whose outside normale has minimal angle with the given vector.
# @return New GEOM_Object, containing a group of all found shapes.
#
# @ref swig_GetShapesNearPoint "Example"
+ @ManageTransactions("BlocksOp")
def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
"""
Find all sub-shapes of type theShapeType of the given shape,
#
# @ref tui_measurement_tools_page "Example 1"
# \n @ref swig_CheckCompoundOfBlocks "Example 2"
+ @ManageTransactions("BlocksOp")
def CheckCompoundOfBlocks(self,theCompound):
"""
Check, if the compound of blocks is given.
Returns:
TRUE, if the given shape is a compound of blocks.
- If theCompound is not valid, prints all discovered errors.
+ If theCompound is not valid, prints all discovered errors.
"""
# Example: see GEOM_Spanner.py
(IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
#
# @ref tui_measurement_tools_page "Example 1"
# \n @ref swig_GetNonBlocks "Example 2"
+ @ManageTransactions("BlocksOp")
def GetNonBlocks (self, theShape, theName=None):
"""
Retrieve all non blocks solids and faces from theShape.
# @return Improved shape.
#
# @ref swig_RemoveExtraEdges "Example"
+ @ManageTransactions("BlocksOp")
def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
"""
Remove all seam and degenerated edges from theShape.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
Improved shape.
"""
# Example: see GEOM_TestOthers.py
# @return Improved shape.
#
# @ref swig_UnionFaces "Example"
+ @ManageTransactions("BlocksOp")
def UnionFaces(self, theShape, theName=None):
"""
Performs union faces of theShape.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
Improved shape.
"""
# Example: see GEOM_TestOthers.py
# @return Improved compound.
#
# @ref swig_CheckAndImprove "Example"
+ @ManageTransactions("BlocksOp")
def CheckAndImprove(self, theShape, theName=None):
"""
Check, if the given shape is a blocks compound.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
Improved compound.
"""
# Example: see GEOM_TestOthers.py
#
# @ref tui_explode_on_blocks "Example 1"
# \n @ref swig_MakeBlockExplode "Example 2"
+ @ManageTransactions("BlocksOp")
def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
"""
Get all the blocks, contained in the given compound.
Note:
If theMaxNbFaces = 0, the maximum number of faces is not restricted.
- Returns:
+ Returns:
List of GEOM.GEOM_Object, containing the retrieved blocks.
"""
# Example: see GEOM_TestOthers.py
# @return New GEOM.GEOM_Object, containing the found block.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BlocksOp")
def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
"""
Find block, containing the given point inside its volume or on boundary.
# @return New GEOM.GEOM_Object, containing the found block.
#
# @ref swig_GetBlockByParts "Example"
+ @ManageTransactions("BlocksOp")
def GetBlockByParts(self, theCompound, theParts, theName=None):
"""
Find block, containing all the elements, passed as the parts, or maximum quantity of them.
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Returns:
+ Returns:
New GEOM_Object, containing the found block.
"""
# Example: see GEOM_TestOthers.py
# @return List of GEOM.GEOM_Object, containing the found blocks.
#
# @ref swig_todo "Example"
+ @ManageTransactions("BlocksOp")
def GetBlocksByParts(self, theCompound, theParts, theName=None):
"""
Return all blocks, containing all the elements, passed as the parts.
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_multi_transformation "Example"
+ @ManageTransactions("BlocksOp")
def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
"""
Multi-transformate block and glue the result.
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_multi_transformation "Example"
+ @ManageTransactions("BlocksOp")
def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
DirFace1V, DirFace2V, NbTimesV, theName=None):
"""
# @return List of GEOM.GEOM_Object, each of them is a propagation group.
#
# @ref swig_Propagate "Example"
+ @ManageTransactions("BlocksOp")
def Propagate(self, theShape, theName=None):
"""
Build all possible propagation groups.
#
# @ref tui_working_with_groups_page "Example 1"
# \n @ref swig_CreateGroup "Example 2"
+ @ManageTransactions("GroupOp")
def CreateGroup(self, theMainShape, theShapeType, theName=None):
"""
Creates a new group which will store sub-shapes of theMainShape
Example of usage:
group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
-
+
"""
# Example: see GEOM_TestOthers.py
anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
# \note Use method GetSubShapeID() to get an unique ID of the sub-shape
#
# @ref tui_working_with_groups_page "Example"
+ @ManageTransactions("GroupOp")
def AddObject(self,theGroup, theSubShapeID):
"""
Adds a sub-object with ID theSubShapeId to the group
theSubShapeID is a sub-shape ID in the main object.
Note:
- Use method GetSubShapeID() to get an unique ID of the sub-shape
+ Use method GetSubShapeID() to get an unique ID of the sub-shape
"""
# Example: see GEOM_TestOthers.py
self.GroupOp.AddObject(theGroup, theSubShapeID)
# \note Use method GetSubShapeID() to get an unique ID of the sub-shape
#
# @ref tui_working_with_groups_page "Example"
+ @ManageTransactions("GroupOp")
def RemoveObject(self,theGroup, theSubShapeID):
"""
Removes a sub-object with ID theSubShapeId from the group
# @param theSubShapes is a list of sub-shapes to be added.
#
# @ref tui_working_with_groups_page "Example"
+ @ManageTransactions("GroupOp")
def UnionList (self,theGroup, theSubShapes):
"""
Adds to the group all the given shapes. No errors, if some shapes are alredy included.
# @param theSubShapes is a list of indices of sub-shapes to be added.
#
# @ref swig_UnionIDs "Example"
+ @ManageTransactions("GroupOp")
def UnionIDs(self,theGroup, theSubShapes):
"""
Adds to the group all the given shapes. No errors, if some shapes are alredy included.
# @param theSubShapes is a list of sub-shapes to be removed.
#
# @ref tui_working_with_groups_page "Example"
+ @ManageTransactions("GroupOp")
def DifferenceList (self,theGroup, theSubShapes):
"""
Removes from the group all the given shapes. No errors, if some shapes are not included.
# @param theSubShapes is a list of indices of sub-shapes to be removed.
#
# @ref swig_DifferenceIDs "Example"
+ @ManageTransactions("GroupOp")
def DifferenceIDs(self,theGroup, theSubShapes):
"""
Removes from the group all the given shapes. No errors, if some shapes are not included.
Parameters:
theGroup is a GEOM group from which the sub-shapes are removed.
theSubShapes is a list of indices of sub-shapes to be removed.
- """
+ """
# Example: see GEOM_TestOthers.py
self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
RaiseIfFailed("DifferenceIDs", self.GroupOp)
# @return a newly created GEOM group.
#
# @ref tui_union_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def UnionGroups (self, theGroup1, theGroup2, theName=None):
"""
Union of two groups.
# @return a newly created GEOM group.
#
# @ref tui_intersect_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def IntersectGroups (self, theGroup1, theGroup2, theName=None):
"""
Intersection of two groups.
# @return a newly created GEOM group.
#
# @ref tui_cut_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def CutGroups (self, theGroup1, theGroup2, theName=None):
"""
Cut of two groups.
# @return a newly created GEOM group.
#
# @ref tui_union_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def UnionListOfGroups (self, theGList, theName=None):
"""
Union of list of groups.
# @return a newly created GEOM group.
#
# @ref tui_intersect_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def IntersectListOfGroups (self, theGList, theName=None):
"""
Cut of lists of groups.
## Cut of lists of groups.
# New group is created. It will contain only entities
- # which are present in groups listed in theGList1 but
+ # which are present in groups listed in theGList1 but
# are not present in groups from theGList2.
# @param theGList1 is a list of GEOM groups to include elements of.
# @param theGList2 is a list of GEOM groups to exclude elements of.
# @return a newly created GEOM group.
#
# @ref tui_cut_groups_anchor "Example"
+ @ManageTransactions("GroupOp")
def CutListOfGroups (self, theGList1, theGList2, theName=None):
"""
Cut of lists of groups.
New group is created. It will contain only entities
- which are present in groups listed in theGList1 but
+ which are present in groups listed in theGList1 but
are not present in groups from theGList2.
Parameters:
# @param theGroup is a GEOM group for which a list of IDs is requested
#
# @ref swig_GetObjectIDs "Example"
+ @ManageTransactions("GroupOp")
def GetObjectIDs(self,theGroup):
"""
Returns a list of sub-objects ID stored in the group
# @param theGroup is a GEOM group which type is returned.
#
# @ref swig_GetType "Example"
+ @ManageTransactions("GroupOp")
def GetType(self,theGroup):
"""
Returns a type of sub-objects stored in the group
Parameters:
theId is a GEOM obect type id.
-
+
Returns:
type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
"""
# @return a GEOM object which is a main shape for theGroup
#
# @ref swig_GetMainShape "Example"
+ @ManageTransactions("GroupOp")
def GetMainShape(self,theGroup):
"""
Returns a main shape associated with the group
# end of l3_groups
## @}
- ## @addtogroup l4_advanced
- ## @{
-
- ## Create a T-shape object with specified caracteristics for the main
- # and the incident pipes (radius, width, half-length).
- # The extremities of the main pipe are located on junctions points P1 and P2.
- # The extremity of the incident pipe is located on junction point P3.
- # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- # the main plane of the T-shape is XOY.
- #
- # @param theR1 Internal radius of main pipe
- # @param theW1 Width of main pipe
- # @param theL1 Half-length of main pipe
- # @param theR2 Internal radius of incident pipe (R2 < R1)
- # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
- # @param theL2 Half-length of incident pipe
- #
- # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- # @param theP1 1st junction point of main pipe
- # @param theP2 2nd junction point of main pipe
- # @param theP3 Junction point of incident pipe
- #
- # @param theRL Internal radius of left thickness reduction
- # @param theWL Width of left thickness reduction
- # @param theLtransL Length of left transition part
- # @param theLthinL Length of left thin part
- #
- # @param theRR Internal radius of right thickness reduction
- # @param theWR Width of right thickness reduction
- # @param theLtransR Length of right transition part
- # @param theLthinR Length of right thin part
- #
- # @param theRI Internal radius of incident thickness reduction
- # @param theWI Width of incident thickness reduction
- # @param theLtransI Length of incident transition part
- # @param theLthinI Length of incident thin part
- #
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
- #
- # @ref tui_creation_pipetshape "Example"
- def MakePipeTShape (self, theR1, theW1, theL1, theR2, theW2, theL2,
- theHexMesh=True, theP1=None, theP2=None, theP3=None,
- theRL=0, theWL=0, theLtransL=0, theLthinL=0,
- theRR=0, theWR=0, theLtransR=0, theLthinR=0,
- theRI=0, theWI=0, theLtransI=0, theLthinI=0,
- theName=None):
- """
- Create a T-shape object with specified caracteristics for the main
- and the incident pipes (radius, width, half-length).
- The extremities of the main pipe are located on junctions points P1 and P2.
- The extremity of the incident pipe is located on junction point P3.
- If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- the main plane of the T-shape is XOY.
-
- Parameters:
- theR1 Internal radius of main pipe
- theW1 Width of main pipe
- theL1 Half-length of main pipe
- theR2 Internal radius of incident pipe (R2 < R1)
- theW2 Width of incident pipe (R2+W2 < R1+W1)
- theL2 Half-length of incident pipe
- theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- theP1 1st junction point of main pipe
- theP2 2nd junction point of main pipe
- theP3 Junction point of incident pipe
-
- theRL Internal radius of left thickness reduction
- theWL Width of left thickness reduction
- theLtransL Length of left transition part
- theLthinL Length of left thin part
-
- theRR Internal radius of right thickness reduction
- theWR Width of right thickness reduction
- theLtransR Length of right transition part
- theLthinR Length of right thin part
-
- theRI Internal radius of incident thickness reduction
- theWI Width of incident thickness reduction
- theLtransI Length of incident transition part
- theLthinI Length of incident thin part
-
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- List of GEOM_Object, containing the created shape and propagation groups.
-
- Example of usage:
- # create PipeTShape object
- pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
- # create PipeTShape object with position
- pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
- # create PipeTShape object with left thickness reduction
- pipetshape_thr = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
- """
- theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
- if (theP1 and theP2 and theP3):
- anObj = self.AdvOp.MakePipeTShapeTRWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theHexMesh, theP1, theP2, theP3)
- else:
- anObj = self.AdvOp.MakePipeTShapeTR(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theHexMesh)
- RaiseIfFailed("MakePipeTShape", self.AdvOp)
- if Parameters: anObj[0].SetParameters(Parameters)
- def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
- self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
- return anObj
-
- ## Create a T-shape object with chamfer and with specified caracteristics for the main
- # and the incident pipes (radius, width, half-length). The chamfer is
- # created on the junction of the pipes.
- # The extremities of the main pipe are located on junctions points P1 and P2.
- # The extremity of the incident pipe is located on junction point P3.
- # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- # the main plane of the T-shape is XOY.
- # @param theR1 Internal radius of main pipe
- # @param theW1 Width of main pipe
- # @param theL1 Half-length of main pipe
- # @param theR2 Internal radius of incident pipe (R2 < R1)
- # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
- # @param theL2 Half-length of incident pipe
- # @param theH Height of the chamfer.
- # @param theW Width of the chamfer.
- # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- # @param theP1 1st junction point of main pipe
- # @param theP2 2nd junction point of main pipe
- # @param theP3 Junction point of incident pipe
- #
- # @param theRL Internal radius of left thickness reduction
- # @param theWL Width of left thickness reduction
- # @param theLtransL Length of left transition part
- # @param theLthinL Length of left thin part
- #
- # @param theRR Internal radius of right thickness reduction
- # @param theWR Width of right thickness reduction
- # @param theLtransR Length of right transition part
- # @param theLthinR Length of right thin part
- #
- # @param theRI Internal radius of incident thickness reduction
- # @param theWI Width of incident thickness reduction
- # @param theLtransI Length of incident transition part
- # @param theLthinI Length of incident thin part
- #
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
- #
- # @ref tui_creation_pipetshape "Example"
- def MakePipeTShapeChamfer (self, theR1, theW1, theL1, theR2, theW2, theL2,
- theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None,
- theRL=0, theWL=0, theLtransL=0, theLthinL=0,
- theRR=0, theWR=0, theLtransR=0, theLthinR=0,
- theRI=0, theWI=0, theLtransI=0, theLthinI=0,
- theName=None):
- """
- Create a T-shape object with chamfer and with specified caracteristics for the main
- and the incident pipes (radius, width, half-length). The chamfer is
- created on the junction of the pipes.
- The extremities of the main pipe are located on junctions points P1 and P2.
- The extremity of the incident pipe is located on junction point P3.
- If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- the main plane of the T-shape is XOY.
-
- Parameters:
- theR1 Internal radius of main pipe
- theW1 Width of main pipe
- theL1 Half-length of main pipe
- theR2 Internal radius of incident pipe (R2 < R1)
- theW2 Width of incident pipe (R2+W2 < R1+W1)
- theL2 Half-length of incident pipe
- theH Height of the chamfer.
- theW Width of the chamfer.
- theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- theP1 1st junction point of main pipe
- theP2 2nd junction point of main pipe
- theP3 Junction point of incident pipe
-
- theRL Internal radius of left thickness reduction
- theWL Width of left thickness reduction
- theLtransL Length of left transition part
- theLthinL Length of left thin part
-
- theRR Internal radius of right thickness reduction
- theWR Width of right thickness reduction
- theLtransR Length of right transition part
- theLthinR Length of right thin part
-
- theRI Internal radius of incident thickness reduction
- theWI Width of incident thickness reduction
- theLtransI Length of incident transition part
- theLthinI Length of incident thin part
-
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- List of GEOM_Object, containing the created shape and propagation groups.
-
- Example of usage:
- # create PipeTShape with chamfer object
- pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
- # create PipeTShape with chamfer object with position
- pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
- # create PipeTShape with chamfer object with left thickness reduction
- pipetshapechamfer_thr = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
- """
- theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
- if (theP1 and theP2 and theP3):
- anObj = self.AdvOp.MakePipeTShapeTRChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theH, theW, theHexMesh, theP1, theP2, theP3)
- else:
- anObj = self.AdvOp.MakePipeTShapeTRChamfer(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theH, theW, theHexMesh)
- RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
- if Parameters: anObj[0].SetParameters(Parameters)
- def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
- self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
- return anObj
-
- ## Create a T-shape object with fillet and with specified caracteristics for the main
- # and the incident pipes (radius, width, half-length). The fillet is
- # created on the junction of the pipes.
- # The extremities of the main pipe are located on junctions points P1 and P2.
- # The extremity of the incident pipe is located on junction point P3.
- # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- # the main plane of the T-shape is XOY.
- # @param theR1 Internal radius of main pipe
- # @param theW1 Width of main pipe
- # @param theL1 Half-length of main pipe
- # @param theR2 Internal radius of incident pipe (R2 < R1)
- # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
- # @param theL2 Half-length of incident pipe
- # @param theRF Radius of curvature of fillet.
- # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- # @param theP1 1st junction point of main pipe
- # @param theP2 2nd junction point of main pipe
- # @param theP3 Junction point of incident pipe
- #
- # @param theRL Internal radius of left thickness reduction
- # @param theWL Width of left thickness reduction
- # @param theLtransL Length of left transition part
- # @param theLthinL Length of left thin part
- #
- # @param theRR Internal radius of right thickness reduction
- # @param theWR Width of right thickness reduction
- # @param theLtransR Length of right transition part
- # @param theLthinR Length of right thin part
- #
- # @param theRI Internal radius of incident thickness reduction
- # @param theWI Width of incident thickness reduction
- # @param theLtransI Length of incident transition part
- # @param theLthinI Length of incident thin part
- #
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
- #
- # @ref tui_creation_pipetshape "Example"
- def MakePipeTShapeFillet (self, theR1, theW1, theL1, theR2, theW2, theL2,
- theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None,
- theRL=0, theWL=0, theLtransL=0, theLthinL=0,
- theRR=0, theWR=0, theLtransR=0, theLthinR=0,
- theRI=0, theWI=0, theLtransI=0, theLthinI=0,
- theName=None):
- """
- Create a T-shape object with fillet and with specified caracteristics for the main
- and the incident pipes (radius, width, half-length). The fillet is
- created on the junction of the pipes.
- The extremities of the main pipe are located on junctions points P1 and P2.
- The extremity of the incident pipe is located on junction point P3.
-
- Parameters:
- If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
- the main plane of the T-shape is XOY.
- theR1 Internal radius of main pipe
- theW1 Width of main pipe
- heL1 Half-length of main pipe
- theR2 Internal radius of incident pipe (R2 < R1)
- theW2 Width of incident pipe (R2+W2 < R1+W1)
- theL2 Half-length of incident pipe
- theRF Radius of curvature of fillet.
- theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
- theP1 1st junction point of main pipe
- theP2 2nd junction point of main pipe
- theP3 Junction point of incident pipe
-
- theRL Internal radius of left thickness reduction
- theWL Width of left thickness reduction
- theLtransL Length of left transition part
- theLthinL Length of left thin part
-
- theRR Internal radius of right thickness reduction
- theWR Width of right thickness reduction
- theLtransR Length of right transition part
- theLthinR Length of right thin part
-
- theRI Internal radius of incident thickness reduction
- theWI Width of incident thickness reduction
- theLtransI Length of incident transition part
- theLthinI Length of incident thin part
-
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- List of GEOM_Object, containing the created shape and propagation groups.
-
- Example of usage:
- # create PipeTShape with fillet object
- pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
- # create PipeTShape with fillet object with position
- pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
- # create PipeTShape with fillet object with left thickness reduction
- pipetshapefillet_thr = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, theRL=60, theWL=20, theLtransL=40, theLthinL=20)
- """
- theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theRL, theWL, theLtransL, theLthinL, theRR, theWR, theLtransR, theLthinR, theRI, theWI, theLtransI, theLthinI)
- if (theP1 and theP2 and theP3):
- anObj = self.AdvOp.MakePipeTShapeTRFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theRF, theHexMesh, theP1, theP2, theP3)
- else:
- anObj = self.AdvOp.MakePipeTShapeTRFillet(theR1, theW1, theL1, theR2, theW2, theL2,
- theRL, theWL, theLtransL, theLthinL,
- theRR, theWR, theLtransR, theLthinR,
- theRI, theWI, theLtransI, theLthinI,
- theRF, theHexMesh)
- RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
- if Parameters: anObj[0].SetParameters(Parameters)
- def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
- self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
- return anObj
-
- ## This function allows creating a disk already divided into blocks. It
- # can be used to create divided pipes for later meshing in hexaedra.
- # @param theR Radius of the disk
- # @param theOrientation Orientation of the plane on which the disk will be built
- # 1 = XOY, 2 = OYZ, 3 = OZX
- # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM_Object, containing the created shape.
- #
- # @ref tui_creation_divideddisk "Example"
- def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
- """
- Creates a disk, divided into blocks. It can be used to create divided pipes
- for later meshing in hexaedra.
-
- Parameters:
- theR Radius of the disk
- theOrientation Orientation of the plane on which the disk will be built:
- 1 = XOY, 2 = OYZ, 3 = OZX
- thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM_Object, containing the created shape.
- """
- theR, Parameters = ParseParameters(theR)
- anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
- RaiseIfFailed("MakeDividedDisk", self.AdvOp)
- if Parameters: anObj.SetParameters(Parameters)
- self._autoPublish(anObj, theName, "dividedDisk")
- return anObj
-
- ## This function allows creating a disk already divided into blocks. It
- # can be used to create divided pipes for later meshing in hexaedra.
- # @param theCenter Center of the disk
- # @param theVector Normal vector to the plane of the created disk
- # @param theRadius Radius of the disk
- # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM_Object, containing the created shape.
- #
- # @ref tui_creation_divideddisk "Example"
- def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
- """
- Creates a disk already divided into blocks. It can be used to create divided pipes
- for later meshing in hexaedra.
-
- Parameters:
- theCenter Center of the disk
- theVector Normal vector to the plane of the created disk
- theRadius Radius of the disk
- thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM_Object, containing the created shape.
- """
- theRadius, Parameters = ParseParameters(theRadius)
- anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
- RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
- if Parameters: anObj.SetParameters(Parameters)
- self._autoPublish(anObj, theName, "dividedDisk")
- return anObj
-
- ## Builds a cylinder prepared for hexa meshes
- # @param theR Radius of the cylinder
- # @param theH Height of the cylinder
- # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- #
- # @return New GEOM_Object, containing the created shape.
- #
- # @ref tui_creation_dividedcylinder "Example"
- def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
- """
- Builds a cylinder prepared for hexa meshes
-
- Parameters:
- theR Radius of the cylinder
- theH Height of the cylinder
- thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM_Object, containing the created shape.
- """
- theR, theH, Parameters = ParseParameters(theR, theH)
- anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
- RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
- if Parameters: anObj.SetParameters(Parameters)
- self._autoPublish(anObj, theName, "dividedCylinder")
- return anObj
-
- ## Create a surface from a cloud of points
- # @param thelPoints list of points. Compounds of points are
- # accepted as well.
- # @param theNbMax maximum number of Bezier pieces in the resulting
- # surface.
- # @param theDegMax maximum degree of the resulting BSpline surface.
- # @param theDMax 3D tolerance of initial approximation.
- # @param theName Object name; when specified, this parameter is used
- # for result publication in the study. Otherwise, if automatic
- # publication is switched on, default value is used for result name.
- # @return New GEOM_Object, containing the created shape.
- # @note 3D tolerance of initial approximation represents a tolerance of
- # initial plate surface approximation. If this parameter is equal
- # to 0 (default value) it is computed. In this case an error of
- # initial plate surface computation is used as the approximation
- # tolerance. This error represents a maximal distance between
- # computed plate surface and given points.
- #
- # @ref tui_creation_smoothingsurface "Example"
- def MakeSmoothingSurface(self, thelPoints, theNbMax=2, theDegMax=8,
- theDMax=0.0, theName=None):
- """
- Create a surface from a cloud of points
-
- Parameters:
- thelPoints list of points. Compounds of points are
- accepted as well.
- theNbMax maximum number of Bezier pieces in the resulting
- surface.
- theDegMax maximum degree of the resulting BSpline surface.
- theDMax 3D tolerance of initial approximation.
- theName Object name; when specified, this parameter is used
- for result publication in the study. Otherwise, if automatic
- publication is switched on, default value is used for result name.
-
- Returns:
- New GEOM_Object, containing the created shape.
-
- Note:
- 3D tolerance of initial approximation represents a tolerance of
- initial plate surface approximation. If this parameter is equal
- to 0 (default value) it is computed. In this case an error of
- initial plate surface computation is used as the approximation
- tolerance. This error represents a maximal distance between
- computed plate surface and given points.
- """
- anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
- theDegMax, theDMax)
- RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
- self._autoPublish(anObj, theName, "smoothing")
- return anObj
-
- ## Export a shape to XAO format
- # @param shape The shape to export
- # @param groups The list of groups to export
- # @param fields The list of fields to export
- # @param author The author of the export
- # @param fileName The name of the file to export
- # @return boolean
- #
- # @ref tui_exportxao "Example"
- def ExportXAO(self, shape, groups, fields, author, fileName):
- res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName)
- RaiseIfFailed("ExportXAO", self.InsertOp)
- return res
-
- ## Import a shape from XAO format
- # @param shape Shape to export
- # @param fileName The name of the file to import
- # @return tuple (res, shape, subShapes, groups, fields)
- # res Flag indicating if the import was successful
- # shape The imported shape
- # subShapes The list of imported subShapes
- # groups The list of imported groups
- # fields The list of imported fields
- #
- # @ref tui_importxao "Example"
- def ImportXAO(self, fileName):
- res = self.InsertOp.ImportXAO(fileName)
- RaiseIfFailed("ImportXAO", self.InsertOp)
- return res
-
#@@ insert new functions before this line @@ do not remove this line @@#
- # end of l4_advanced
- ## @}
-
## Create a copy of the given object
#
# @param theOriginal geometry object for copy
#
# @ingroup l1_geomBuilder_auxiliary
# @ref swig_MakeCopy "Example"
+ @ManageTransactions("InsertOp")
def MakeCopy(self, theOriginal, theName=None):
"""
Create a copy of the given object
# @param Path a path to the texture file
# @return unique texture identifier
# @ingroup l1_geomBuilder_auxiliary
+ @ManageTransactions("InsertOp")
def LoadTexture(self, Path):
"""
Load marker texture from the file
-
+
Parameters:
Path a path to the texture file
-
+
Returns:
unique texture identifier
"""
## Get internal name of the object based on its study entry
# @note This method does not provide an unique identifier of the geometry object.
- # @note This is internal function of GEOM component, though it can be used outside it for
+ # @note This is internal function of GEOM component, though it can be used outside it for
# appropriate reason (e.g. for identification of geometry object).
# @param obj geometry object
# @return unique object identifier
"""
Get internal name of the object based on its study entry.
Note: this method does not provide an unique identifier of the geometry object.
- It is an internal function of GEOM component, though it can be used outside GEOM for
+ It is an internal function of GEOM component, though it can be used outside GEOM for
appropriate reason (e.g. for identification of geometry object).
Parameters:
if entry is not None:
lst = entry.split(":")
if len(lst) > 0:
- ID = lst[-1] # -1 means last item in the list
+ ID = lst[-1] # -1 means last item in the list
return "GEOM_" + ID
return ID
-
-
+
+
## Add marker texture. @a Width and @a Height parameters
# specify width and height of the texture in pixels.
# @param RowData if @c True, @a Texture data are packed in the byte stream
# @return unique texture identifier
# @ingroup l1_geomBuilder_auxiliary
+ @ManageTransactions("InsertOp")
def AddTexture(self, Width, Height, Texture, RowData=False):
"""
Add marker texture. Width and Height parameters
## Creates a new folder object. It is a container for any GEOM objects.
# @param Name name of the container
- # @param Father parent object. If None,
+ # @param Father parent object. If None,
# folder under 'Geometry' root object will be created.
# @return a new created folder
# @ingroup l1_publish_data
def NewFolder(self, Name, Father=None):
"""
Create a new folder object. It is an auxiliary container for any GEOM objects.
-
+
Parameters:
Name name of the container
- Father parent object. If None,
+ Father parent object. If None,
folder under 'Geometry' root object will be created.
-
+
Returns:
a new created folder
"""
def PutToFolder(self, Object, Folder):
"""
Move object to the specified folder
-
+
Parameters:
Object object to move
Folder target folder
def PutListToFolder(self, ListOfSO, Folder):
"""
Move list of objects to the specified folder
-
+
Parameters:
ListOfSO list of objects to move
Folder target folder
# 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
# @param componentNames names of components
# @return a created field
+ @ManageTransactions("FieldOp")
def CreateField(self, shape, name, type, dimension, componentNames):
"""
Creates a field
dimension dimension of the shape the field lies on
0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
componentNames names of components
-
+
Returns:
a created field
"""
return
## Returns number of fields on a shape
+ @ManageTransactions("FieldOp")
def CountFields(self, shape):
"Returns number of fields on a shape"
nb = self.FieldOp.CountFields( shape )
return nb
## Returns all fields on a shape
+ @ManageTransactions("FieldOp")
def GetFields(self, shape):
"Returns all fields on a shape"
ff = self.FieldOp.GetFields( shape )
return ff
## Returns a field on a shape by its name
+ @ManageTransactions("FieldOp")
def GetField(self, shape, name):
"Returns a field on a shape by its name"
f = self.FieldOp.GetField( shape, name )
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)
return geom
+
+
+# Register methods from the plug-ins in the geomBuilder class
+plugins_var = os.environ.get( "GEOM_PluginsList" )
+
+plugins = None
+if plugins_var is not None:
+ plugins = plugins_var.split( ":" )
+ plugins=filter(lambda x: len(x)>0, plugins)
+if plugins is not None:
+ for pluginName in plugins:
+ pluginBuilderName = pluginName + "Builder"
+ try:
+ exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
+ except Exception, e:
+ from salome_utils import verbose
+ print "Exception while loading %s: %s" % ( pluginBuilderName, e )
+ continue
+ exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
+ plugin = eval( pluginBuilderName )
+
+ # add methods from plugin module to the geomBuilder class
+ for k in dir( plugin ):
+ if k[0] == '_': continue
+ method = getattr( plugin, k )
+ if type( method ).__name__ == 'function':
+ if not hasattr( geomBuilder, k ):
+ setattr( geomBuilder, k, method )
+ pass
+ pass
+ del pluginName
+ pass
+ pass
self.myCommand = "Sketcher"
self.geompyD._autoPublish(face, theName, "face")
return face
+
+## An interface to build a 2D polyline step-by-step. The polyline can contain
+# several sections. Each section represents a list of 2d points. As well it
+# has a name, curve type, either polyline or interpolation (BSpline curve) and
+# Closed flag.
+# Use geompy.Polyline2D() method to obtain an instance of this class.
+# @ingroup sketcher
+class Polyline2D:
+ """
+ An interface to build a 2D polyline step-by-step. The polyline can contain
+ several sections. Each section represents a list of 2d points. As well it
+ has a name, curve type, either polyline or interpolation (BSpline curve) and
+ Closed flag.
+ Use geompy.Polyline2D() method to obtain an instance of this class.
+
+ Example of usage:
+ pl = geompy.Polyline2D()
+ pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10])
+ pl.addSection("section 2", GEOM.Interpolation, False)
+ pl.addPoints([20, 0, 30, 0, 30, 10])
+ resultObj = pl.result(WorkingPlane)
+ """
+
+ def __init__(self, geompyD):
+ self.geompyD = geompyD
+ self.myNameList = []
+ self.myTypeList = []
+ self.myClosedList = []
+ self.myCoordsList = []
+ pass
+
+ ## Add a new section to the polyline.
+ #
+ # @param theName the name
+ # @param theType the type. It can have either CORBA enumeration type
+ # GEOM.curve_type or a value of type long. Possible input values
+ # are: GEOM.Polyline(0) and GEOM.Interpolation(2).
+ # @param theClosed True for closed section; False otherwise
+ # @param thePoints the list of 2D points coordinates in the form:
+ # [x1, y1, x2, y2, ..., xN, yN] for N points.
+ def addSection(self, theName, theType, theClosed, thePoints = None):
+ """
+ Add a new section to the polyline.
+
+ Parameters:
+ theName the name
+ theType the type. It can have either CORBA enumeration type
+ GEOM.curve_type or a value of type long. Possible input
+ values are: GEOM.Polyline(0) and GEOM.Interpolation(2).
+ theClosed True for closed section; False otherwise
+ thePoints the list of 2D points coordinates in the form:
+ [x1, y1, x2, y2, ..., xN, yN] for N points.
+
+ Example of usage:
+ pl = geompy.Polyline2D()
+ pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10])
+ resultObj = pl.result(WorkingPlane)
+ """
+ from salome.geom.geomBuilder import EnumToLong
+ self.myNameList.append(theName)
+ self.myTypeList.append(EnumToLong(theType))
+ self.myClosedList.append(theClosed)
+ if thePoints is None:
+ self.myCoordsList.append([])
+ else:
+ self.myCoordsList.append(thePoints)
+ pass
+
+ ## Add a points to the last added section of the polyline. If there are
+ # no sections in the polyline it does nothing.
+ #
+ # @param thePoints the list of 2D points coordinates in the form:
+ # [x1, y1, x2, y2, ..., xN, yN] for N points.
+ def addPoints(self, thePoints):
+ """
+ Add a points to the last added section of the polyline. If there are
+ no sections in the polyline it does nothing.
+
+ Parameters:
+ thePoints the list of 2D points coordinates in the form:
+ [x1, y1, x2, y2, ..., xN, yN] for N points.
+
+ Example of usage:
+ pl = geompy.Polyline2D()
+ pl.addSection("section 1", GEOM.Polyline, True)
+ pl.addPoints([0, 0, 10, 0, 10, 10])
+ pl.addPoints([20, 0, 30, 0, 30, 10])
+ resultObj = pl.result(WorkingPlane)
+ """
+ if self.myNameList:
+ self.myCoordsList[-1].extend(thePoints)
+ pass
+
+ ## Obtain the 2D polyline result as a wire or a compound of wires in case
+ # of several sections defined.
+ #
+ # @param theWorkingPlane - current Working Plane used for this 2D polyline
+ # @param theName Object name; when specified, this parameter is used
+ # for result publication in the study. Otherwise, if automatic
+ # publication is switched on, default value is used for result name.
+ #
+ # @return New GEOM_Object, containing the created shape.
+ def result(self, theWorkingPlane=[0, 0, 0, 0, 0, 1, 1, 0, 0], theName=None):
+ """
+ Obtain the 2D polyline result as a wire or a compound of wires in case
+ of several sections defined.
+
+ Parameters:
+ theWorkingPlane current Working Plane used for this 2D polyline
+ theName Object name; when specified, this parameter is used
+ for result publication in the study. Otherwise, if automatic
+ publication is switched on, default value is used for result name.
+
+ Returns:
+ New GEOM_Object, containing the created shape.
+
+ Example of usage:
+ pl = geompy.Polyline2D()
+ pl.addSection("section 1", GEOM.Polyline, True, [0, 0, 10, 0, 10, 10])
+ pl.addSection("section 2", GEOM.Interpolation, False)
+ pl.addPoints([20, 0, 30, 0, 30, 10])
+ resultObj = pl.result(WorkingPlane)
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ import GEOM
+ if isinstance(theWorkingPlane, list):
+ aResult = self.geompyD.CurvesOp.MakePolyline2D(
+ self.myCoordsList, self.myNameList, self.myTypeList,
+ self.myClosedList, theWorkingPlane)
+ if isinstance(theWorkingPlane, GEOM._objref_GEOM_Object):
+ aResult = self.geompyD.CurvesOp.MakePolyline2DOnPlane(
+ self.myCoordsList, self.myNameList, self.myTypeList,
+ self.myClosedList, theWorkingPlane)
+
+ self.myNameList = []
+ self.myTypeList = []
+ self.myClosedList = []
+ self.myCoordsList = []
+ RaiseIfFailed("Polyline2D.result", self.geompyD.CurvesOp)
+ self.geompyD._autoPublish(aResult, theName, "polyline")
+
+ return aResult
theOn, theUpdateViewer ) );
}
+/*!
+ \brief Show / hide vertices for the presentation
+ \param theEntry geometry object's entry
+ \param theOn \c true to show vertices or \c false otherwise
+ \param theUpdateViewer \c true to update active view's contents
+*/
+void GEOM_Swig::setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer )
+{
+ ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Vertices ),
+ theOn, theUpdateViewer ) );
+}
+
/*!
\brief Change color of the presentation
\param theEntry geometry object's entry
void setDisplayMode( const char* theEntry, int theMode, bool theUpdateViewer = true );
void setVectorsMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
+ void setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
void setColor( const char* theEntry, int theRed, int theGreen, int theBlue, bool theUpdateViewer = true );
void setTransparency( const char* theEntry, float theTransparency, bool theUpdateViewer = true );
void setIsos( const char* theEntry, int theNbU, int theNbV, bool theUpdateViewer = true );
void setDisplayMode( const char* theEntry, int theMode, bool theUpdateViewer = true );
void setVectorsMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
+ void setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
void setColor( const char* theEntry, int theRed, int theGreen, int theBlue, bool theUpdateViewer = true );
void setTransparency( const char* theEntry, float theTransparency, bool theUpdateViewer = true );
void setIsos( const char* theEntry, int theNbU, int theNbV, bool theUpdateViewer = true );
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
connect(GroupMakePoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupMakePoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupMakePoints->CheckBox1, SIGNAL(clicked()), this, SLOT(processPreview()));
+ connect(GroupMakePoints->CheckBox2, SIGNAL(clicked()), this, SLOT(processPreview()));
initName(tr("GEOM_PIPE"));
resize(100,100);
return false;
initName();
- if ( getConstructorId() != 1 )
- ConstructorsClicked( getConstructorId() );
- // activate selection and connect selection manager
- // GroupPoints->PushButton1->click();
+
return true;
}
}
}
else if ( myEditCurrentArgument == GroupMakePoints->LineEdit1 ) {
- myBaseObjects.clear();
QList<TopAbs_ShapeEnum> types;
types << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL;
QList<GEOM::GeomObjPtr> objects = getSelected( types, -1 );
}
}
else if ( myEditCurrentArgument == GroupMakePoints->LineEdit2 ) {
- myLocations.clear();
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_VERTEX, -1 );
GEOMBase::Synchronize( myLocations, objects );
#include <OCCViewer_ViewManager.h>
#include <SVTK_ViewModel.h>
#include <SALOME_Prs.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKIGES}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(IGESExport_SOURCES
- IGESExport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(IGESExport ${IGESExport_SOURCES})
-TARGET_LINK_LIBRARIES(IGESExport ${_link_LIBRARIES})
-INSTALL(TARGETS IGESExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: IGESExport.cxx
-// Created: Wed May 19 14:49:45 2004
-// Author: Pavel TELKOV
-
-#include "utilities.h"
-
-#include <Basics_Utils.hxx>
-
-#include <IGESControl_Controller.hxx>
-#include <IGESControl_Writer.hxx>
-#include <Interface_Static.hxx>
-
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Iterator.hxx>
-
-#include <TCollection_AsciiString.hxx>
-
-#include <Standard_Failure.hxx>
-
-#ifdef WIN32
- #if defined IGESEXPORT_EXPORTS || defined IGESExport_EXPORTS
- #define IGESEXPORT_EXPORT __declspec( dllexport )
- #else
- #define IGESEXPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define IGESEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- * KindOfBRep
- * \return 0 if theShape contains only simple entities (wires, edges and vertices),
- * 1 if theShape contains only complex entities (shells, solids and compsolids)
- * 2 if theShape contains only indifferent entities (faces)
- * -1 if theShape contains both simple and complex entities (and in this case it
- * cannot be saved without any loss neither in BRepMode == 0 nor in BRepMode == 1)
- */
-//=============================================================================
-int KindOfBRep (const TopoDS_Shape& theShape)
-{
- int aKind = 2;
-
- switch (theShape.ShapeType())
- {
- case TopAbs_COMPOUND:
- {
- bool isSimple = false;
- bool isComplex = false;
- TopoDS_Iterator anIt (theShape, Standard_True, Standard_True);
- for (; anIt.More(); anIt.Next()) {
- TopoDS_Shape aS = anIt.Value();
- int aKindSub = KindOfBRep(aS);
- if (aKindSub == 0)
- isSimple = true;
- else if (aKindSub == 1)
- isComplex = true;
- else if (aKindSub == -1) {
- return -1; // heterogeneous
- }
- }
- if (isSimple && isComplex)
- aKind = -1; // heterogeneous
- else if (isSimple)
- aKind = 0;
- else if (isComplex)
- aKind = 1;
- }
- break;
- case TopAbs_COMPSOLID:
- case TopAbs_SOLID:
- case TopAbs_SHELL:
- aKind = 1;
- break;
- case TopAbs_WIRE:
- case TopAbs_EDGE:
- case TopAbs_VERTEX:
- aKind = 0;
- break;
- default:
- aKind = 2;
- }
-
- return aKind;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
-IGESEXPORT_EXPORT
- int Export( const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
- {
- bool ok = false;
-
- // define, whether to write only faces (5.1 IGES format)
- // or shells and solids also (5.3 IGES format)
- int aBrepMode = 0;
- if (theFormatName.IsEqual("IGES_5_3"))
- aBrepMode = 1;
-
- MESSAGE("Export IGES into file " << theFileName.ToCString());
-
- // Mantis issue 0021350: check being exported shape, as some standalone
- // entities (edges, wires and vertices) cannot be saved in BRepMode
- if (aBrepMode == 1) {
- int aKind = KindOfBRep(theShape);
- if (aKind == -1)
- Standard_Failure::Raise("EXPORT_IGES_HETEROGENEOUS_COMPOUND");
- else if (aKind == 2)
- aBrepMode = 1;
- else
- aBrepMode = aKind;
- }
-
- // commented for 0021350: Please don't catch exceptions silently and send an
- // inappropriate error message instead, it is disturbing for the user and for us
- //try
- {
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- // initialize writer
- IGESControl_Controller::Init();
- //IGESControl_Writer ICW (Interface_Static::CVal("write.iges.unit"),
- // Interface_Static::IVal("write.iges.brep.mode"));
- IGESControl_Writer ICW ("M", aBrepMode); // "write.iges.unit" ->> VSR 15.09.09: export explicitly in meters
- Interface_Static::SetCVal("xstep.cascade.unit","M");
-
- // 09.03.2010 skl for bug 0020726
- // change default value "Average" to "Max"
- Interface_Static::SetCVal("write.precision.mode","Max");
-
- // perform shape writing
- if (ICW.AddShape( theShape )) {
- ICW.ComputeModel();
- ok = ICW.Write( theFileName.ToCString() );
- }
- }
- //catch(Standard_Failure)
- //{
- //}
- return ok;
- }
-}
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKIGES} ${CAS_TKCAF}
- ${CAS_TKLCAF}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(IGESImport_SOURCES
- IGESImport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(IGESImport ${IGESImport_SOURCES})
-TARGET_LINK_LIBRARIES(IGESImport ${_link_LIBRARIES})
-INSTALL(TARGETS IGESImport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File: IGESImport.cxx
-// Created: Wed May 19 14:36:35 2004
-// Author: Pavel TELKOV
-
-#include "utilities.h"
-
-#include <Basics_Utils.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-#include <IGESControl_Reader.hxx>
-#include <IGESData_IGESModel.hxx>
-#include <IGESData_IGESEntity.hxx>
-
-#include <Interface_Static.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <XSControl_TransferReader.hxx>
-#include <XSControl_WorkSession.hxx>
-#include <Transfer_TransientProcess.hxx>
-#include <Transfer_Binder.hxx>
-#include <TransferBRep.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TDF_TagSource.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDF_Label.hxx>
-
-#include <TCollection_HAsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <BRep_Builder.hxx>
-#include <gp_Pnt.hxx>
-
-#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
-#ifdef WIN32
- #if defined IGESIMPORT_EXPORTS || defined IGESImport_EXPORTS
- #define IGESIMPORT_EXPORT __declspec( dllexport )
- #else
- #define IGESIMPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define IGESIMPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- IGESIMPORT_EXPORT
- Handle(TCollection_HAsciiString) GetValue (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theParameterName,
- TCollection_AsciiString& theError)
- {
- Handle(TCollection_HAsciiString) aValue;
-
- if (theParameterName != "LEN_UNITS") {
- theError = theParameterName + " parameter reading is not supported by IGES plugin";
- return aValue;
- }
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- IGESControl_Reader aReader;
-
- Interface_Static::SetCVal("xstep.cascade.unit","M");
-
- try {
- OCC_CATCH_SIGNALS;
-
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
- if (status == IFSelect_RetDone) {
- Handle(IGESData_IGESModel) aModel =
- Handle(IGESData_IGESModel)::DownCast(aReader.Model());
- if (!aModel.IsNull()) {
- aValue = aModel->GlobalSection().UnitName();
-
- //if (!aValue.IsNull()) {
- // Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_");
- // aValue->Prepend(aPrefix);
- //}
- }
- }
- else {
- theError = theFileName + " reading failed";
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- }
-
- return aValue;
- }
-
-IGESIMPORT_EXPORT
- TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- TCollection_AsciiString& theError,
- const TDF_Label& theShapeLabel)
- {
- TopoDS_Shape aResShape;
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- IGESControl_Reader aReader;
-
- Interface_Static::SetCVal("xstep.cascade.unit","M");
-
- try {
- OCC_CATCH_SIGNALS;
-
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
-
- if (status == IFSelect_RetDone) {
-
- // BEGIN: old code
- if (theFormatName == "IGES_UNIT") {
- Handle(IGESData_IGESModel) aModel =
- Handle(IGESData_IGESModel)::DownCast(aReader.Model());
- gp_Pnt P (1.0, 0.0, 0.0);
- if (!aModel.IsNull()) {
- Handle(TCollection_HAsciiString) aUnitName =
- aModel->GlobalSection().UnitName();
- if (!aUnitName.IsNull()) {
- if (aUnitName->String()=="MM") {
- P = gp_Pnt(0.001,0.0,0.0);
- }
- else if (aUnitName->String()=="CM") {
- P = gp_Pnt(0.01,0.0,0.0);
- }
- }
- }
- BRep_Builder B;
- TopoDS_Vertex V;
- B.MakeVertex(V,P,1.e-7);
- aResShape = V;
- return aResShape;
- }
- // END: old code
-
- if (theFormatName == "IGES_SCALE") {
- //cout<<"need re-scale a model"<<endl;
- // set UnitFlag to 'meter'
- Handle(IGESData_IGESModel) aModel =
- Handle(IGESData_IGESModel)::DownCast(aReader.Model());
- if (!aModel.IsNull()) {
- IGESData_GlobalSection aGS = aModel->GlobalSection();
- aGS.SetUnitFlag(6);
- aModel->SetGlobalSection(aGS);
- }
- }
-
- MESSAGE("ImportIGES : all Geometry Transfer");
- //OCC 5.1.2 porting
- // aReader.Clear();
- // aReader.TransferRoots(false);
- aReader.ClearShapes();
- aReader.TransferRoots();
-
- MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes());
- aResShape = aReader.OneShape();
-
- // BEGIN: Store names of sub-shapes from file
- Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
- Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
- if (!TR.IsNull()) {
- Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess();
- Standard_Integer nb = Model->NbEntities();
- for (Standard_Integer i = 1; i <= nb; i++) {
- Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast(Model->Value(i));
- if (ent.IsNull() || ! ent->HasName()) continue;
-
- // find target shape
- Handle(Transfer_Binder) binder = TP->Find(ent);
- if (binder.IsNull()) continue;
- TopoDS_Shape S = TransferBRep::ShapeResult(binder);
- if (S.IsNull()) continue;
-
- // create label and set shape
- TDF_Label L;
- TDF_TagSource aTag;
- L = aTag.NewChild(theShapeLabel);
- TNaming_Builder tnBuild (L);
- tnBuild.Generated(S);
-
- // set a name
- TCollection_AsciiString string = ent->NameValue()->String();
- string.LeftAdjust();
- string.RightAdjust();
- TCollection_ExtendedString str (string);
- TDataStd_Name::Set(L, str);
- }
- }
- // END: Store names
- } else {
-// switch (status) {
-// case IFSelect_RetVoid:
-// theError = "Nothing created or No data to process";
-// break;
-// case IFSelect_RetError:
-// theError = "Error in command or input data";
-// break;
-// case IFSelect_RetFail:
-// theError = "Execution was run, but has failed";
-// break;
-// case IFSelect_RetStop:
-// theError = "Execution has been stopped. Quite possible, an exception was raised";
-// break;
-// default:
-// break;
-// }
- theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
- }
- }
- catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- aResShape.Nullify();
- }
- return aResShape;
- }
-}
--- /dev/null
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKIGES}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLIGESPlugin
+ GEOMEngine
+ GEOMClient
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLIGESPlugin
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(IGESPluginEngine_HEADERS
+ IGESPlugin_IOperations_i.hh
+ IGESPlugin_Engine.hxx
+ IGESPlugin_OperationsCreator.hxx
+ IGESPlugin_IOperations.hxx
+ IGESPlugin_IExport.hxx
+ IGESPlugin_IImport.hxx
+ IGESPlugin_ImportDriver.hxx
+ IGESPlugin_ExportDriver.hxx
+ IGESPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ IGESPlugin_GUI.h
+ IGESPlugin_ExportDlg.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(IGESPluginGUI_SOURCES
+ IGESPlugin_GUI.cxx
+ IGESPlugin_ExportDlg.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(IGESPluginEngine_SOURCES
+ IGESPlugin_Engine.cxx
+ IGESPlugin_OperationsCreator.cxx
+ IGESPlugin_IOperations_i.cc
+ IGESPlugin_IOperations.cxx
+ IGESPlugin_ExportDriver.cxx
+ IGESPlugin_ImportDriver.cxx
+ IGESPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(IGESPlugin_RESOURCES
+ IGESPlugin_msg_en.ts
+ IGESPlugin_msg_fr.ts
+ IGESPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(IGESPluginEngine ${IGESPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(IGESPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS IGESPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(IGESPluginGUI ${IGESPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(IGESPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS IGESPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${IGESPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${IGESPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_Engine.hxx"
+#include "IGESPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ IGESPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new IGESPlugin_OperationsCreator();
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_IGESPLUGIN_ENGINE_HXX_
+#define _GEOM_IGESPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined IGESPluginEngine_EXPORTS
+ #define IGESPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define IGESPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define IGESPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "IGESPlugin_ExportDlg.h"
+
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+#include <QComboBox>
+
+//=================================================================================
+// Constructor
+//=================================================================================
+IGESPlugin_ExportDlg::IGESPlugin_ExportDlg( QWidget* parent )
+ : SUIT_FileDlg( parent, false, true, true )
+{
+ QLabel* versionLabel = new QLabel( tr( "IGES_VERSION" ), this );
+
+ myVersionCB = new QComboBox( this );
+ myVersionCB->addItem( tr( "5.1" ) );
+ myVersionCB->addItem( tr( "5.3" ) );
+
+ layout()->addWidget( versionLabel );
+ layout()->addWidget( myVersionCB );
+}
+
+//=================================================================================
+// Destructor
+//=================================================================================
+IGESPlugin_ExportDlg::~IGESPlugin_ExportDlg()
+{
+}
+
+//=================================================================================
+// getVersion
+//=================================================================================
+QString IGESPlugin_ExportDlg::getVersion() const
+{
+ return myVersionCB->currentText();
+}
+
+//=================================================================================
+// getFileName
+//=================================================================================
+QString IGESPlugin_ExportDlg::getFileName( const QString& initial, const QString& filters,
+ const QString& caption, QWidget* parent, QString& version )
+{
+ QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
+
+ QString tmpfilename = initial;
+ tmpfilename = tmpfilename.simplified();
+ tmpfilename = tmpfilename.replace( QRegExp( "\\*" ), "" ).replace( QRegExp( "\\?" ), "" );
+
+ IGESPlugin_ExportDlg fd( parent );
+ fd.setFileMode( AnyFile );
+ fd.setFilters( fls );
+ fd.setWindowTitle( caption );
+ if ( !tmpfilename.isEmpty() )
+ fd.processPath( tmpfilename );
+
+ QString filename;
+
+ if ( fd.exec() == QDialog::Accepted ) {
+ filename = fd.selectedFile();
+ version = fd.getVersion();
+ }
+
+ QApplication::processEvents();
+
+ return filename;
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef IGESPlugin_ExportDlg_H
+#define IGESPlugin_ExportDlg_H
+
+#include <SUIT_FileDlg.h>
+
+class QComboBox;
+
+class IGESPlugin_ExportDlg: public SUIT_FileDlg
+{
+ Q_OBJECT
+
+public:
+ IGESPlugin_ExportDlg( QWidget* parent );
+ ~IGESPlugin_ExportDlg();
+
+ QString getVersion() const;
+
+ static QString getFileName( const QString& initial, const QString& filters,
+ const QString& caption, QWidget* parent, QString& version );
+
+private:
+ QComboBox* myVersionCB;
+};
+
+#endif // IGESPlugin_ExportDlg_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_ExportDriver.hxx"
+#include "IGESPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+
+// OOCT includes
+#include <IGESControl_Controller.hxx>
+#include <IGESControl_Writer.hxx>
+#include <Interface_Static.hxx>
+
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Iterator.hxx>
+
+//=============================================================================
+/*!
+ * KindOfBRep
+ * \return 0 if theShape contains only simple entities (wires, edges and vertices),
+ * 1 if theShape contains only complex entities (shells, solids and compsolids)
+ * 2 if theShape contains only indifferent entities (faces)
+ * -1 if theShape contains both simple and complex entities (and in this case it
+ * cannot be saved without any loss neither in BRepMode == 0 nor in BRepMode == 1)
+ */
+//=============================================================================
+int KindOfBRep (const TopoDS_Shape& theShape)
+{
+ int aKind = 2;
+
+ switch (theShape.ShapeType())
+ {
+ case TopAbs_COMPOUND:
+ {
+ bool isSimple = false;
+ bool isComplex = false;
+ TopoDS_Iterator anIt (theShape, Standard_True, Standard_True);
+ for (; anIt.More(); anIt.Next()) {
+ TopoDS_Shape aS = anIt.Value();
+ int aKindSub = KindOfBRep(aS);
+ if (aKindSub == 0)
+ isSimple = true;
+ else if (aKindSub == 1)
+ isComplex = true;
+ else if (aKindSub == -1) {
+ return -1; // heterogeneous
+ }
+ }
+ if (isSimple && isComplex)
+ aKind = -1; // heterogeneous
+ else if (isSimple)
+ aKind = 0;
+ else if (isComplex)
+ aKind = 1;
+ }
+ break;
+ case TopAbs_COMPSOLID:
+ case TopAbs_SOLID:
+ case TopAbs_SHELL:
+ aKind = 1;
+ break;
+ case TopAbs_WIRE:
+ case TopAbs_EDGE:
+ case TopAbs_VERTEX:
+ aKind = 0;
+ break;
+ default:
+ aKind = 2;
+ }
+
+ return aKind;
+}
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& IGESPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("8fa4111a-24cb-4819-8f03-b0e2890d2a2a");
+ return aGUID;
+}
+
+//=======================================================================
+//function : IGESPlugin_ExportDriver
+//purpose :
+//=======================================================================
+IGESPlugin_ExportDriver::IGESPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer IGESPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ IGESPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+ TCollection_AsciiString aVersion = aData.GetVersion();
+ // define, whether to write only faces (5.1 IGES format)
+ // or shells and solids also (5.3 IGES format)
+ int aBrepMode = 0;
+ if( aVersion.IsEqual( "5.3" ) )
+ aBrepMode = 1;
+
+ MESSAGE("Export IGES into file " << aFileName.ToCString());
+
+ // Mantis issue 0021350: check being exported shape, as some standalone
+ // entities (edges, wires and vertices) cannot be saved in BRepMode
+ if( aBrepMode == 1 ) {
+ int aKind = KindOfBRep( aShape );
+ if( aKind == -1 )
+ Standard_Failure::Raise( "EXPORT_IGES_HETEROGENEOUS_COMPOUND" );
+ else if( aKind == 2 )
+ aBrepMode = 1;
+ else
+ aBrepMode = aKind;
+ }
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ // initialize writer
+ IGESControl_Controller::Init();
+ IGESControl_Writer ICW( "M", aBrepMode ); // export explicitly in meters
+ Interface_Static::SetCVal( "xstep.cascade.unit", "M" );
+
+ // 09.03.2010 skl for bug 0020726
+ // change default value "Average" to "Max"
+ Interface_Static::SetCVal( "write.precision.mode", "Max" );
+
+ // perform shape writing
+ if( ICW.AddShape( aShape ) ) {
+ ICW.ComputeModel();
+ return ICW.Write( aFileName.ToCString() );
+ }
+ return 0;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean IGESPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool IGESPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( IGESPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( IGESPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_ExportDriver_HXX
+#define _IGESPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( IGESPlugin_ExportDriver, GEOM_BaseDriver );
+
+class IGESPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ IGESPlugin_ExportDriver();
+ ~IGESPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( IGESPlugin_ExportDriver )
+};
+
+#endif // _IGESPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_GUI.h"
+#include "IGESPlugin_ExportDlg.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(IGESPlugin)
+
+//=======================================================================
+// function : IGESPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+IGESPlugin_GUI::IGESPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~IGESPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+IGESPlugin_GUI::~IGESPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool IGESPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_IGES"; break;
+ case 2:
+ cmd = "Import_IGES"; break;
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool IGESPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if( theCommandID == "Export_IGES" ) {
+ result = exportIGES( parent );
+ }
+ else if (theCommandID == "Import_IGES") {
+ result = importIGES( parent );
+ }
+ else {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return true;
+}
+
+//=======================================================================
+// function : importIGES
+// purpose :
+//=======================================================================
+bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
+{
+ 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::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
+ if ( CORBA::is_nil( igesOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "IGES_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+ SUIT_MessageBox::StandardButton igesAnswer = SUIT_MessageBox::NoButton;
+
+ for ( int i = 0; i < fileNames.count(); i++ )
+ {
+ QString fileName = fileNames.at( i );
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, igesOp.in() );
+ bool ignoreUnits = false;
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( SUIT_Tools::file( fileName, true ) ) );
+ transaction.start();
+
+ CORBA::String_var units = igesOp->ReadValue( fileName.toUtf8().constData(), "LEN_UNITS" );
+ QString unitsStr( units.in() );
+ bool unitsOK = unitsStr.isEmpty() || unitsStr == "M" || unitsStr.toLower() == "metre";
+
+ if ( !unitsOK )
+ {
+ if( igesAnswer == SUIT_MessageBox::NoToAll )
+ {
+ ignoreUnits = true;
+ }
+ else if( igesAnswer != SUIT_MessageBox::YesToAll )
+ {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel;
+ if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ igesAnswer = SUIT_MessageBox::question( parent,
+ tr( "WRN_WARNING" ),
+ tr( "SCALE_DIMENSIONS" ).arg( unitsStr ),
+ btns,
+ SUIT_MessageBox::No );
+ switch ( igesAnswer )
+ {
+ case SUIT_MessageBox::Cancel:
+ return true; // cancel (break) import operation
+ case SUIT_MessageBox::Yes:
+ case SUIT_MessageBox::YesToAll:
+ break; // scaling is confirmed
+ case SUIT_MessageBox::No:
+ case SUIT_MessageBox::NoAll:
+ ignoreUnits = true; // scaling is rejected
+ default:
+ break;
+ }
+ }
+ }
+
+ GEOM::ListOfGO_var result = igesOp->ImportIGES( fileName.toUtf8().constData(), ignoreUnits );
+ if ( result->length() > 0 && igesOp->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() );
+
+ entryList.append( so->GetID() );
+ transaction.commit();
+ GEOM_Displayer( study ).Display( main.in() );
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( igesOp->GetErrorCode() ) );
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ }
+ }
+
+ getGeometryGUI()->updateObjBrowser( true );
+ app->browseObjects( entryList );
+
+ if ( errors.count() > 0 )
+ {
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ }
+ return fileNames.count() > 0;
+}
+
+//=======================================================================
+// function : exportIGES
+// purpose :
+//=======================================================================
+bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent )
+{
+ 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::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
+ if ( CORBA::is_nil( igesOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ QString version;
+ QString fileName = IGESPlugin_ExportDlg::getFileName( QString( io->getName() ),
+ tr( "IGES_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent,
+ version );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, igesOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ igesOp->ExportIGES( obj, fileName.toUtf8().constData(), version.toUtf8().constData() );
+
+ if ( igesOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( igesOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new IGESPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef IGESPlugin_GUI_H
+#define IGESPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+class IGESPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ IGESPlugin_GUI( GeometryGUI* parent );
+ ~IGESPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importIGES( SUIT_Desktop* );
+ bool exportIGES( SUIT_Desktop* );
+};
+
+#endif // IGESPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_IECallBack.hxx"
+#include "IGESPlugin_IOperations.hxx"
+#include "IGESPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+IGESPlugin_IECallBack::IGESPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+IGESPlugin_IECallBack::~IGESPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool IGESPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ TCollection_AsciiString aVersion = ( theFormatName == "IGES_5_3" ) ? "5.3" : "5.1";
+ aPluginOperations->ExportIGES( theOriginal, theFileName, aVersion );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+IGESPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ bool anIsIgnoreUnits = ( theFormatName == "IGES_SCALE" ) ? true : false;
+ return aPluginOperations->ImportIGES( theFileName, anIsIgnoreUnits );
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString
+IGESPlugin_IECallBack::ReadValue( int theDocId,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
+{
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ReadValue( theFileName, theParameterName );
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_IECallBack_HXX_
+#define _IGESPlugin_IECallBack_HXX_
+
+// internal includes
+#include "IGESPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class IGESPLUGINENGINE_EXPORT IGESPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ IGESPlugin_IECallBack();
+ ~IGESPlugin_IECallBack();
+
+ bool Export( int theDocId,
+ 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 );
+
+ TCollection_AsciiString ReadValue( int theDocId,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_IExport_HXX_
+#define _IGESPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTIGES_ARG_ORIGINAL 1
+#define EXPORTIGES_ARG_FILENAME 2
+#define EXPORTIGES_ARG_VERSION 3
+
+class IGESPlugin_IExport
+{
+public:
+ IGESPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTIGES_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTIGES_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTIGES_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTIGES_ARG_FILENAME ); }
+
+ void SetVersion( const TCollection_AsciiString& theVersion )
+ { _func->SetString( EXPORTIGES_ARG_VERSION, theVersion ); }
+ TCollection_AsciiString GetVersion()
+ { return _func->GetString( EXPORTIGES_ARG_VERSION ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _IGESPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_IImport_HXX_
+#define _IGESPlugin_IImport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTIGES_ARG_FILENAME 1
+#define IMPORTIGES_ARG_IGNORE_UNITS 2
+
+class IGESPlugin_IImport
+{
+public:
+ IGESPlugin_IImport( Handle(GEOM_Function) theFunction)
+ : _func(theFunction) {}
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( IMPORTIGES_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( IMPORTIGES_ARG_FILENAME ); }
+
+ void SetIsIgnoreUnits( bool theIsIgnoreUnits )
+ { _func->SetInteger( IMPORTIGES_ARG_IGNORE_UNITS, int( theIsIgnoreUnits ) ); }
+ bool GetIsIgnoreUnits()
+ { return bool( _func->GetInteger( IMPORTIGES_ARG_IGNORE_UNITS ) ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _IGESPlugin_IImport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_IOperations.hxx"
+#include "IGESPlugin_ExportDriver.hxx"
+#include "IGESPlugin_ImportDriver.hxx"
+#include "IGESPlugin_IExport.hxx"
+#include "IGESPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "IGESPlugin_IOperations::IGESPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+IGESPlugin_IOperations::~IGESPlugin_IOperations()
+{
+ MESSAGE( "IGESPlugin_IOperations::~IGESPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportIGES
+ * Export a shape to IGES format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ * \param theIsASCII The format of the exported file (ASCII or Binary)
+ * \param theDeflection The deflection of the shape to exported
+ * \param theVersion The version of IGES format which defines, whether to write
+ * only faces (5.1 IGES format) or shells and solids also (5.3 IGES format).
+ */
+//=============================================================================
+void IGESPlugin_IOperations::ExportIGES( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theVersion )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ 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);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( IGESPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != IGESPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ IGESPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+ aCI.SetVersion( theVersion );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportIGES(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\", \"" << theVersion.ToCString() << "\" )";
+
+ SetErrorCode(OK);
+}
+
+//=============================================================================
+/*!
+ * ImportIGES
+ * Import a shape from IGES format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+IGESPlugin_IOperations::ImportIGES( const TCollection_AsciiString& theFileName,
+ const bool theIsIgnoreUnits )
+{
+ SetErrorCode(KO);
+ if( theFileName.IsEmpty() ) return NULL;
+
+ //Add a new result object
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+
+ //Add an Import function
+ Handle(GEOM_Function) aFunction =
+ anImported->AddFunction( IGESPlugin_ImportDriver::GetID(), IMPORT_SHAPE);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != IGESPlugin_ImportDriver::GetID()) return NULL;
+
+ //Set parameters
+ IGESPlugin_IImport aCI( aFunction );
+ aCI.SetFileName( theFileName );
+ aCI.SetIsIgnoreUnits( theIsIgnoreUnits );
+
+ //Perform the Import
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Import driver failed" );
+ return NULL;
+ }
+ aSeq->Append(anImported);
+
+ // Greate material groups.
+ // MakeMaterialGroups( anImported, aSeq );
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ if( theIsIgnoreUnits )
+ pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\", True)";
+ else
+ pd << aSeq << " = geompy.ImportIGES(\"" << theFileName.ToCString() << "\")";
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString IGESPlugin_IOperations::ReadValue
+ ( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theParameterName )
+{
+ SetErrorCode(KO);
+
+ TCollection_AsciiString aValue, anError;
+
+ if (theFileName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
+
+ aValue = IGESPlugin_ImportDriver::GetValue( theFileName, theParameterName, anError );
+
+ if( aValue.IsEmpty() ) {
+ if( anError.IsEmpty() )
+ anError = theFileName + " doesn't contain requested parameter";
+ return aValue;
+ }
+ if (anError.IsEmpty())
+ SetErrorCode(OK);
+ else
+ SetErrorCode(anError.ToCString());
+
+ return aValue;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : IGESPlugin_IOperations.hxx
+
+#ifndef _IGESPlugin_IOperations_HXX_
+#define _IGESPlugin_IOperations_HXX_
+
+// internal includes
+#include "IGESPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+
+class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ IGESPlugin_IOperations( GEOM_Engine*, int );
+ ~IGESPlugin_IOperations();
+
+ void ExportIGES( const Handle(GEOM_Object),
+ const TCollection_AsciiString&,
+ const TCollection_AsciiString& );
+
+ Handle(TColStd_HSequenceOfTransient) ImportIGES( const TCollection_AsciiString&,
+ const bool );
+
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString&,
+ const TCollection_AsciiString& );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_IOperations_i.hh"
+#include "IGESPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+IGESPlugin_IOperations_i::IGESPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ IGESPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "IGESPlugin_IOperations_i::IGESPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+IGESPlugin_IOperations_i::~IGESPlugin_IOperations_i()
+{
+ MESSAGE( "IGESPlugin_IOperations_i::~IGESPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportIGES
+ * Export a shape to IGES format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ * \param theVersion The version of IGES format which defines, whether to write
+ * only faces (5.1 IGES format) or shells and solids also (5.3 IGES format).
+ */
+//=============================================================================
+void IGESPlugin_IOperations_i::ExportIGES( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName,
+ const char* theVersion )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ GetOperations()->ExportIGES( anOriginal, theFileName, theVersion );
+}
+
+//=============================================================================
+/*!
+ * ImportIGES
+ * Import a shape from IGES format
+ * \param theFileName The name of the file to import
+ * \param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+ * and result model will be scaled, if its units are not meters.
+ * If False (default), file length units will be taken into account.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* IGESPlugin_IOperations_i::ImportIGES( const char* theFileName,
+ const bool theIsIgnoreUnits = false )
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Import the shape from the file
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportIGES( theFileName, theIsIgnoreUnits );
+
+ if( !GetOperations()->IsDone() || aHSeq.IsNull() )
+ return aSeq._retn();
+
+ // Copy created objects.
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length( aLength );
+ for( Standard_Integer i = 1; i <= aLength; i++ )
+ aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+char* IGESPlugin_IOperations_i::ReadValue( const char* theFileName,
+ const char* theParameterName )
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ TCollection_AsciiString aParam = GetOperations()->ReadValue( theFileName, theParameterName );
+
+ return CORBA::string_dup( aParam.ToCString() );
+}
+
+IGESPlugin_IOperations* IGESPlugin_IOperations_i::GetOperations()
+{
+ return (IGESPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_IOperations_i_HeaderFile
+#define _IGESPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( IGESPlugin )
+
+// internal includes
+#include "IGESPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class IGESPlugin_IOperations;
+
+class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations_i :
+ public virtual POA_GEOM::IIGESOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ IGESPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ IGESPlugin_IOperations* theImpl );
+ ~IGESPlugin_IOperations_i();
+
+ void ExportIGES( GEOM::GEOM_Object_ptr, const char*, const char* );
+ GEOM::ListOfGO* ImportIGES( const char*, const bool );
+ char* ReadValue( const char*, const char* );
+
+ IGESPlugin_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_ImportDriver.hxx"
+#include "IGESPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+#include "GEOMImpl_Types.hxx"
+
+// OOCT includes
+#include <IFSelect_ReturnStatus.hxx>
+#include <IGESControl_Reader.hxx>
+#include <IGESData_IGESModel.hxx>
+#include <IGESData_IGESEntity.hxx>
+
+#include <Interface_Static.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <Transfer_Binder.hxx>
+#include <TransferBRep.hxx>
+
+#include <TNaming_Builder.hxx>
+#include <TDF_TagSource.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDF_Label.hxx>
+
+#include <TCollection_HAsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <BRep_Builder.hxx>
+#include <gp_Pnt.hxx>
+
+#include <StdFail_NotDone.hxx>
+#include <Standard_Failure.hxx>
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& IGESPlugin_ImportDriver::GetID()
+{
+ static Standard_GUID aGUID("3dbb09b8-659f-4a0f-88b9-d9968c43a448");
+ return aGUID;
+}
+
+//=======================================================================
+//function : IGESPlugin_ImportDriver
+//purpose :
+//=======================================================================
+IGESPlugin_ImportDriver::IGESPlugin_ImportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer IGESPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ IGESPlugin_IImport aData( aFunction );
+
+ TCollection_AsciiString aFileName = aData.GetFileName().ToCString();
+ bool anIsIgnoreUnits = aData.GetIsIgnoreUnits();
+ TDF_Label aShapeLabel = aFunction->GetNamingEntry();
+
+ TopoDS_Shape aResShape;
+ TCollection_AsciiString anError;
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ IGESControl_Reader aReader;
+
+ Interface_Static::SetCVal( "xstep.cascade.unit", "M" );
+
+ try {
+ OCC_CATCH_SIGNALS;
+
+ IFSelect_ReturnStatus status = aReader.ReadFile( aFileName.ToCString() );
+
+ if (status == IFSelect_RetDone) {
+ if( anIsIgnoreUnits ) {
+ // need re-scale a model, set UnitFlag to 'meter'
+ Handle(IGESData_IGESModel) aModel =
+ Handle(IGESData_IGESModel)::DownCast( aReader.Model() );
+ if( !aModel.IsNull() ) {
+ IGESData_GlobalSection aGS = aModel->GlobalSection();
+ aGS.SetUnitFlag(6);
+ aModel->SetGlobalSection(aGS);
+ }
+ }
+
+ MESSAGE("ImportIGES : all Geometry Transfer");
+ //OCC 5.1.2 porting
+ // aReader.Clear();
+ // aReader.TransferRoots(false);
+ aReader.ClearShapes();
+ aReader.TransferRoots();
+
+ MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes());
+ aResShape = aReader.OneShape();
+
+ // BEGIN: Store names of sub-shapes from file
+ Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
+ Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
+ if (!TR.IsNull()) {
+ Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess();
+ Standard_Integer nb = Model->NbEntities();
+ for (Standard_Integer i = 1; i <= nb; i++) {
+ Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast(Model->Value(i));
+ if (ent.IsNull() || ! ent->HasName()) continue;
+
+ // find target shape
+ Handle(Transfer_Binder) binder = TP->Find( ent );
+ if( binder.IsNull() ) continue;
+ TopoDS_Shape S = TransferBRep::ShapeResult( binder );
+ if( S.IsNull() ) continue;
+
+ // create label and set shape
+ TDF_Label L;
+ TDF_TagSource aTag;
+ L = aTag.NewChild( aShapeLabel );
+ TNaming_Builder tnBuild (L);
+ tnBuild.Generated(S);
+
+ // set a name
+ TCollection_AsciiString string = ent->NameValue()->String();
+ string.LeftAdjust();
+ string.RightAdjust();
+ TCollection_ExtendedString str (string);
+ TDataStd_Name::Set(L, str);
+ }
+ }
+ // END: Store names
+ }
+ else {
+ switch (status) {
+ case IFSelect_RetVoid:
+ anError = "Nothing created or No data to process";
+ break;
+ case IFSelect_RetError:
+ anError = "Error in command or input data";
+ break;
+ case IFSelect_RetFail:
+ anError = "Execution was run, but has failed";
+ break;
+ case IFSelect_RetStop:
+ anError = "Execution has been stopped. Quite possible, an exception was raised";
+ break;
+ default:
+ break;
+ }
+ anError = "Wrong format of the imported file. Can't import file.";
+ aResShape.Nullify();
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ anError = aFail->GetMessageString();
+ aResShape.Nullify();
+ }
+
+ if( aResShape.IsNull() ) {
+ StdFail_NotDone::Raise( anError.ToCString() );
+ return 0;
+ }
+
+ aFunction->SetValue( aResShape );
+
+ log.SetTouched( Label() );
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean IGESPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool IGESPlugin_ImportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction( Label() );
+
+ IGESPlugin_IImport aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "ImportIGES";
+
+ switch ( aType ) {
+ case IMPORT_SHAPE:
+ AddParam( theParams, "File name", aCI.GetFileName() );
+ if( aCI.GetIsIgnoreUnits() )
+ AddParam( theParams, "Format", "IGES_SCALE" );
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+TCollection_AsciiString
+IGESPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theParameterName,
+ TCollection_AsciiString& theError )
+{
+ Handle(TCollection_HAsciiString) aValue;
+
+ if (theParameterName != "LEN_UNITS") {
+ theError = theParameterName + " parameter reading is not supported by IGES plugin";
+ return TCollection_AsciiString();
+ }
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ IGESControl_Reader aReader;
+
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+
+ try {
+ OCC_CATCH_SIGNALS;
+
+ IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
+ if (status == IFSelect_RetDone) {
+ Handle(IGESData_IGESModel) aModel =
+ Handle(IGESData_IGESModel)::DownCast(aReader.Model());
+ if (!aModel.IsNull()) {
+ aValue = aModel->GlobalSection().UnitName();
+ //if (!aValue.IsNull()) {
+ // Handle(TCollection_HAsciiString) aPrefix = new TCollection_HAsciiString ("UNIT_");
+ // aValue->Prepend(aPrefix);
+ //}
+ }
+ }
+ else {
+ theError = theFileName + " reading failed";
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ theError = aFail->GetMessageString();
+ }
+ if (!aValue.IsNull())
+ return aValue->String();
+ else
+ return TCollection_AsciiString();
+}
+
+
+IMPLEMENT_STANDARD_HANDLE( IGESPlugin_ImportDriver, GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( IGESPlugin_ImportDriver, GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _IGESPlugin_ImportDriver_HXX
+#define _IGESPlugin_ImportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( IGESPlugin_ImportDriver, GEOM_BaseDriver );
+
+class IGESPlugin_ImportDriver : public GEOM_BaseDriver
+{
+public:
+ IGESPlugin_ImportDriver();
+ ~IGESPlugin_ImportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+ static
+ TCollection_AsciiString GetValue( const TCollection_AsciiString&,
+ const TCollection_AsciiString&,
+ TCollection_AsciiString& );
+
+DEFINE_STANDARD_RTTI( IGESPlugin_ImportDriver )
+};
+
+#endif // _IGESPlugin_ImportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "IGESPlugin_OperationsCreator.hxx"
+#include "IGESPlugin_IOperations_i.hh"
+#include "IGESPlugin_IOperations.hxx"
+#include "IGESPlugin_ExportDriver.hxx"
+#include "IGESPlugin_ImportDriver.hxx"
+#include "IGESPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, IGESPlugin_IOperations*> IGESPlugin_OperationsCreator::_mapOfOperations;
+
+IGESPlugin_OperationsCreator::IGESPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( IGESPlugin_ExportDriver::GetID(),
+ new IGESPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( IGESPlugin_ImportDriver::GetID(),
+ new IGESPlugin_ImportDriver() );
+
+ // Register callback
+ IGESPlugin_IECallBack* callback = new IGESPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "IGES", callback );
+ GEOMImpl_IECallBack::Register( "IGES_5_3", callback );
+ GEOMImpl_IECallBack::Register( "IGES_SCALE", callback );
+}
+
+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 ) );
+}
+
+IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new IGESPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_IGESPlugin_OperationsCreator_HXX_
+#define _GEOM_IGESPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "IGESPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class IGESPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class IGESPLUGINENGINE_EXPORT IGESPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ IGESPlugin_OperationsCreator();
+ ~IGESPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+private:
+ static IGESPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, IGESPlugin_IOperations*> _mapOfOperations;
+
+ friend class IGESPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTIGES</source>
+ <translation>IGES</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTIGES</source>
+ <translation>Export IGES</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTIGES</source>
+ <translation>Export IGES</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTIGES</source>
+ <translation>IGES</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTIGES</source>
+ <translation>Import IGES</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTIGES</source>
+ <translation>Import IGES</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_GUI</name>
+ <message>
+ <source>IGES_FILES</source>
+ <translation>IGES Files ( *.iges *.igs )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export IGES</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import IGES</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>Take into account the units (%1) embedded to the file?
+Ignoring units will cause model scaling (as dimensions are supposed to be specified in meters).</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_ExportDlg</name>
+ <message>
+ <source>IGES_VERSION</source>
+ <translation>Version</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTIGES</source>
+ <translation>IGES</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTIGES</source>
+ <translation>Exporter IGES</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTIGES</source>
+ <translation>Exporter IGES</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTIGES</source>
+ <translation>IGES</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTIGES</source>
+ <translation>Importer IGES</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTIGES</source>
+ <translation>Importer IGES</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_GUI</name>
+ <message>
+ <source>IGES_FILES</source>
+ <translation>IGES Fichiers ( *.iges *.igs )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter IGES</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer IGES</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>Voulez-vous prendre les unités du fichier (%1) en considération?
+Sinon le modèle sera mis à l'échelle GEOM (unités interprétées comme des mètres).</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_ExportDlg</name>
+ <message>
+ <source>IGES_VERSION</source>
+ <translation>Version</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTIGES</source>
+ <translation type="unfinished">IGES</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTIGES</source>
+ <translation type="unfinished">Export IGES</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTIGES</source>
+ <translation type="unfinished">Export IGES</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTIGES</source>
+ <translation type="unfinished">IGES</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTIGES</source>
+ <translation type="unfinished">Import IGES</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTIGES</source>
+ <translation type="unfinished">Import IGES</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_GUI</name>
+ <message>
+ <source>IGES_FILES</source>
+ <translation type="unfinished">IGES Files ( *.iges *.igs )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export IGES</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation type="unfinished">Import IGES</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+ </message>
+</context>
+<context>
+ <name>IGESPlugin_ExportDlg</name>
+ <message>
+ <source>IGES_VERSION</source>
+ <translation type="unfinished">Version</translation>
+ </message>
+</context>
+</TS>
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-INCLUDE(UseQt4Ext)
-INCLUDE(${QT_USE_FILE})
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${QT_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${VTK_INCLUDE_DIRS}
- ${OMNIORB_INCLUDE_DIR}
- ${CAS_INCLUDE_DIRS}
- ${KERNEL_INCLUDE_DIRS}
- ${GUI_INCLUDE_DIRS}
- ${PROJECT_BINARY_DIR}/idl
- ${PROJECT_BINARY_DIR}
- ${PROJECT_SOURCE_DIR}/src/OBJECT
- ${PROJECT_SOURCE_DIR}/src/GEOMClient
- ${PROJECT_SOURCE_DIR}/src/GEOMImpl
- ${PROJECT_SOURCE_DIR}/src/GEOMGUI
- ${PROJECT_SOURCE_DIR}/src/GEOMBase
- ${PROJECT_SOURCE_DIR}/src/GEOM
- ${PROJECT_SOURCE_DIR}/src/DlgRef
- ${PROJECT_BINARY_DIR}/src/DlgRef
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- ${OMNIORB_DEFINITIONS}
- ${QT_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- GEOMObject
- GEOMClient
- GEOMImpl
- GEOMBase
- GEOM
- DlgRef
- )
-
-# --- headers ---
-
-# header files / no moc processing
-SET(ImportExportGUI_HEADERS
- ImportExportGUI.h
- )
-
-# header files / to be processed by moc
-SET(_moc_HEADERS
- ImportExportGUI_ExportXAODlg.h
- ImportExportGUI_ImportXAODlg.h
- )
-
-# --- sources ---
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-SET(ImportExportGUI_SOURCES
- ImportExportGUI.cxx
- ImportExportGUI_ExportXAODlg.cxx
- ImportExportGUI_ImportXAODlg.cxx
- ${_moc_SOURCES}
- )
-
-# --- rules ---
-
-ADD_LIBRARY(ImportExportGUI ${ImportExportGUI_SOURCES})
-TARGET_LINK_LIBRARIES(ImportExportGUI ${_link_LIBRARIES})
-INSTALL(TARGETS ImportExportGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <iostream>
-#include <QDialog>
-
-#include "GeometryGUI.h"
-#include "GeometryGUI_Operations.h"
-
-#include <GEOMBase.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SalomeApp_Application.h>
-
-#include "ImportExportGUI_ExportXAODlg.h"
-#include "ImportExportGUI_ImportXAODlg.h"
-#include "ImportExportGUI.h"
-//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
-
-
-//=======================================================================
-// function : ImportExportGUI()
-// purpose : Constructor
-//=======================================================================
-ImportExportGUI::ImportExportGUI(GeometryGUI* parent) :
- GEOMGUI(parent)
-{
-}
-
-//=======================================================================
-// function : ~ImportExportGUI
-// purpose : Destructor
-//=======================================================================
-ImportExportGUI::~ImportExportGUI()
-{
-}
-
-//=======================================================================
-// function : OnGUIEvent()
-// purpose :
-//=======================================================================
-bool ImportExportGUI::OnGUIEvent(int commandId, SUIT_Desktop* parent)
-{
- SalomeApp_Application* app = getGeometryGUI()->getApp();
- if (!app) return false;
-
- getGeometryGUI()->EmitSignalDeactivateDialog();
-
- QDialog* dialog = NULL;
- switch (commandId)
- {
- case GEOMOp::OpExportXAO:
- dialog = new ImportExportGUI_ExportXAODlg(getGeometryGUI(), parent);
- break;
- case GEOMOp::OpImportXAO:
- dialog = new ImportExportGUI_ImportXAODlg(getGeometryGUI(), parent);
- break;
- //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
- default:
- app->putInfo(tr("GEOM_PRP_COMMAND").arg(commandId));
- break;
- }
-
- if (dialog != NULL)
- dialog->show();
-
- return true;
-}
-
-//=====================================================================================
-// EXPORTED METHODS
-//=====================================================================================
-extern "C"
-{
-#ifdef WIN32
- __declspec( dllexport )
-#endif
- GEOMGUI* GetLibGUI(GeometryGUI* parent)
- {
- return new ImportExportGUI(parent);
- }
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : ImportExportGUI.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#ifndef IMPORTEXPORTGUI_H
-#define IMPORTEXPORTGUI_H
-
-#include "GEOMGUI.h"
-
-//=================================================================================
-// class : ImportExportGUI
-// purpose :
-//=================================================================================
-class ImportExportGUI: public GEOMGUI
-{
-public:
- ImportExportGUI(GeometryGUI* parent);
- ~ImportExportGUI();
-
- bool OnGUIEvent(int commandId, SUIT_Desktop* parent);
-};
-
-#endif // IMPORTEXPORTGUI_H
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-
-#include <SUIT_Session.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_OverrideCursor.h>
-#include <SUIT_FileDlg.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <SalomeApp_Tools.h>
-#include <LightApp_SelectionMgr.h>
-
-#include <QLabel>
-#include <QLineEdit>
-#include <QButtonGroup>
-#include <QListWidget>
-#include <QFileDialog>
-#include <QMap>
-
-// OCCT Includes
-#include <TopoDS_Shape.hxx>
-#include <TopoDS.hxx>
-#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-
-#include <GEOMImpl_Types.hxx>
-#include "ImportExportGUI_ExportXAODlg.h"
-
-//=================================================================================
-// Constructor
-//=================================================================================
-ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg(GeometryGUI* geometryGUI, QWidget* parent)
-:
- GEOMBase_Skeleton(geometryGUI, parent, false)
-{
- m_mainObj = GEOM::GEOM_Object::_nil();
-
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("ICON_DLG_EXPORTXAO")));
- QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
-
- setWindowTitle(tr("GEOM_EXPORTXAO_TITLE"));
-
- /***************************************************************/
- mainFrame()->GroupConstructors->setTitle(tr("GEOM_EXPORTXAO_TITLE"));
- mainFrame()->RadioButton1->setIcon(imageOp);
- mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
- mainFrame()->RadioButton2->close();
- mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
- mainFrame()->RadioButton3->close();
-
- // hide name
- mainFrame()->GroupBoxName->hide();
-
- //****************************
- // Selection Group box
- QGroupBox* gbxExport = new QGroupBox(parent);
-
- QGridLayout* gridLayoutExport = new QGridLayout(gbxExport);
-#ifndef Q_OS_MAC
- gridLayoutExport->setSpacing(6);
- gridLayoutExport->setContentsMargins(9, 9, 9, 9);
-#endif
- gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
-
- // Line 0
- QLabel* lblShape = new QLabel(tr("GEOM_EXPORTXAO_EXPORTINGSHAPE"), gbxExport);
- btnShapeSelect = new QPushButton(gbxExport);
- btnShapeSelect->setIcon(iconSelect);
- ledShape = new QLineEdit(gbxExport);
- ledShape->setMinimumSize(QSize(100, 0));
-
- int line = 0, col = 0;
- gridLayoutExport->addWidget(lblShape, line, col++, 1, 1);
- gridLayoutExport->addWidget(btnShapeSelect, line, col++, 1, 1);
- gridLayoutExport->addWidget(ledShape, line, col++, 1, 1);
-
- // Line 1
- QLabel* lblFileName = new QLabel(tr("GEOM_EXPORTXAO_FILENAME"), gbxExport);
- btnFileSelect = new QPushButton(gbxExport);
- ledFileName = new QLineEdit(gbxExport);
- btnFileSelect->setText("...");
-
- line++; col = 0;
- gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1);
- gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1);
- gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1);
-
- // Line 2
- QLabel* lblAuthor = new QLabel(tr("GEOM_EXPORTXAO_AUTHOR"), gbxExport);
- ledAuthor = new QLineEdit(gbxExport);
-
- line++; col = 0;
- gridLayoutExport->addWidget(lblAuthor, line, col++, 2, 1);
- col++; // span
- gridLayoutExport->addWidget(ledAuthor, line, col++, 1, 1);
-
- //****************************
- // Filter Group box
- QGroupBox* gbxFilter = new QGroupBox(parent);
-
- QGridLayout* gridLayoutFilter = new QGridLayout(gbxFilter);
-#ifndef Q_OS_MAC
- gridLayoutFilter->setSpacing(6);
- gridLayoutFilter->setContentsMargins(9, 9, 9, 9);
-#endif
- gridLayoutFilter->setObjectName(QString::fromUtf8("gbxFilter"));
-
- // Line 0
- QLabel* lblGroups = new QLabel(tr("GEOM_EXPORTXAO_LGROUPS"), gbxFilter);
- QLabel* lblFields = new QLabel(tr("GEOM_EXPORTXAO_LFIELDS"), gbxFilter);
-
- line = 0, col = 0;
- gridLayoutFilter->addWidget(lblGroups, line, col++, 1, 1);
- gridLayoutFilter->addWidget(lblFields, line, col++, 1, 1);
-
- // Line 1
- lstGroups = new QListWidget(gbxFilter);
- lstGroups->setSelectionMode(QAbstractItemView::NoSelection);
- lstFields = new QListWidget(gbxFilter);
- lstFields->setSelectionMode(QAbstractItemView::NoSelection);
-
- line++; col = 0;
- gridLayoutFilter->addWidget(lstGroups, line, col++, 1, 1);
- gridLayoutFilter->addWidget(lstFields, line, col++, 1, 1);
-
- //****************************
- QVBoxLayout* layout = new QVBoxLayout(centralWidget());
- layout->setMargin(0);
- layout->setSpacing(6);
- layout->addWidget(gbxExport);
- layout->addWidget(gbxFilter);
-
- // set help
- setHelpFileName("xao_format_page.html");
-
- Init();
-}
-
-//=================================================================================
-// Destructor
-//=================================================================================
-ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::Init()
-{
- // Get setting of step value from file configuration
- m_groups.clear();
- m_fields.clear();
-
- // Signal/slot connections
- connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(btnShapeSelect, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(((SalomeApp_Application*) (SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked()));
-
- initName(tr("GEOM_EXPORTXAO"));
- SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : processObject()
-// purpose : Fill dialog fields in accordance with myObj
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::processObject()
-{
- lstGroups->clear();
- lstFields->clear();
- m_groups.clear();
- m_fields.clear();
-
- if (m_mainObj->_is_nil())
- {
- ledShape->setText("");
- }
- else
- {
- ledShape->setText(GEOMBase::GetName(m_mainObj));
- GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId());
-
- // add groups names
- GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true);
- for (int i = 0, n = groups->length(); i < n; i++)
- {
- QListWidgetItem* item = new QListWidgetItem();
- item->setData(Qt::UserRole, QVariant(i));
- item->setText(GEOMBase::GetName(groups[i]));
- item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
- item->setCheckState(Qt::Checked);
- lstGroups->addItem(item);
- m_groups.append(GEOM::GeomObjPtr(groups[i].in()));
- }
- lstGroups->sortItems(Qt::AscendingOrder);
-
- // add fields
- GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(getStudyId());
-
- GEOM::ListOfFields_var fields = fieldOp->GetFields(m_mainObj);
- for (int i = 0, n = fields->length(); i < n; i++)
- {
- QListWidgetItem* item = new QListWidgetItem();
- item->setData(Qt::UserRole, QVariant(i));
- item->setText(fields[i]->GetName());
- item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
- item->setCheckState(Qt::Checked);
- lstFields->addItem(item);
- m_fields.append(GEOM::GeomFieldPtr(fields[i].in()));
- }
- lstFields->sortItems(Qt::AscendingOrder);
- }
-}
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::ClickOnOk()
-{
- setIsApplyAndClose(true);
- if (ClickOnApply())
- ClickOnCancel();
- setIsApplyAndClose(false);
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ExportXAODlg::ClickOnApply()
-{
- if (!isApplyAndClose())
- {
- setIsDisableBrowsing(true);
- setIsDisplayResult(false);
- }
-
- QString msg;
- if (!isValid(msg))
- {
- showError(msg);
- return false;
- }
- SUIT_OverrideCursor wc;
- SUIT_Session::session()->activeApplication()->putInfo("");
-
- try
- {
- if (openCommand())
- if (!execute())
- {
- abortCommand();
- showError();
- return false;
- }
- }
- catch (const SALOME::SALOME_Exception& e)
- {
- SalomeApp_Tools::QtCatchCorbaException(e);
- abortCommand();
- return false;
- }
- commitCommand();
-
- if (!isApplyAndClose())
- {
- setIsDisableBrowsing(false);
- setIsDisplayResult(true);
- }
-
- processObject();
-
- return true;
-}
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
-{
- m_mainObj = GEOM::GEOM_Object::_nil();
-
- LightApp_SelectionMgr* selMgr = myGeomGUI->getApp()->selectionMgr();
- SALOME_ListIO selList;
- selMgr->selectedObjects(selList);
-
- if (selList.Extent() == 1)
- {
- m_mainObj = GEOMBase::ConvertIOinGEOMObject(selList.First());
- }
-
- processObject();
-}
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument()
-{
- ledShape->setFocus();
- myEditCurrentArgument = ledShape;
- SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : btnFileSelectClicked()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::btnFileSelectClicked()
-{
- QString file = SUIT_FileDlg::getFileName(this, ledFileName->text(),
- tr("XAO_FILES"),
- tr("GEOM_SELECT_EXPORT_XAO"), false);
- if ( !file.isEmpty() )
- ledFileName->setText( file );
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
-}
-
-//=================================================================================
-// function : enterEvent [REDEFINED]
-// purpose :
-//=================================================================================
-void ImportExportGUI_ExportXAODlg::enterEvent(QEvent*)
-{
- if (!mainFrame()->GroupConstructors->isEnabled())
- ActivateThisDialog();
-}
-
-//=================================================================================
-// function : createOperation
-// purpose :
-//=================================================================================
-GEOM::GEOM_IOperations_ptr ImportExportGUI_ExportXAODlg::createOperation()
-{
- return getGeomEngine()->GetIInsertOperations(getStudyId());
-}
-
-//=================================================================================
-// function : isValid
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ExportXAODlg::isValid(QString& msg)
-{
- // check shape
- if (ledShape->text().isEmpty())
- return false;
-
- // check file name
- if (ledFileName->text().isEmpty())
- return false;
-
- return true;
-}
-
-//=================================================================================
-// function : execute
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ExportXAODlg::execute()
-{
- bool res = false;
-
- QString author = ledAuthor->text();
- QString fileName = ledFileName->text();
-
- // get selected groups
- QList<QListWidgetItem*> selGroups;
- for (int j = 0; j < lstGroups->count(); ++j)
- {
- if (lstGroups->item(j)->checkState() == Qt::Checked)
- selGroups.append(lstGroups->item(j));
- }
-
- GEOM::ListOfGO_var groups = new GEOM::ListOfGO();
- groups->length(selGroups.count());
- int i = 0;
- for (QList<QListWidgetItem*>::iterator it = selGroups.begin(); it != selGroups.end(); ++it)
- {
- QListWidgetItem* item = (*it);
- int index = item->data(Qt::UserRole).toInt();
- groups[i++] = m_groups[index].copy();
- }
-
- // get selected fields
- QList<QListWidgetItem*> selFields;
- for (int j = 0; j < lstFields->count(); ++j)
- {
- if (lstFields->item(j)->checkState() == Qt::Checked)
- selFields.append(lstFields->item(j));
- }
-
- GEOM::ListOfFields_var fields = new GEOM::ListOfFields();
- fields->length(selFields.count());
- i = 0;
- for (QList<QListWidgetItem*>::iterator it = selFields.begin(); it != selFields.end(); ++it)
- {
- QListWidgetItem* item = (*it);
- int index = item->data(Qt::UserRole).toInt();
- fields[i++] = m_fields[index].copy();
- }
-
- // call engine function
- GEOM::GEOM_IInsertOperations_var ieOp = GEOM::GEOM_IInsertOperations::_narrow(getOperation());
- res = ieOp->ExportXAO(m_mainObj, groups, fields,
- author.toStdString().c_str(),
- fileName.toStdString().c_str());
-
- return res;
-}
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef IMPORTEXPORTGUI_EXPORTXAODLG_H
-#define IMPORTEXPORTGUI_EXPORTXAODLG_H
-
-#include <GEOMBase_Skeleton.h>
-#include <GEOM_GenericObjPtr.h>
-
-class QLineEdit;
-class QButtonGroup;
-class QListWidget;
-
-//class ImportExportGUI_1Sel1LineEdit2ListWidget;
-
-//=================================================================================
-// class : ImportExportGUI_ExportXAODlg
-// purpose :
-//=================================================================================
-class ImportExportGUI_ExportXAODlg: public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- ImportExportGUI_ExportXAODlg(GeometryGUI*, QWidget* = 0);
- ~ImportExportGUI_ExportXAODlg();
-
-protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid(QString&);
- virtual bool execute();
-
-private:
- void Init();
- void enterEvent(QEvent*);
- void processObject();
-
-private:
- GEOM::GEOM_Object_var m_mainObj;
- QList<GEOM::GeomObjPtr> m_groups;
- QList<GEOM::GeomFieldPtr> m_fields;
- QLineEdit* ledShape;
- QLineEdit* ledFileName;
- QLineEdit* ledAuthor;
- QListWidget* lstGroups;
- QListWidget* lstFields;
- QPushButton* btnShapeSelect;
- QPushButton* btnFileSelect;
-
-private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- void btnFileSelectClicked();
-};
-
-#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <GEOM_Field.hxx>
-
-#include <SUIT_Session.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_OverrideCursor.h>
-#include <SUIT_FileDlg.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <LightApp_SelectionMgr.h>
-#include <SalomeApp_Tools.h>
-
-#include <QLabel>
-#include <QLineEdit>
-#include <QButtonGroup>
-#include <QListWidget>
-#include <QFileDialog>
-#include <QMap>
-
-// OCCT Includes
-#include <TopoDS_Shape.hxx>
-#include <TopoDS.hxx>
-#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-
-#include <GEOMImpl_Types.hxx>
-#include "ImportExportGUI_ImportXAODlg.h"
-
-#include <SALOMEDS_wrap.hxx>
-
-//=================================================================================
-// Constructor
-//=================================================================================
-ImportExportGUI_ImportXAODlg::ImportExportGUI_ImportXAODlg(GeometryGUI* geometryGUI, QWidget* parent)
-:
- GEOMBase_Skeleton(geometryGUI, parent, false)
-{
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("ICON_DLG_IMPORTXAO")));
- QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
-
- setWindowTitle(tr("GEOM_IMPORTXAO_TITLE"));
-
- /***************************************************************/
- mainFrame()->GroupConstructors->setTitle(tr("GEOM_IMPORTXAO_TITLE"));
- mainFrame()->RadioButton1->setIcon(imageOp);
- mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
- mainFrame()->RadioButton2->close();
- mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
- mainFrame()->RadioButton3->close();
-
- // hide name
- mainFrame()->GroupBoxName->hide();
-
- //****************************
- // Selection Group box
- QGroupBox* gbxExport = new QGroupBox(parent);
-
- QGridLayout* gridLayoutExport = new QGridLayout(gbxExport);
-#ifndef Q_OS_MAC
- gridLayoutExport->setSpacing(6);
- gridLayoutExport->setContentsMargins(9, 9, 9, 9);
-#endif
- gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
-
- int line = 0, col = 0;
- QLabel* lblFileName = new QLabel(tr("GEOM_IMPORTXAO_FILENAME"), gbxExport);
- btnFileSelect = new QPushButton(gbxExport);
- ledFileName = new QLineEdit(gbxExport);
- btnFileSelect->setText("...");
-
- line++; col = 0;
- gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1);
- gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1);
- gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1);
-
- //****************************
- QVBoxLayout* layout = new QVBoxLayout(centralWidget());
- layout->setMargin(0);
- layout->setSpacing(6);
- layout->addWidget(gbxExport);
-
- // set help
- setHelpFileName("xao_format_page.html");
-
- Init();
-}
-
-//=================================================================================
-// Destructor
-//=================================================================================
-ImportExportGUI_ImportXAODlg::~ImportExportGUI_ImportXAODlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ImportXAODlg::Init()
-{
- // Signal/slot connections
- connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
- connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked()));
-
- initName(tr("GEOM_IMPORTXAO"));
- //SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ImportXAODlg::ClickOnOk()
-{
- setIsApplyAndClose(true);
- if (ClickOnApply())
- ClickOnCancel();
- setIsApplyAndClose(false);
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ImportXAODlg::ClickOnApply()
-{
- if(!isApplyAndClose()) {
- setIsDisableBrowsing( true );
- setIsDisplayResult( false );
- }
-
- QString msg;
- if ( !isValid( msg ) ) {
- showError( msg );
- return false;
- }
- SUIT_OverrideCursor wc;
- SUIT_Session::session()->activeApplication()->putInfo( "" );
-
- try {
- if ( openCommand() )
- if (!execute (/*isApplyAndClose()*/))
- {
- abortCommand();
- showError();
- return false;
- }
- }
- catch( const SALOME::SALOME_Exception& e ) {
- SalomeApp_Tools::QtCatchCorbaException( e );
- abortCommand();
- return false;
- }
- commitCommand();
-
- if(!isApplyAndClose()) {
- setIsDisableBrowsing( false );
- setIsDisplayResult( true );
- }
-
- return true;
-}
-
-//=================================================================================
-// function : btnFileSelectClicked()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ImportXAODlg::btnFileSelectClicked()
-{
- QString file = SUIT_FileDlg::getFileName(this, ledFileName->text(),
- tr("XAO_FILES"),
- tr("GEOM_SELECT_IMPORT_XAO"));
- if ( !file.isEmpty() )
- ledFileName->setText( file );
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void ImportExportGUI_ImportXAODlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
-}
-
-//=================================================================================
-// function : enterEvent [REDEFINED]
-// purpose :
-//=================================================================================
-void ImportExportGUI_ImportXAODlg::enterEvent(QEvent*)
-{
- if (!mainFrame()->GroupConstructors->isEnabled())
- ActivateThisDialog();
-}
-
-//=================================================================================
-// function : createOperation
-// purpose :
-//=================================================================================
-GEOM::GEOM_IOperations_ptr ImportExportGUI_ImportXAODlg::createOperation()
-{
- return getGeomEngine()->GetIInsertOperations(getStudyId());
-}
-
-//=================================================================================
-// function : isValid
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ImportXAODlg::isValid(QString& msg)
-{
- // check file name
- if (ledFileName->text().isEmpty())
- return false;
-
- return true;
-}
-
-//=================================================================================
-// function : execute
-// purpose :
-//=================================================================================
-bool ImportExportGUI_ImportXAODlg::execute()
-{
- bool res = false;
-
- QString fileName = ledFileName->text();
- GEOM::GEOM_Object_var shape;
- GEOM::ListOfGO_var groups, subShapes;
- GEOM::ListOfFields_var fields;
-
- GEOM::GEOM_IInsertOperations_var ieOp = GEOM::GEOM_IInsertOperations::_narrow(getOperation());
- res = ieOp->ImportXAO(fileName.toUtf8().constData(), shape, subShapes, groups, fields);
-
- if (!shape->_is_nil())
- {
- m_mainShape = shape;
- }
- else
- {
- m_mainShape = NULL;
- }
-
- if (m_mainShape != NULL)
- {
- QStringList anEntryList;
- anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
-
- for (int i = 0; i < subShapes->length(); i++)
- {
- addInStudy(subShapes[i].in(), subShapes[i]->GetName());
- }
- for (int i = 0; i < groups->length(); i++)
- {
- addInStudy(groups[i].in(), groups[i]->GetName());
- }
- for (int i = 0; i < fields->length(); i++)
- {
- addFieldInStudy(fields[i].in(), m_mainShape);
- }
-
- updateObjBrowser();
- if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) {
- LightApp_Application* aLightApp = dynamic_cast<LightApp_Application*>( anApp );
- aLightApp->browseObjects( anEntryList );
- }
- }
-
- return res;
-}
-
-QString ImportExportGUI_ImportXAODlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEOM::GEOM_Object_ptr theFather)
-{
- if ( !hasCommand() )
- return QString();
-
- _PTR(Study) aStudy = getStudy()->studyDS();
- 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);
-
- QString anEntry;
- if ( !aSO->_is_nil() ) {
- CORBA::String_var entry = aSO->GetID();
- anEntry = entry.in();
- }
-
- // add steps
- GEOM::ListOfLong_var steps = theField->GetSteps();
- for (int i = 0; i < steps->length(); ++i)
- {
- GEOM::GEOM_FieldStep_ptr step = theField->GetStep(steps[i]);
- QString stepName = (tr("STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
- SALOMEDS::SObject_wrap aSOField =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
- }
-
- aSO->UnRegister();
-
- return anEntry;
-}
-
-GEOM::GEOM_Object_ptr ImportExportGUI_ImportXAODlg::getFather(GEOM::GEOM_Object_ptr object)
-{
- GEOM::GEOM_Object_var fatherObj;
- if (object->GetType() != GEOM_IMPORT && m_mainShape != NULL)
- {
- //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(getStudyId());
- //fatherObj = groupOper->GetMainShape(object);
- fatherObj = m_mainShape;
- }
- return fatherObj._retn();
-}
-
-QString ImportExportGUI_ImportXAODlg::getObjectName(GEOM::GEOM_Object_ptr object) const
-{
- if (object->_is_nil())
- return QString::null;
- return object->GetName();
-}
-
+++ /dev/null
-// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef IMPORTEXPORTGUI_IMPORTXAODLG_H
-#define IMPORTEXPORTGUI_IMPORTXAODLG_H
-
-#include <GEOMBase_Skeleton.h>
-#include <GEOM_GenericObjPtr.h>
-
-class QLineEdit;
-class QButtonGroup;
-class QListWidget;
-
-//=================================================================================
-// class : ImportExportGUI_ImportXAODlg
-// purpose :
-//=================================================================================
-class ImportExportGUI_ImportXAODlg: public GEOMBase_Skeleton
-{
- Q_OBJECT
-
-public:
- ImportExportGUI_ImportXAODlg(GeometryGUI*, QWidget* = 0);
- ~ImportExportGUI_ImportXAODlg();
-
-protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid(QString&);
- virtual bool execute();
- virtual GEOM::GEOM_Object_ptr getFather(GEOM::GEOM_Object_ptr object);
- virtual QString getObjectName(GEOM::GEOM_Object_ptr object) const;
- virtual QString addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEOM::GEOM_Object_ptr theFather );
-
-private:
- void Init();
- void enterEvent(QEvent*);
-
-private:
- QLineEdit* ledFileName;
- QPushButton* btnFileSelect;
- GEOM::GEOM_Object_var m_mainShape;
-
-private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
-// void LineEditReturnPressed();
- void btnFileSelectClicked();
-};
-
-#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>MeasureGUI_1Sel12LineEdit_QTD</class>
- <widget class="QWidget" name="MeasureGUI_1Sel12LineEdit_QTD" >
- <property name="geometry" >
+ <widget class="QWidget" name="MeasureGUI_1Sel12LineEdit_QTD">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>196</width>
- <height>162</height>
+ <width>501</width>
+ <height>171</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string/>
</property>
- <layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QGroupBox" name="GroupBox1" >
- <property name="title" >
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="GroupBox1">
+ <property name="title">
<string/>
</property>
- <layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
- <item row="0" column="2" >
- <widget class="QLineEdit" name="LineEdit1" >
- <property name="minimumSize" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="TextLabel1">
+ <property name="text">
+ <string>TL1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="PushButton1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" colspan="5">
+ <widget class="QLineEdit" name="LineEdit1">
+ <property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</property>
</widget>
</item>
- <item row="1" column="0" colspan="3" >
- <layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
- <item row="2" column="2" >
- <widget class="QLineEdit" name="LineEdit32" />
- </item>
- <item row="1" column="2" >
- <widget class="QLineEdit" name="LineEdit22" />
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="TextLabel2" >
- <property name="text" >
- <string>TL2</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="LineEdit11" />
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="TextLabel4" >
- <property name="text" >
- <string>TL4</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="LineEdit21" />
- </item>
- <item row="1" column="3" >
- <widget class="QLineEdit" name="LineEdit23" />
- </item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="LineEdit31" />
- </item>
- <item row="3" column="1" >
- <widget class="QLineEdit" name="LineEdit41" />
- </item>
- <item row="3" column="3" >
- <widget class="QLineEdit" name="LineEdit43" />
- </item>
- <item row="0" column="3" >
- <widget class="QLineEdit" name="LineEdit13" />
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="TextLabel5" >
- <property name="text" >
- <string>TL5</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2" >
- <widget class="QLineEdit" name="LineEdit42" />
- </item>
- <item row="0" column="2" >
- <widget class="QLineEdit" name="LineEdit12" />
- </item>
- <item row="2" column="3" >
- <widget class="QLineEdit" name="LineEdit33" />
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="TextLabel3" >
- <property name="text" >
- <string>TL3</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="TextLabel1" >
- <property name="text" >
- <string>TL1</string>
+ <item row="1" column="1">
+ <widget class="QLabel" name="TextLabel2_1">
+ <property name="text">
+ <string>TL2_1</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QPushButton" name="PushButton1" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="1" column="2">
+ <widget class="QLineEdit" name="LineEdit11">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
</property>
- <property name="text" >
- <string/>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLabel" name="TextLabel2_2">
+ <property name="text">
+ <string>TL2_2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4">
+ <widget class="QLineEdit" name="LineEdit12">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5">
+ <widget class="QLabel" name="TextLabel2_3">
+ <property name="text">
+ <string>TL2_3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="6">
+ <widget class="QLineEdit" name="LineEdit13">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="TextLabel3_1">
+ <property name="text">
+ <string>TL3_1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLineEdit" name="LineEdit21">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLabel" name="TextLabel3_2">
+ <property name="text">
+ <string>TL3_2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QLineEdit" name="LineEdit22">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="5">
+ <widget class="QLabel" name="TextLabel3_3">
+ <property name="text">
+ <string>TL3_3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6">
+ <widget class="QLineEdit" name="LineEdit23">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="TextLabel4_1">
+ <property name="text">
+ <string>TL4_1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLineEdit" name="LineEdit31">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="QLabel" name="TextLabel4_2">
+ <property name="text">
+ <string>TL4_2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4">
+ <widget class="QLineEdit" name="LineEdit32">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="5">
+ <widget class="QLabel" name="TextLabel4_3">
+ <property name="text">
+ <string>TL4_3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="6">
+ <widget class="QLineEdit" name="LineEdit33">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="TextLabel5_1">
+ <property name="text">
+ <string>TL5_1</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <widget class="QLineEdit" name="LineEdit41">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="3">
+ <widget class="QLabel" name="TextLabel5_2">
+ <property name="text">
+ <string>TL5_2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="4">
+ <widget class="QLineEdit" name="LineEdit42">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="5">
+ <widget class="QLabel" name="TextLabel5_3">
+ <property name="text">
+ <string>TL5_3</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="6">
+ <widget class="QLineEdit" name="LineEdit43">
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
</property>
</widget>
</item>
/***************************************************************/
// Help page reference
- myHelpFileName = "using_measurement_tools_page.html#angle_anchor";
+ myHelpFileName = "angle_page.html";
// Initialisation
Init();
if (anAngle > Precision::Angular()) {
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
-#endif
TopoDS_Shape S1, S2;
if (GEOMBase::GetShape(myObj , S1, TopAbs_EDGE) &&
GEOMBase::GetShape(myObj2, S2, TopAbs_EDGE)) {
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#check_compound_anchor";
+ myHelpFileName = "check_compound_of_blocks_page.html";
/* Initialisation */
Init();
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#check_self_intersections_anchor";
+ myHelpFileName = "check_self_intersections_page.html";
/* Initialisation */
Init();
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#check_anchor";
+ myHelpFileName = "check_shape_page.html";
/* Initialisation */
Init();
return NULL;
}
+ if( aFirstSh == aSecondSh )
+ return NULL;
+
TopoDS_Edge aFirstEdge = TopoDS::Edge( aFirstSh );
TopoDS_Edge aSecondEdge = TopoDS::Edge( aSecondSh );
myGrp = new MeasureGUI_1Sel12LineEdit( centralWidget() );
myGrp->GroupBox1->setTitle( tr( "GEOM_MATRIX" ) );
myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
- myGrp->TextLabel2->setText( tr( "GEOM_INERTIA_I" ).arg( "1" ) );
- myGrp->TextLabel3->setText( tr( "GEOM_INERTIA_I" ).arg( "2" ) );
- myGrp->TextLabel4->setText( tr( "GEOM_INERTIA_I" ).arg( "3" ) );
- myGrp->TextLabel5->setText( tr( "GEOM_INERTIA_IXYZ" ) );
+ myGrp->TextLabel2_1->setText( "1:1" );
+ myGrp->TextLabel2_2->setText( "1:2" );
+ myGrp->TextLabel2_3->setText( "1:3" );
+ myGrp->TextLabel3_1->setText( "2:1" );
+ myGrp->TextLabel3_2->setText( "2:2" );
+ myGrp->TextLabel3_3->setText( "2:3" );
+ myGrp->TextLabel4_1->setText( "3:1" );
+ myGrp->TextLabel4_2->setText( "3:2" );
+ myGrp->TextLabel4_3->setText( "3:3" );
+ myGrp->TextLabel5_1->setText( "IX" );
+ myGrp->TextLabel5_2->setText( "IY" );
+ myGrp->TextLabel5_3->setText( "IZ" );
myGrp->LineEdit11->setReadOnly( true );
myGrp->LineEdit12->setReadOnly( true );
myGrp->LineEdit13->setReadOnly( true );
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#inertia_anchor";
+ myHelpFileName = "inertia_page.html";
/* Initialisation */
Init();
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#tolerance_anchor";
+ myHelpFileName = "tolerance_page.html";
/* Initialisation */
Init();
layout->addWidget(GroupArgs);
/***************************************************************/
- setHelpFileName("using_measurement_tools_page.html#normale_anchor");
+ setHelpFileName("normal_page.html");
Init();
}
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGrp );
- myHelpFileName = "using_measurement_tools_page.html#point_coord_anchor";
+ myHelpFileName = "point_coordinates_page.html";
Init();
}
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#basic_prop_anchor";
+ myHelpFileName = "basic_prop_page.html";
/* Initialisation */
Init();
/***************************************************************/
- myHelpFileName = "using_measurement_tools_page.html#whatis_anchor";
+ myHelpFileName = "whatis_page.html";
/* Initialisation */
Init();
SET(OBJECT_HEADERS
GEOM_Actor.h
GEOM_AISShape.hxx
- GEOM_AISShape.ixx
- GEOM_AISShape.jxx
- Handle_GEOM_AISShape.hxx
GEOM_TopWireframeShape.hxx
- GEOM_TopWireframeShape.ixx
- GEOM_TopWireframeShape.jxx
- Handle_GEOM_TopWireframeShape.hxx
GEOM_InteractiveObject.hxx
- GEOM_InteractiveObject.ixx
- GEOM_InteractiveObject.jxx
- Handle_GEOM_InteractiveObject.hxx
GEOM_AISTrihedron.hxx
GEOM_VTKTrihedron.hxx
GEOM_VTKPropertyMaterial.hxx
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.cxx
-// Author : Nicolas REJNERI
-// Module : GEOM
-
/*!
\class GEOM_AISShape GEOM_AISShape.hxx
\brief ....
*/
-#include "GEOM_AISShape.ixx"
-#include "SALOME_InteractiveObject.hxx"
+#include "GEOM_AISShape.hxx"
#include "GEOM_AISVector.hxx"
+#include <Basics_OCCTVersion.hxx>
+
// Open CASCADE Includes
#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
-
#include <BRep_Tool.hxx>
-
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Pnt.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_IsoAspect.hxx>
+#if OCC_VERSION_LARGE > 0x06070200
+#include <Prs3d_VertexDrawMode.hxx>
+#endif
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_View.hxx>
#include <SalomeApp_Tools.h>
-
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
+IMPLEMENT_STANDARD_HANDLE (GEOM_AISShape, SALOME_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_AISShape, SALOME_AISShape)
+
GEOM_AISShape::TopLevelDispMode GEOM_AISShape::myTopLevelDm = GEOM_AISShape::TopKeepCurrent;
Quantity_Color GEOM_AISShape::myTopLevelColor;
: SALOME_AISShape(shape),
myName(aName),
myDisplayVectors(false),
+ myDisplayVertices(false),
myFieldDataType(GEOM::FDT_Double),
myFieldDimension(0),
myFieldStepRangeMin(0),
myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
myPrevDisplayMode = 0;
- storeBoundaryColors();
-
myEdgesInShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD );
- myUIsoNumber = -1;
- myVIsoNumber = -1;
-
myTopLevel = Standard_False;
Graphic3d_MaterialAspect aMatAspect;
if ( !HasMaterial() ) {
}
}
+GEOM_AISShape::~GEOM_AISShape()
+{
+}
+
void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){
SetOwner( io );
}
if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
Handle(AIS_InteractiveContext) anIC = GetContext();
+ // AKL: use old behavior to avoid keeping object's wireframe
+ // if to change shape properties (for example: 'Clear Top Level State','Color', 'Isos')
+ // calling popup menu over(!) the shape in OCC viewer.
+ anIC->SetToHilightSelected( false );
bool anIsField = !myFieldStepData.isEmpty();
bool anIsColorField = anIsField && myFieldDataType != GEOM::FDT_String;
bool anIsTextField = anIsField && myFieldDataType == GEOM::FDT_String;
+#if OCC_VERSION_LARGE > 0x06070200
+ if (isShowVertices())
+ myDrawer->SetVertexDrawMode(Prs3d_VDM_All);
+#endif
+
// StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
bool isTopLev = isTopLevel() && switchTopLevel();
switch (aMode) {
- case 0://StdSelect_DM_Wireframe:
+ case Wireframe:
case CustomHighlight:
{
- restoreIsoNumbers();
- // Restore wireframe edges colors
- restoreBoundaryColors();
if(isTopLev) {
SetColor(topLevelColor());
Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect();
StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
break;
}
- case 1://StdSelect_DM_Shading:
+ case Shading:
{
- restoreIsoNumbers();
shadingMode(aPresentationManager, aPrs, aMode);
- // Store wireframe edges colors
- storeBoundaryColors();
break;
}
- case 3: //StdSelect_DM_HLR:
+ case ShadingWithEdges:
+ {
+ shadingMode(aPresentationManager, aPrs, Shading);
+ myDrawer->SetFaceBoundaryDraw( Standard_True );
+ Handle(Prs3d_LineAspect) aBoundaryAspect =
+ new Prs3d_LineAspect ( myEdgesInShadingColor, Aspect_TOL_SOLID, myOwnWidth );
+ myDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
+ break;
+ }
+ case TexturedShape:
{
if(!isTopLev)
- AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
+#ifdef USE_TEXTURED_SHAPE
+ AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
+#else
+ AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
+#endif
else
- shadingMode(aPresentationManager, aPrs, AIS_Shaded);
+ shadingMode(aPresentationManager, aPrs, Shading);
break;
}
}
-
- if ( aMode == ShadingWithEdges ) {
- // Temporary store number of iso lines in order to recover its later
- // when display mode is achnged to 'Wirefame' or 'Shading'.
- // Iso lines are not displayed in 'Shading with edges' mode.
- storeIsoNumbers();
-
- // Reset number of iso lines to 0
- resetIsoNumbers();
-
- //Shaded faces
- shadingMode(aPresentationManager, aPrs, AIS_Shaded);
-
- // Store wireframe edges colors
- storeBoundaryColors();
-
- // Coloring edges
- Handle(Prs3d_LineAspect) anAspect = myDrawer->UnFreeBoundaryAspect();
- anAspect->SetColor( myEdgesInShadingColor );
- myDrawer->SetUnFreeBoundaryAspect( anAspect );
-
- anAspect = myDrawer->FreeBoundaryAspect();
- anAspect->SetColor( myEdgesInShadingColor );
- myDrawer->SetFreeBoundaryAspect( anAspect );
-
- // Add edges to presentation
- if( anIsColorField && myFieldDimension == 1 )
- drawField( aPrs );
- else
- StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
- }
-
if (isShowVectors())
{
const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
myDisplayVectors = isDisplayed;
}
+void GEOM_AISShape::SetDisplayVertices(bool isDisplayed)
+{
+ myDisplayVertices = isDisplayed;
+}
+
void GEOM_AISShape::shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer aMode)
{
// PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
//StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
+#ifdef USE_TEXTURED_SHAPE
+ AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
+#else
AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
+#endif
}
}
-void GEOM_AISShape::storeIsoNumbers()
-{
- myUIsoNumber = myDrawer->UIsoAspect()->Number();
- myVIsoNumber = myDrawer->VIsoAspect()->Number();
-}
-
-void GEOM_AISShape::restoreIsoNumbers()
-{
- if ( myUIsoNumber > 0 ) {
- // Restore number of U iso lines
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
- anAspect->SetNumber( myUIsoNumber );
- myDrawer->SetUIsoAspect( anAspect );
- }
-
- if ( myVIsoNumber > 0 ) {
- // Restore number of V iso lines
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->VIsoAspect();
- anAspect->SetNumber( myVIsoNumber );
- myDrawer->SetVIsoAspect( anAspect );
- }
-}
-
-void GEOM_AISShape::resetIsoNumbers()
-{
- Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect();
- anAspect->SetNumber( 0 );
- myDrawer->SetUIsoAspect( anAspect );
-
- anAspect = myDrawer->VIsoAspect();
- anAspect->SetNumber( 0 );
- myDrawer->SetVIsoAspect( anAspect );
-}
-
-void GEOM_AISShape::storeBoundaryColors()
-{
- Aspect_TypeOfLine aLT;
- Standard_Real aW;
-
- myDrawer->FreeBoundaryAspect()->Aspect()->Values( myFreeBoundaryColor, aLT, aW);
- myDrawer->UnFreeBoundaryAspect()->Aspect()->Values( myUnFreeBoundaryColor, aLT, aW);
-}
-
-void GEOM_AISShape::restoreBoundaryColors()
-{
- Handle(Prs3d_LineAspect) anAspect = myDrawer->FreeBoundaryAspect();
- anAspect->SetColor( myFreeBoundaryColor );
- myDrawer->SetFreeBoundaryAspect( anAspect );
-
- anAspect = myDrawer->UnFreeBoundaryAspect();
- anAspect->SetColor( myUnFreeBoundaryColor );
- myDrawer->SetUnFreeBoundaryAspect( anAspect );
-}
-
-
Standard_Boolean GEOM_AISShape::isTopLevel() {
return myTopLevel;
}
myPrevDisplayMode = DisplayMode();
Standard_Integer dm;
switch(topLevelDisplayMode()) {
- case TopKeepCurrent : dm = myPrevDisplayMode; break;
- case TopWireFrame : dm = AIS_WireFrame; break;
- case TopShadingWithEdges : dm = ShadingWithEdges; break;
- default : dm = AIS_Shaded; break;
+ case TopKeepCurrent : dm = myPrevDisplayMode; break;
+ case TopWireFrame : dm = Wireframe; break;
+ case TopShadingWithEdges : dm = ShadingWithEdges; break;
+ default : dm = Shading; break;
}
SetDisplayMode(dm);
} else {
}
Standard_Boolean GEOM_AISShape::switchTopLevel() {
- return myTopLevelDm != TopShowAdditionalWActor;
+ return myTopLevelDm != TopShowAdditionalWActor;
}
Standard_Boolean GEOM_AISShape::toActivate() {
- return Standard_True;
+ return ( myTopLevel && myTopLevelDm == TopShowAdditionalWActor ) ? false : true;
}
void GEOM_AISShape::setFieldStepInfo( const GEOM::field_data_type theFieldDataType,
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.hxx
-// Module : GEOM
-//
#ifndef _GEOM_AISShape_HeaderFile
#define _GEOM_AISShape_HeaderFile
-#include "GEOM_OBJECT_defs.hxx"
-
-#include <GEOM_Gen.hh>
+#include <SALOME_AISShape.hxx>
+#include <SALOME_InteractiveObject.hxx>
-#ifndef _Standard_HeaderFile
#include <Standard.hxx>
-#endif
-#ifndef _Handle_GEOM_AISShape_HeaderFile
-#include "Handle_GEOM_AISShape.hxx"
-#endif
-
-#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include "Handle_SALOME_InteractiveObject.hxx"
-#endif
-#ifndef _Standard_CString_HeaderFile
-#include <Standard_CString.hxx>
-#endif
-#ifndef _SALOME_AISShape_HeaderFile
-#include "SALOME_AISShape.hxx"
-#endif
-#ifndef _Standard_Boolean_HeaderFile
-#include <Standard_Boolean.hxx>
-#endif
-#ifndef _PrsMgr_PresentationManager_HeaderFile
+#include <Standard_DefineHandle.hxx>
#include <PrsMgr_PresentationManager.hxx>
-#endif
-#ifndef _Handle_Prs3d_Presentation_HeaderFile
#include <Handle_Prs3d_Presentation.hxx>
-#endif
-
#include <TCollection_AsciiString.hxx>
-
#include <AIS_DisplayMode.hxx>
-#include <Graphic3d_MaterialAspect.hxx>
#include <QList>
#include <QVariant>
-class Prs3d_Presentation;
-class SALOME_InteractiveObject;
-class TopoDS_Shape;
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
-class GEOM_OBJECT_EXPORT GEOM_AISShape : public SALOME_AISShape {
+class TopoDS_Shape;
+class GEOM_AISShape : public SALOME_AISShape
+{
public:
-
- //! Enumeration of display modes
- typedef enum {
- //WireFrame, //!< the same as AIS_WireFrame
- //Shading, //!< the same as AIS_Shaded
- ShadingWithEdges = AIS_Shaded+1, //!< shading with edges
- TexturedShape = ShadingWithEdges+1, //!< the same as AIS_ExactHLR
- CustomHighlight = TexturedShape+1
- } DispMode;
-
- //! Enumeration of top level display modes
- typedef enum {
- TopShowAdditionalWActor = 0,
- TopKeepCurrent, //!< Keep current display mode
- TopWireFrame,
- TopShading,
- TopShadingWithEdges,
- } TopLevelDispMode;
-
-
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- // Methods PUBLIC
- //
- GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName);
- Standard_Boolean hasIO() ;
- void setIO(const Handle(SALOME_InteractiveObject)& name) ;
- void setName(const Standard_CString aName) ;
- Standard_CString getName() ;
- Standard_Boolean isTopLevel();
- void setTopLevel(Standard_Boolean);
- Handle_SALOME_InteractiveObject getIO() ;
- void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
- ~GEOM_AISShape();
-
- void SetShadingColor(const Quantity_Color &aCol);
- void SetEdgesInShadingColor(const Quantity_Color &aCol);
- void SetDisplayVectors(bool isShow);
-
- virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
- const Handle(Prs3d_Presentation)& aPresentation,
- const Standard_Integer aMode = 0) ;
-
- virtual bool isShowVectors () { return myDisplayVectors; }
- virtual Standard_Boolean switchTopLevel();
- virtual Standard_Boolean toActivate();
+ //! Enumeration of display modes
+ typedef enum {
+ Wireframe = AIS_WireFrame, //!< wireframe
+ Shading = AIS_Shaded, //!< shadin
+ ShadingWithEdges, //!< shading with edges
+ TexturedShape, //!< texture
+ CustomHighlight //!< fields
+ } DispMode;
+
+ //! Enumeration of top level display modes
+ typedef enum {
+ TopShowAdditionalWActor = 0,
+ TopKeepCurrent, //!< Keep current display mode
+ TopWireFrame,
+ TopShading,
+ TopShadingWithEdges,
+ } TopLevelDispMode;
+
+ Standard_EXPORT GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName);
+ Standard_EXPORT ~GEOM_AISShape();
+
+ Standard_EXPORT Standard_Boolean hasIO();
+ Standard_EXPORT void setIO(const Handle(SALOME_InteractiveObject)& name);
+ Standard_EXPORT Handle(SALOME_InteractiveObject) getIO();
+
+ Standard_EXPORT void setName(const Standard_CString aName);
+ Standard_EXPORT Standard_CString getName();
+
+ Standard_EXPORT Standard_Boolean isTopLevel();
+ Standard_EXPORT void setTopLevel(Standard_Boolean);
+
+ Standard_EXPORT void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
+
+ Standard_EXPORT void SetShadingColor(const Quantity_Color &aCol);
+ Standard_EXPORT void SetEdgesInShadingColor(const Quantity_Color &aCol);
+ Standard_EXPORT void SetDisplayVectors(bool isShow);
+ Standard_EXPORT void SetDisplayVertices(bool isShow);
+
+ Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPresentation,
+ const Standard_Integer aMode = 0);
+
+ Standard_EXPORT virtual bool isShowVectors() { return myDisplayVectors; }
+ Standard_EXPORT virtual bool isShowVertices() { return myDisplayVertices; }
+
+ Standard_EXPORT virtual Standard_Boolean switchTopLevel();
+ Standard_EXPORT virtual Standard_Boolean toActivate();
- // Type management
- //
- friend Handle_Standard_Type& GEOM_AISShape_Type_();
- const Handle(Standard_Type)& DynamicType() const;
- Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
-
- void storeIsoNumbers();
- void restoreIsoNumbers();
- void resetIsoNumbers();
+ Standard_EXPORT static Quantity_Color topLevelColor();
+ Standard_EXPORT static void setTopLevelColor(const Quantity_Color c);
- void storeBoundaryColors();
+ Standard_EXPORT static TopLevelDispMode topLevelDisplayMode();
+ Standard_EXPORT static void setTopLevelDisplayMode(const TopLevelDispMode dm);
- static Quantity_Color topLevelColor();
- static void setTopLevelColor(const Quantity_Color c);
-
- static TopLevelDispMode topLevelDisplayMode();
- static void setTopLevelDisplayMode(const TopLevelDispMode dm);
-
- void setPrevDisplayMode(const Standard_Integer mode);
- Standard_Integer prevDisplayMode() const {return myPrevDisplayMode;}
+ Standard_EXPORT void setPrevDisplayMode(const Standard_Integer mode);
+ Standard_EXPORT Standard_Integer prevDisplayMode() const {return myPrevDisplayMode;}
// Field step information
- void setFieldStepInfo( const GEOM::field_data_type theFieldDataType,
- const int theFieldDimension,
- const QList<QVariant>& theFieldStepData,
- const TCollection_AsciiString& theFieldStepName,
- const double theFieldStepRangeMin,
- const double theFieldStepRangeMax );
- void getFieldStepInfo( GEOM::field_data_type& theFieldDataType,
- int& theFieldDimension,
- QList<QVariant>& theFieldStepData,
- TCollection_AsciiString& theFieldStepName,
- double& theFieldStepRangeMin,
- double& theFieldStepRangeMax ) const;
+ Standard_EXPORT void setFieldStepInfo( const GEOM::field_data_type theFieldDataType,
+ const int theFieldDimension,
+ const QList<QVariant>& theFieldStepData,
+ const TCollection_AsciiString& theFieldStepName,
+ const double theFieldStepRangeMin,
+ const double theFieldStepRangeMax );
+ Standard_EXPORT void getFieldStepInfo( GEOM::field_data_type& theFieldDataType,
+ int& theFieldDimension,
+ QList<QVariant>& theFieldStepData,
+ TCollection_AsciiString& theFieldStepName,
+ double& theFieldStepRangeMin,
+ double& theFieldStepRangeMax ) const;
protected:
- void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
- const Handle(Prs3d_Presentation)& aPrs,
- const Standard_Integer aMode);
-
- void restoreBoundaryColors();
-
+ Standard_EXPORT void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPrs,
+ const Standard_Integer aMode);
+
// Displaying the field data
- void drawField( const Handle(Prs3d_Presentation)& thePrs,
- const bool theIsText = false,
- const bool theIsHighlight = false );
-
+ Standard_EXPORT void drawField( const Handle(Prs3d_Presentation)& thePrs,
+ const bool theIsText = false,
+ const bool theIsHighlight = false );
+
// Auxiliary method to compute a center of mass for the specified shape
- static Standard_Boolean computeMassCenter( const TopoDS_Shape& theShape,
- gp_Pnt& theCenter );
-
- Quantity_Color myShadingColor;
-
- Quantity_Color myFreeBoundaryColor;
- Quantity_Color myUnFreeBoundaryColor;
-
- Quantity_Color myEdgesInShadingColor;
-
- int myUIsoNumber;
- int myVIsoNumber;
-
+ Standard_EXPORT static Standard_Boolean computeMassCenter( const TopoDS_Shape& theShape,
+ gp_Pnt& theCenter );
+
private:
+ Quantity_Color myShadingColor;
+ Quantity_Color myEdgesInShadingColor;
+
TCollection_AsciiString myName;
bool myDisplayVectors;
+ bool myDisplayVertices;
Standard_Boolean myTopLevel;
Standard_Integer myPrevDisplayMode;
double myFieldStepRangeMin;
double myFieldStepRangeMax;
- static TopLevelDispMode myTopLevelDm;
- static Quantity_Color myTopLevelColor;
-};
-
+ static TopLevelDispMode myTopLevelDm;
+ static Quantity_Color myTopLevelColor;
-// other inline functions and methods (like "C++: function call" methods)
-//
+public:
+ DEFINE_STANDARD_RTTI(GEOM_AISShape);
+};
+DEFINE_STANDARD_HANDLE(GEOM_AISShape, SALOME_AISShape)
#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.ixx
-// Module : GEOM
-//
-#include "GEOM_AISShape.jxx"
-
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-GEOM_AISShape::~GEOM_AISShape() {}
-
-
-
-Standard_EXPORT Handle_Standard_Type& GEOM_AISShape_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_AISShape);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_AISShape);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_Shape);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_Shape);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(AIS_InteractiveObject);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(AIS_InteractiveObject);
- static Handle_Standard_Type aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
- if ( aType4.IsNull()) aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
- static Handle_Standard_Type aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
- if ( aType5.IsNull()) aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
- static Handle_Standard_Type aType6 = STANDARD_TYPE(MMgt_TShared);
- if ( aType6.IsNull()) aType6 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType7 = STANDARD_TYPE(Standard_Transient);
- if ( aType7.IsNull()) aType7 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_AISShape",
- sizeof(GEOM_AISShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-
-// DownCast method
-// allow safe downcasting
-//
-const Handle(GEOM_AISShape) Handle(GEOM_AISShape)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_AISShape) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_AISShape))) {
- _anOtherObject = Handle(GEOM_AISShape)((Handle(GEOM_AISShape)&)AnObject);
- }
- }
-
- return _anOtherObject ;
-}
-const Handle(Standard_Type)& GEOM_AISShape::DynamicType() const
-{
- return STANDARD_TYPE(GEOM_AISShape) ;
-}
-Standard_Boolean GEOM_AISShape::IsKind(const Handle(Standard_Type)& AType) const
-{
- return (STANDARD_TYPE(GEOM_AISShape) == AType || SALOME_AISShape::IsKind(AType));
-}
-Handle_GEOM_AISShape::~Handle_GEOM_AISShape() {}
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.jxx
-// Module : GEOM
-//
-#ifndef _GEOM_InteractiveObject_HeaderFile
-#include "GEOM_InteractiveObject.hxx"
-#endif
-#ifndef _TopoDS_Shape_HeaderFile
-#include <TopoDS_Shape.hxx>
-#endif
-#ifndef _GEOM_AISShape_HeaderFile
-#include "GEOM_AISShape.hxx"
-#endif
-#ifndef _PrsMgr_PresentationManager3d_HeaderFile
-#include <PrsMgr_PresentationManager3d.hxx>
-#endif
-#ifndef _Prs3d_Presentation_HeaderFile
-#include <Prs3d_Presentation.hxx>
-#endif
// myDisplayMode(eWireframe),
myIsSelected(false),
myVectorMode(false),
+ myVerticesMode(false),
myVertexActor(GEOM_DeviceActor::New(),true),
myVertexSource(GEOM_VertexSource::New(),true),
+ myStandaloneVertexActor(GEOM_DeviceActor::New(),true),
+ myStandaloneVertexSource(GEOM_VertexSource::New(),true),
+
myIsolatedEdgeActor(GEOM_DeviceActor::New(),true),
myIsolatedEdgeSource(GEOM_EdgeSource::New(),true),
myHighlightProp->SetAmbientColor(1, 1, 1);
myHighlightProp->SetDiffuseColor(1, 1, 1);
myHighlightProp->SetSpecularColor(0.5, 0.5, 0.5);
- myHighlightProp->SetPointSize(SALOME_POINT_SIZE);
+ myHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
myHighlightActor->SetProperty(myHighlightProp.GetPointer());
this->myHighlightActor->SetInput(myAppendFilter->GetOutputPort(),false);
myPreHighlightProp->SetColor(0,1,1);
- myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
+ myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE);
myPreHighlightProp->SetLineWidth(SALOME_LINE_WIDTH+1);
myPreHighlightProp->SetRepresentationToWireframe();
aProperty->SetPointSize(3);
aProperty->SetColor(1, 1, 0);
+ myAppendFilter->AddInputConnection(myStandaloneVertexSource->GetOutputPort());
+ myStandaloneVertexActor->SetInput(myStandaloneVertexSource->GetOutputPort(),false);
+ aProperty = myStandaloneVertexActor->GetProperty();
+ aProperty->SetRepresentation(VTK_POINTS);
+ aProperty->SetPointSize(3);
+ aProperty->SetColor(1, 1, 0);
+
myAppendFilter->AddInputConnection(myIsolatedEdgeSource->GetOutputPort());
myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutputPort(),false);
aProperty = myIsolatedEdgeActor->GetProperty();
myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
- myNbIsos[0] = -1;
- myNbIsos[1] = -1;
-
// Toggle display mode
setDisplayMode(0); // WIRE FRAME
SetVectorMode(0); //
+ SetVerticesMode(0); //
}
SetModified()
{
this->myVertexSource->Modified();
+ this->myStandaloneVertexSource->Modified();
this->myIsolatedEdgeSource->Modified();
this->myOneFaceEdgeSource->Modified();
this->mySharedEdgeSource->Modified();
myIsolatedEdgeActor->AddToRender(theRenderer);
myVertexActor->AddToRender(theRenderer);
+ myStandaloneVertexActor->AddToRender(theRenderer);
}
void
myIsolatedEdgeActor->RemoveFromRender(theRenderer);
myVertexActor->RemoveFromRender(theRenderer);
+ myStandaloneVertexActor->RemoveFromRender(theRenderer);
SetSelected(false);
#ifdef MYDEBUG
MESSAGE ( "GEOM_Actor::setDisplayMode = "<<theMode );
#endif
-
- if ( theMode == (int)eShading || theMode == (int)eShadingWithEdges ) {
- // Temporary store number of iso lines in order to recover its later
- // when display mode is changed to 'Wirefame'
- // Iso lines are not displayed in 'Shading' and 'Shading with edges' modes.
- StoreIsoNumbers();
-
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
if ( theMode == (int)eShadingWithEdges ) {
// Coloring edges
myEdgesInShadingColor[2]);
}
else {
- // Restore number of iso-lines
- RestoreIsoNumbers();
-
// Coloring edges
myIsolatedEdgeActor->GetProperty()->SetColor(myIsolatedEdgeColor[0],
myIsolatedEdgeColor[1],
myOneFaceEdgeActor->SetVisibility(theVisibility && (myDisplayMode == (int)eWireframe || myDisplayMode == (int)eShadingWithEdges) && !myIsSelected);
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
- myVertexActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);// must be added new mode points
+ myVertexActor->SetVisibility(theVisibility && (isOnlyVertex || (myVerticesMode && (!myIsSelected && !myIsPreselected))));// must be added new mode points
+
+ myStandaloneVertexActor->SetVisibility(theVisibility);
}
return myVectorMode;
}
+void
+GEOM_Actor
+::SetVerticesMode(bool theMode)
+{
+ myVerticesMode = theMode;
+ if ( theMode || isOnlyVertex ) {
+ myAppendFilter->AddInputConnection(myVertexSource->GetOutputPort());
+ } else {
+ myAppendFilter->RemoveInputConnection(0, myVertexSource->GetOutputPort());
+ }
+ SetModified();
+}
+
+bool
+GEOM_Actor
+::GetVerticesMode()
+{
+ return myVerticesMode;
+}
+
void
GEOM_Actor::
SetDeflection(float theDeflection)
myShape = theShape;
myVertexSource->Clear();
+ myStandaloneVertexSource->Clear();
myIsolatedEdgeSource->Clear();
myOneFaceEdgeSource->Clear();
mySharedEdgeSource->Clear();
TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
GEOM::SetShape(theShape,anEdgeMap,theIsVector,
+ myStandaloneVertexSource.Get(),
myIsolatedEdgeSource.Get(),
myOneFaceEdgeSource.Get(),
mySharedEdgeSource.Get(),
if((bool)myShape.Infinite() || isOnlyVertex ){
myVertexActor->GetDeviceActor()->SetInfinitive(true);
+ myStandaloneVertexActor->GetDeviceActor()->SetInfinitive(true);
myHighlightActor->GetDeviceActor()->SetInfinitive(true);
}
return myVertexActor->GetProperty();
}
+vtkProperty* GEOM_Actor::GetStandaloneVertexProperty()
+{
+ return myStandaloneVertexActor->GetProperty();
+}
+
vtkProperty* GEOM_Actor::GetSharedEdgeProperty()
{
return mySharedEdgeActor->GetProperty();
myHighlightProp->SetOpacity(opa);
myPreHighlightProp->SetOpacity(opa);
myVertexActor->GetProperty()->SetOpacity(opa);
+ myStandaloneVertexActor->GetProperty()->SetOpacity(opa);
}
double GEOM_Actor::GetOpacity()
void GEOM_Actor::SetPointColor(double r, double g, double b)
{
myVertexActor->GetProperty()->SetColor(r, g, b);
+ myStandaloneVertexActor->GetProperty()->SetColor(r, g, b);
}
/*!
aCoefnt = theProps[0]->GetAmbient();
myShadingFaceProp->SetAmbient(aCoefnt);
myVertexActor->GetProperty()->SetAmbient(aCoefnt);
+ myStandaloneVertexActor->GetProperty()->SetAmbient(aCoefnt);
if ( aSize == 2 )
aCoefnt = theProps[1]->GetAmbient();
myShadingBackFaceProp->SetAmbient(aCoefnt);
aCoefnt = theProps[0]->GetDiffuse();
myShadingFaceProp->SetDiffuse(aCoefnt);
myVertexActor->GetProperty()->SetDiffuse(aCoefnt);
+ myStandaloneVertexActor->GetProperty()->SetDiffuse(aCoefnt);
if ( aSize == 2 )
aCoefnt = theProps[1]->GetDiffuse();
myShadingBackFaceProp->SetDiffuse(aCoefnt);
aCoefnt = theProps[0]->GetSpecular();
myShadingFaceProp->SetSpecular(aCoefnt);
myVertexActor->GetProperty()->SetSpecular(aCoefnt);
+ myStandaloneVertexActor->GetProperty()->SetSpecular(aCoefnt);
if ( aSize == 2 )
aCoefnt = theProps[1]->GetSpecular();
myShadingBackFaceProp->SetSpecular(aCoefnt);
aColor = theProps[0]->GetAmbientColor();
myShadingFaceProp->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
myVertexActor->GetProperty()->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
+ myStandaloneVertexActor->GetProperty()->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
if ( aSize == 2 )
aColor = theProps[1]->GetAmbientColor();
myShadingBackFaceProp->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
aColor = theProps[0]->GetDiffuseColor();
myShadingFaceProp->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
myVertexActor->GetProperty()->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
+ myStandaloneVertexActor->GetProperty()->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
if ( aSize == 2 )
aColor = theProps[1]->GetDiffuseColor();
myShadingBackFaceProp->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
aColor = theProps[0]->GetSpecularColor();
myShadingFaceProp->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
myVertexActor->GetProperty()->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
+ myStandaloneVertexActor->GetProperty()->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
if ( aSize == 2 )
aColor = theProps[1]->GetSpecularColor();
myShadingBackFaceProp->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
aCoefnt = theProps[0]->GetSpecularPower();
myShadingFaceProp->SetSpecularPower(aCoefnt);
myVertexActor->GetProperty()->SetSpecularPower(aCoefnt);
+ myStandaloneVertexActor->GetProperty()->SetSpecularPower(aCoefnt);
if ( aSize == 2 )
aCoefnt = theProps[1]->GetSpecularPower();
myShadingBackFaceProp->SetSpecularPower(aCoefnt);
MESSAGE ( this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected );
#endif
- if ( myDisplayMode == (int)eShading || myDisplayMode == (int)eShadingWithEdges ) {
- if ( theIsHighlight )
- RestoreIsoNumbers();
- else
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
-
SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
SetVisibility(GetVisibility());
}
if ( !GetPickable() )
return false;
- if ( myDisplayMode == (int)eShading || myDisplayMode == (int)eShadingWithEdges ) {
- if ( theIsHighlight )
- RestoreIsoNumbers();
- else
- // Reset number of iso lines to 0
- ResetIsoNumbers();
- }
-
myPreHighlightActor->SetVisibility( false );
bool anIsPreselected = myIsPreselected;
myEdgesInShadingColor[2] = b;
}
-void GEOM_Actor::StoreIsoNumbers()
-{
- myWireframeFaceSource->GetNbIso(myNbIsos[0], myNbIsos[1]);
-}
-
void GEOM_Actor::SetIsosWidth(const int width) {
myWireframeFaceActor->GetProperty()->SetLineWidth(width);
}
int GEOM_Actor::GetWidth() const {
return (int)myIsolatedEdgeActor->GetProperty()->GetLineWidth();
}
-
-void GEOM_Actor::RestoreIsoNumbers()
-{
- if ( myNbIsos[0] > 0 || myNbIsos[1] > 0 )
- // Restore number of U and (or) V iso lines
- myWireframeFaceSource->SetNbIso(myNbIsos);
-}
-
-void GEOM_Actor::ResetIsoNumbers()
-{
- int aNb[2] = {0, 0};
- myWireframeFaceSource->SetNbIso(aNb);
-}
vtkProperty* GetShadingProperty();
vtkProperty* GetIsolatedEdgeProperty();
vtkProperty* GetVertexProperty();
+ vtkProperty* GetStandaloneVertexProperty();
vtkProperty* GetSharedEdgeProperty();
vtkProperty* GetFaceEdgeProperty();
virtual
bool
GetVectorMode();
-
- void
- StoreIsoNumbers();
+ //! Vertices mode management
+ virtual
void
- RestoreIsoNumbers();
-
- void
- ResetIsoNumbers();
+ SetVerticesMode(const bool theMode);
+
+ virtual
+ bool
+ GetVerticesMode();
protected:
void SetModified();
private:
TopoDS_Shape myShape;
- int myNbIsos[2];
bool isOnlyVertex;
float myDeflection;
// EDisplayMode myDisplayMode;
bool myIsSelected;
bool myVectorMode;
+ bool myVerticesMode;
PDeviceActor myVertexActor;
PVertexSource myVertexSource;
+ PDeviceActor myStandaloneVertexActor;
+ PVertexSource myStandaloneVertexSource;
+
PDeviceActor myIsolatedEdgeActor;
PEdgeSource myIsolatedEdgeSource;
"Color", // COLOR_PROP
// "show edges direction" flag
"VectorMode", // VECTOR_MODE_PROP
+ // "show vertices" flag
+ "VerticesMode", // VERTICES_MODE_PROP
// deflection coefficient
"DeflectionCoeff", // DEFLECTION_COEFF_PROP
// point marker data
NbIsos,
Color,
EdgesDirection,
+ Vertices,
Deflection,
PointMarker,
Material,
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_InteractiveObject.cxx
-// Author : Christophe ATTANASIO
-// Module : GEOM
-//
/*!
\class GEOM_InteractiveObject GEOM_InteractiveObject.hxx
\brief ....
*/
-#include "GEOM_InteractiveObject.ixx"
+#include "GEOM_InteractiveObject.hxx"
+
+IMPLEMENT_STANDARD_HANDLE (GEOM_InteractiveObject, SALOME_InteractiveObject)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_InteractiveObject, SALOME_InteractiveObject)
GEOM_InteractiveObject::GEOM_InteractiveObject()
: SALOME_InteractiveObject()
myFatherIOR = aFatherIOR;
}
-const char* GEOM_InteractiveObject::getIOR(){
+GEOM_InteractiveObject::~GEOM_InteractiveObject()
+{
+}
+
+const char* GEOM_InteractiveObject::getIOR()
+{
return myIOR.c_str();
}
-const char* GEOM_InteractiveObject::getFatherIOR(){
+const char* GEOM_InteractiveObject::getFatherIOR()
+{
return myFatherIOR.c_str();
}
-Standard_Boolean GEOM_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
+Standard_Boolean GEOM_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO )
+{
if ( anIO->hasEntry() && this->hasEntry() ) {
if ( myEntry == anIO->getEntry() )
return Standard_True;
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_InteractiveObject.hxx
-// Module : GEOM
-//
#ifndef _GEOM_InteractiveObject_HeaderFile
#define _GEOM_InteractiveObject_HeaderFile
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Handle_GEOM_InteractiveObject_HeaderFile
-#include "Handle_GEOM_InteractiveObject.hxx"
-#endif
-
-#ifndef _Standard_CString_HeaderFile
-#include <Standard_CString.hxx>
-#endif
-#ifndef _SALOME_InteractiveObject_HeaderFile
-#include "SALOME_InteractiveObject.hxx"
-#endif
-#ifndef _Standard_Boolean_HeaderFile
-#include <Standard_Boolean.hxx>
-#endif
-#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include "Handle_SALOME_InteractiveObject.hxx"
-#endif
+#include <SALOME_InteractiveObject.hxx>
-class GEOM_InteractiveObject : public SALOME_InteractiveObject {
+#include <Standard.hxx>
+#include <Standard_DefineHandle.hxx>
+class GEOM_InteractiveObject : public SALOME_InteractiveObject
+{
public:
+ Standard_EXPORT GEOM_InteractiveObject();
+ Standard_EXPORT GEOM_InteractiveObject(const char* anIOR,
+ const char* aFatherIOR,
+ const char* aComponentDataType,
+ const char* anEntry = "");
+ Standard_EXPORT ~GEOM_InteractiveObject();
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- // Methods PUBLIC
- //
-Standard_EXPORT GEOM_InteractiveObject();
-Standard_EXPORT GEOM_InteractiveObject(const char* anIOR,
- const char* aFatherIOR,
- const char* aComponentDataType,
- const char* anEntry = "");
-Standard_EXPORT void setIOR(const char* anEntry) ;
-Standard_EXPORT const char* getIOR() ;
-Standard_EXPORT void setFatherIOR(const char* anEntry) ;
-Standard_EXPORT const char* getFatherIOR() ;
-Standard_EXPORT virtual Standard_Boolean isSame(const Handle(SALOME_InteractiveObject)& anIO) ;
-Standard_EXPORT ~GEOM_InteractiveObject();
-
-
-
-
- // Type management
- //
- Standard_EXPORT friend Handle_Standard_Type& GEOM_InteractiveObject_Type_();
- Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT void setIOR(const char* anEntry);
+ Standard_EXPORT const char* getIOR();
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
+ Standard_EXPORT void setFatherIOR(const char* anEntry);
+ Standard_EXPORT const char* getFatherIOR();
+ Standard_EXPORT virtual Standard_Boolean isSame(const Handle(SALOME_InteractiveObject)& anIO);
private:
+ std::string myIOR;
+ std::string myFatherIOR;
- // Methods PRIVATE
- //
-
-
- // Fields PRIVATE
- //
-std::string myIOR;
-std::string myFatherIOR;
-
-
+public:
+ DEFINE_STANDARD_RTTI(GEOM_InteractiveObject);
};
-
-
-
-
-// other inline functions and methods (like "C++: function call" methods)
-//
-
+DEFINE_STANDARD_HANDLE(GEOM_InteractiveObject, SALOME_InteractiveObject)
#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_InteractiveObject.ixx
-// Module : GEOM
-//
-#include "GEOM_InteractiveObject.jxx"
-
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-GEOM_InteractiveObject::~GEOM_InteractiveObject() {}
-
-
-
-Standard_EXPORT Handle_Standard_Type& GEOM_InteractiveObject_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_InteractiveObject);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_InteractiveObject);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_InteractiveObject",
- sizeof(GEOM_InteractiveObject),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-
-// DownCast method
-// allow safe downcasting
-//
-const Handle(GEOM_InteractiveObject) Handle(GEOM_InteractiveObject)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_InteractiveObject) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
- _anOtherObject = Handle(GEOM_InteractiveObject)((Handle(GEOM_InteractiveObject)&)AnObject);
- }
- }
-
- return _anOtherObject ;
-}
-const Handle(Standard_Type)& GEOM_InteractiveObject::DynamicType() const
-{
- return STANDARD_TYPE(GEOM_InteractiveObject) ;
-}
-Standard_Boolean GEOM_InteractiveObject::IsKind(const Handle(Standard_Type)& AType) const
-{
- return (STANDARD_TYPE(GEOM_InteractiveObject) == AType || SALOME_InteractiveObject::IsKind(AType));
-}
-Handle_GEOM_InteractiveObject::~Handle_GEOM_InteractiveObject() {}
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_InteractiveObject.jxx
-// Module : GEOM
-//
-#ifndef _SALOME_InteractiveObject_HeaderFile
-#include "SALOME_InteractiveObject.hxx"
-#endif
-#ifndef _GEOM_InteractiveObject_HeaderFile
-#include "GEOM_InteractiveObject.hxx"
-#endif
vtkPoints *Pts,
vtkCellArray *Cell)
{
- GEOMUtils_Hatcher aHatcher(TopologicalFace);
+ GEOMUtils::Hatcher aHatcher(TopologicalFace);
aHatcher.Init(NbIsos);
aHatcher.Perform();
// Function : createIsos
// Purpose : Create isolines obtained from hatcher.
//=======================================================================
-void GEOM_OCCReader::createIsos(const GEOMUtils_Hatcher &theHatcher,
+void GEOM_OCCReader::createIsos(const GEOMUtils::Hatcher &theHatcher,
const Standard_Boolean IsUIso,
Standard_Integer &pt_start_idx,
vtkPoints *Pts,
class vtkPoints;
class vtkCellArray;
-class GEOMUtils_Hatcher;
+namespace GEOMUtils
+{
+ class Hatcher;
+}
// OpenCASCADE
#include <TopoDS_Edge.hxx>
vtkPoints* Pts,
vtkCellArray* Cells);
- void createIsos(const GEOMUtils_Hatcher &theHatcher,
+ void createIsos(const GEOMUtils::Hatcher &theHatcher,
const Standard_Boolean IsUIso,
- Standard_Integer &pt_start_idx,
- vtkPoints *Pts,
- vtkCellArray *Cell);
-
+ Standard_Integer &pt_start_idx,
+ vtkPoints *Pts,
+ vtkCellArray *Cell);
+
void DrawIso(GeomAbs_IsoType aType,
Standard_Real PParm,
Standard_Real p1,
*/
//Local includes
-#include "GEOM_TopWireframeShape.ixx"
+#include "GEOM_TopWireframeShape.hxx"
#include "GEOM_AISShape.hxx"
//GUI includes
#include <TopoDS_Shape.hxx>
#include <Prs3d_IsoAspect.hxx>
-GEOM_TopWireframeShape::GEOM_TopWireframeShape(const TopoDS_Shape& shape)
- : SALOME_AISShape(shape)
+IMPLEMENT_STANDARD_HANDLE(GEOM_TopWireframeShape, SALOME_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_TopWireframeShape, SALOME_AISShape)
+
+GEOM_TopWireframeShape::GEOM_TopWireframeShape( const TopoDS_Shape& shape )
+ :SALOME_AISShape(shape)
{
- SetDisplayMode(AIS_WireFrame);
- Handle(Prs3d_IsoAspect) anAspect = Attributes()->UIsoAspect();
- anAspect->SetNumber( 0 );
- Attributes()->SetUIsoAspect( anAspect );
- anAspect = Attributes()->VIsoAspect();
- anAspect->SetNumber( 0 );
- Attributes()->SetVIsoAspect( anAspect );
- SetColor(GEOM_AISShape::topLevelColor());
+ SetDisplayMode( AIS_WireFrame );
+ Handle(Prs3d_IsoAspect) anAspect = Attributes()->UIsoAspect();
+ anAspect->SetNumber( 0 );
+ Attributes()->SetUIsoAspect( anAspect );
+ anAspect = Attributes()->VIsoAspect();
+ anAspect->SetNumber( 0 );
+ Attributes()->SetVIsoAspect( anAspect );
+ SetColor( GEOM_AISShape::topLevelColor() );
}
GEOM_TopWireframeShape::~GEOM_TopWireframeShape()
{
}
-Handle(SALOME_InteractiveObject) GEOM_TopWireframeShape::getIO(){
+Handle(SALOME_InteractiveObject) GEOM_TopWireframeShape::getIO()
+{
Handle(SALOME_InteractiveObject) IO;
if ( !GetOwner().IsNull() )
IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() );
return IO;
}
-Standard_Boolean GEOM_TopWireframeShape::hasIO(){
+Standard_Boolean GEOM_TopWireframeShape::hasIO()
+{
return !getIO().IsNull();
}
-void GEOM_TopWireframeShape::setName(const Standard_CString /*aName*/)
+void GEOM_TopWireframeShape::setName( const Standard_CString /*aName*/ )
{
}
-Standard_CString GEOM_TopWireframeShape::getName(){
+Standard_CString GEOM_TopWireframeShape::getName()
+{
return "";
}
-void GEOM_TopWireframeShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& /*aIndexMap*/,
- const Standard_Boolean /*aHighlight*/ )
+void GEOM_TopWireframeShape::highlightSubShapes( const TColStd_IndexedMapOfInteger& /*aIndexMap*/,
+ const Standard_Boolean /*aHighlight*/ )
{
}
-Standard_Boolean GEOM_TopWireframeShape::isTopLevel() {
+Standard_Boolean GEOM_TopWireframeShape::isTopLevel()
+{
return Standard_True;
}
-void GEOM_TopWireframeShape::setTopLevel(Standard_Boolean /*f*/) {
-
+void GEOM_TopWireframeShape::setTopLevel( Standard_Boolean /*f*/ )
+{
}
-Standard_Boolean GEOM_TopWireframeShape::toActivate() {
- return Standard_False;
+Standard_Boolean GEOM_TopWireframeShape::toActivate()
+{
+ return Standard_True;
}
-Standard_Boolean GEOM_TopWireframeShape::switchTopLevel() {
- return Standard_True;
+Standard_Boolean GEOM_TopWireframeShape::switchTopLevel()
+{
+ return Standard_True;
}
-void GEOM_TopWireframeShape::setIO(const Handle(SALOME_InteractiveObject)& io){
+void GEOM_TopWireframeShape::setIO( const Handle(SALOME_InteractiveObject)& io )
+{
SetOwner( io );
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_TopWireframeShape.hxx
-// Module : GEOM
-//
#ifndef _GEOM_TopWireframeShape_HeaderFile
#define _GEOM_TopWireframeShape_HeaderFile
-#include "GEOM_OBJECT_defs.hxx"
+#include <SALOME_AISShape.hxx>
-#ifndef _Standard_HeaderFile
#include <Standard.hxx>
-#endif
-#ifndef _Handle_GEOM_TopWireframeShape_HeaderFile
-#include "Handle_GEOM_TopWireframeShape.hxx"
-#endif
-
-#ifndef _SALOME_AISShape_HeaderFile
-#include "SALOME_AISShape.hxx"
-#endif
-#ifndef _Standard_Boolean_HeaderFile
-#include <Standard_Boolean.hxx>
-#endif
-
-class GEOM_OBJECT_EXPORT GEOM_TopWireframeShape : public SALOME_AISShape {
+#include <Standard_DefineHandle.hxx>
+class GEOM_TopWireframeShape : public SALOME_AISShape
+{
public:
+ Standard_EXPORT GEOM_TopWireframeShape(const TopoDS_Shape& shape);
+ Standard_EXPORT ~GEOM_TopWireframeShape();
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
- // inline void operator delete(void *anAddress, size_t size)
- // {
- // if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
- // }
+ Standard_EXPORT virtual Standard_Boolean hasIO();
+ Standard_EXPORT void setIO(const Handle(SALOME_InteractiveObject)& io);
+ Standard_EXPORT virtual Handle(SALOME_InteractiveObject) getIO();
- // Methods PUBLIC
- //
- GEOM_TopWireframeShape(const TopoDS_Shape& shape);
- virtual Handle_SALOME_InteractiveObject getIO();
- virtual Standard_Boolean hasIO();
- virtual Standard_Boolean isTopLevel();
- virtual Standard_Boolean switchTopLevel();
- virtual Standard_Boolean toActivate();
- virtual void setTopLevel(Standard_Boolean);
- virtual Standard_CString getName();
- virtual void setName(const Standard_CString aName);
- virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
- ~GEOM_TopWireframeShape();
+ Standard_EXPORT virtual void setName(const Standard_CString aName);
+ Standard_EXPORT virtual Standard_CString getName();
- // Type management
- //
- friend Handle_Standard_Type& GEOM_TopWireframeShape_Type_();
- const Handle(Standard_Type)& DynamicType() const;
- Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT virtual Standard_Boolean isTopLevel();
+ Standard_EXPORT virtual void setTopLevel(Standard_Boolean);
+ Standard_EXPORT virtual Standard_Boolean switchTopLevel();
+ Standard_EXPORT virtual Standard_Boolean toActivate();
- void setIO(const Handle(SALOME_InteractiveObject)& io);
+ Standard_EXPORT virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight );
-protected:
-
- // Methods PROTECTED
- //
-
- // Fields PROTECTED
- //
-
-private:
-
- // Methods PRIVATE
- //
-
- // Fields PRIVATE
- //
+public:
+ DEFINE_STANDARD_RTTI(GEOM_TopWireframeShape);
};
-// other inline functions and methods (like "C++: function call" methods)
-//
+DEFINE_STANDARD_HANDLE(GEOM_TopWireframeShape, SALOME_AISShape)
#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.ixx
-// Module : GEOM
-//
-#include "GEOM_TopWireframeShape.jxx"
-
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-Standard_EXPORT Handle_Standard_Type& GEOM_TopWireframeShape_Type_()
-{
-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_AISShape);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_AISShape);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_Shape);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_Shape);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(AIS_InteractiveObject);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(AIS_InteractiveObject);
- static Handle_Standard_Type aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
- if ( aType4.IsNull()) aType4 = STANDARD_TYPE(SelectMgr_SelectableObject);
- static Handle_Standard_Type aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
- if ( aType5.IsNull()) aType5 = STANDARD_TYPE(PrsMgr_PresentableObject);
- static Handle_Standard_Type aType6 = STANDARD_TYPE(MMgt_TShared);
- if ( aType6.IsNull()) aType6 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType7 = STANDARD_TYPE(Standard_Transient);
- if ( aType7.IsNull()) aType7 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_TopWireframeShape",
- sizeof(GEOM_TopWireframeShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-
-// DownCast method
-// allow safe downcasting
-//
-const Handle(GEOM_TopWireframeShape) Handle(GEOM_TopWireframeShape)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOM_TopWireframeShape) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_TopWireframeShape))) {
- _anOtherObject = Handle(GEOM_TopWireframeShape)((Handle(GEOM_TopWireframeShape)&)AnObject);
- }
- }
-
- return _anOtherObject ;
-}
-const Handle(Standard_Type)& GEOM_TopWireframeShape::DynamicType() const
-{
- return STANDARD_TYPE(GEOM_TopWireframeShape) ;
-}
-Standard_Boolean GEOM_TopWireframeShape::IsKind(const Handle(Standard_Type)& AType) const
-{
- return (STANDARD_TYPE(GEOM_TopWireframeShape) == AType || SALOME_AISShape::IsKind(AType));
-}
-Handle_GEOM_TopWireframeShape::~Handle_GEOM_TopWireframeShape() {}
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : GEOM_AISShape.jxx
-// Module : GEOM
-//
-#ifndef _TopoDS_Shape_HeaderFile
-#include <TopoDS_Shape.hxx>
-#endif
-
-#ifndef _GEOM_TopWireframeShape_HeaderFile
-#include "GEOM_TopWireframeShape.hxx"
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : Handle_GEOM_AISShape.hxx
-// Module : GEOM
-//
-#ifndef _Handle_GEOM_AISShape_HeaderFile
-#define _Handle_GEOM_AISShape_HeaderFile
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Handle_SALOME_AISShape_HeaderFile
-#include "Handle_SALOME_AISShape.hxx"
-#endif
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(SALOME_AISShape);
-class GEOM_AISShape;
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_AISShape);
-
-class Handle(GEOM_AISShape) : public Handle(SALOME_AISShape) {
- public:
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- Handle(GEOM_AISShape)():Handle(SALOME_AISShape)() {}
- Handle(GEOM_AISShape)(const Handle(GEOM_AISShape)& aHandle) : Handle(SALOME_AISShape)(aHandle)
- {
- }
-
- Handle(GEOM_AISShape)(const GEOM_AISShape* anItem) : Handle(SALOME_AISShape)((SALOME_AISShape *)anItem)
- {
- }
-
- Handle(GEOM_AISShape)& operator=(const Handle(GEOM_AISShape)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOM_AISShape)& operator=(const GEOM_AISShape* anItem)
- {
- Assign((Standard_Transient *)anItem);
- return *this;
- }
-
- GEOM_AISShape* operator->()
- {
- return (GEOM_AISShape *)ControlAccess();
- }
-
- GEOM_AISShape* operator->() const
- {
- return (GEOM_AISShape *)ControlAccess();
- }
-
- Standard_EXPORT ~Handle(GEOM_AISShape)();
-
- Standard_EXPORT static const Handle(GEOM_AISShape) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : Handle_GEOM_InteractiveObject.hxx
-// Module : GEOM
-//
-#ifndef _Handle_GEOM_InteractiveObject_HeaderFile
-#define _Handle_GEOM_InteractiveObject_HeaderFile
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include "Handle_SALOME_InteractiveObject.hxx"
-#endif
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(SALOME_InteractiveObject);
-class GEOM_InteractiveObject;
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_InteractiveObject);
-
-class Handle(GEOM_InteractiveObject) : public Handle(SALOME_InteractiveObject) {
- public:
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- Handle(GEOM_InteractiveObject)():Handle(SALOME_InteractiveObject)() {}
- Handle(GEOM_InteractiveObject)(const Handle(GEOM_InteractiveObject)& aHandle) : Handle(SALOME_InteractiveObject)(aHandle)
- {
- }
-
- Handle(GEOM_InteractiveObject)(const GEOM_InteractiveObject* anItem) : Handle(SALOME_InteractiveObject)((SALOME_InteractiveObject *)anItem)
- {
- }
-
- Handle(GEOM_InteractiveObject)& operator=(const Handle(GEOM_InteractiveObject)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOM_InteractiveObject)& operator=(const GEOM_InteractiveObject* anItem)
- {
- Assign((Standard_Transient *)anItem);
- return *this;
- }
-
- GEOM_InteractiveObject* operator->()
- {
- return (GEOM_InteractiveObject *)ControlAccess();
- }
-
- GEOM_InteractiveObject* operator->() const
- {
- return (GEOM_InteractiveObject *)ControlAccess();
- }
-
- Standard_EXPORT ~Handle(GEOM_InteractiveObject)();
-
- Standard_EXPORT static const Handle(GEOM_InteractiveObject) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-#endif
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// GEOM OBJECT : interactive object for Geometry entities visualization
-// File : Handle_GEOM_TopWireframeShape.hxx
-// Module : GEOM
-//
-#ifndef _Handle_GEOM_TopWireframeShape_HeaderFile
-#define _Handle_GEOM_TopWireframeShape_HeaderFile
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Handle_SALOME_AISShape_HeaderFile
-#include "Handle_SALOME_AISShape.hxx"
-#endif
-
-class Standard_Transient;
-class Handle_Standard_Type;
-class Handle(SALOME_AISShape);
-class GEOM_TopWireframeShape;
-Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_TopWireframeShape);
-
-class Handle(GEOM_TopWireframeShape) : public Handle(SALOME_AISShape) {
- public:
- inline void* operator new(size_t,void* anAddress)
- {
- return anAddress;
- }
- inline void* operator new(size_t size)
- {
- return Standard::Allocate(size);
- }
- inline void operator delete(void *anAddress)
- {
- if (anAddress) Standard::Free((Standard_Address&)anAddress);
- }
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
- Handle(GEOM_TopWireframeShape)():Handle(SALOME_AISShape)() {}
- Handle(GEOM_TopWireframeShape)(const Handle(GEOM_TopWireframeShape)& aHandle) : Handle(SALOME_AISShape)(aHandle)
- {
- }
-
- Handle(GEOM_TopWireframeShape)(const GEOM_TopWireframeShape* anItem) : Handle(SALOME_AISShape)((SALOME_AISShape *)anItem)
- {
- }
-
- Handle(GEOM_TopWireframeShape)& operator=(const Handle(GEOM_TopWireframeShape)& aHandle)
- {
- Assign(aHandle.Access());
- return *this;
- }
-
- Handle(GEOM_TopWireframeShape)& operator=(const GEOM_TopWireframeShape* anItem)
- {
- Assign((Standard_Transient *)anItem);
- return *this;
- }
-
- GEOM_TopWireframeShape* operator->()
- {
- return (GEOM_TopWireframeShape *)ControlAccess();
- }
-
- GEOM_TopWireframeShape* operator->() const
- {
- return (GEOM_TopWireframeShape *)ControlAccess();
- }
-
- Standard_EXPORT ~Handle(GEOM_TopWireframeShape)();
-
- Standard_EXPORT static const Handle(GEOM_TopWireframeShape) DownCast(const Handle(Standard_Transient)& AnObject);
-};
-#endif
//
#include "GEOM_EdgeSource.h"
-#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
GEOM_EdgeSource::GEOM_EdgeSource() :
myIsVector(false)
{
- myData = new EdgeSourceInternal;
this->SetNumberOfInputPorts(0);
}
GEOM_EdgeSource::~GEOM_EdgeSource()
-{
- delete myData;
+{
}
void GEOM_EdgeSource::AddEdge (const TopoDS_Edge& theEdge,
bool theIsVector)
{
- myData->myEdgeSet.Add(theEdge);
+ myEdgeSet.Add(theEdge);
myIsVector = theIsVector;
}
-void GEOM_EdgeSource::Clear()
-{
- myData->myEdgeSet.Clear();
-}
-
-bool GEOM_EdgeSource::IsEmpty()
-{
- return myData->myEdgeSet.IsEmpty();
-}
-
int GEOM_EdgeSource::RequestData(vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *outputVector)
aPolyData->SetPoints(aPts);
aPts->Delete();
- TEdgeSet::Iterator anIter (myData->myEdgeSet);
+ TEdgeSet::Iterator anIter (myEdgeSet);
for (; anIter.More(); anIter.Next()) {
TopoDS_Edge anEdge = anIter.Value();
if ( !myIsVector )
#include "OCC2VTK.h"
#include <TopoDS_Edge.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx>
+
+typedef NCollection_Map<TopoDS_Edge, TopTools_ShapeMapHasher> TEdgeSet;
#include <vtkPoints.h>
#include <vtkPolyDataAlgorithm.h>
class vtkPolyData;
-class EdgeSourceInternal;
class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataAlgorithm
{
public:
- vtkTypeMacro(GEOM_EdgeSource, vtkPolyDataAlgorithm);
-
+ vtkTypeMacro(GEOM_EdgeSource,vtkPolyDataAlgorithm);
static GEOM_EdgeSource* New();
void AddEdge (const TopoDS_Edge& theEdge,
bool theIsVector = false);
- void Clear();
+ void Clear(){ myEdgeSet.Clear();}
- bool IsEmpty();
-
void SetVectorMode(bool);
bool GetVectorMode();
vtkPolyData* thePolyData,
vtkPoints* thePts,
bool theIsVector = false);
+
+ bool IsEmpty(){return myEdgeSet.IsEmpty();}
+
protected:
- EdgeSourceInternal* myData;
+ TEdgeSet myEdgeSet;
// The <myIsVector> flag is common for all edges, because the shape,
// representing a vector, can have only one edge.
bool myIsVector, myIsVectorMode;
- virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
GEOM_EdgeSource();
~GEOM_EdgeSource();
void operator=(const GEOM_EdgeSource&);
};
+
#endif //GEOM_EDGESOURCE_H
//
#include "GEOM_FaceSource.h"
-#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
GEOM_FaceSource::GEOM_FaceSource()
{
- myData = new FaceSourceInternal;
this->SetNumberOfInputPorts(0);
-}
+}
GEOM_FaceSource::~GEOM_FaceSource()
{
- delete myData;
-}
+}
void
GEOM_FaceSource::
AddFace(const TopoDS_Face& theFace)
{
- myData->myFaceSet.Add(theFace);
-}
-
-void
-GEOM_FaceSource::
-Clear()
-{
- myData->myFaceSet.Clear();
+ myFaceSet.Add(theFace);
}
-
-bool
-GEOM_FaceSource::
-IsEmpty()
-{
- return myData->myFaceSet.IsEmpty();
-}
void
GEOM_FaceSource::
#include <gp_Pnt.hxx>
#include <TopoDS_Face.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx>
+
+typedef NCollection_Map<TopoDS_Face, TopTools_ShapeMapHasher> TFaceSet;
#include <vtkPoints.h>
#include <vtkPolyDataAlgorithm.h>
class vtkPolyData;
-class FaceSourceInternal;
class OCC2VTK_EXPORT GEOM_FaceSource: public vtkPolyDataAlgorithm
{
vtkTypeMacro(GEOM_FaceSource,vtkPolyDataAlgorithm);
void AddFace(const TopoDS_Face& theFace);
- void Clear();
- bool IsEmpty();
+ void Clear(){ myFaceSet.Clear();}
+ bool IsEmpty(){return myFaceSet.IsEmpty();}
protected:
- FaceSourceInternal* myData;
+ TFaceSet myFaceSet;
static
void MoveTo(gp_Pnt thePnt,
//
#include "GEOM_ShadingFace.h"
-#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
aPolyData->SetPoints(aPts);
aPts->Delete();
- TFaceSet::Iterator anIter(myData->myFaceSet);
+ TFaceSet::Iterator anIter(myFaceSet);
for(; anIter.More(); anIter.Next()){
const TopoDS_Face& aFace = anIter.Value();
OCC2VTK(aFace,aPolyData,aPts);
//
#include "GEOM_VertexSource.h"
-#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
vtkStandardNewMacro(GEOM_VertexSource);
GEOM_VertexSource::GEOM_VertexSource()
-{
- myData = new VertexSourceInternal;
+{
this->SetNumberOfInputPorts(0);
-}
+}
GEOM_VertexSource::~GEOM_VertexSource()
-{
- delete myData;
-}
+{
+}
void
GEOM_VertexSource::
AddVertex(const TopoDS_Vertex& theVertex)
-{
- myData->myVertexSet.Add(theVertex);
-}
-
-void
-GEOM_VertexSource::
-Clear()
-{
- myData->myVertexSet.Clear();
-}
+{
+ myVertexSet.Add(theVertex);
+}
int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
aPolyData->SetPoints(aPts);
aPts->Delete();
- TVertexSet::Iterator anIter(myData->myVertexSet);
+ TVertexSet::Iterator anIter(myVertexSet);
for(; anIter.More(); anIter.Next()){
const TopoDS_Vertex& aVertex = anIter.Value();
OCC2VTK(aVertex,aPolyData,aPts);
#include "OCC2VTK.h"
#include <TopoDS_Vertex.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx>
+
+typedef NCollection_Map<TopoDS_Vertex, TopTools_ShapeMapHasher> TVertexSet;
#include <vtkPoints.h>
#include <vtkPolyDataAlgorithm.h>
class vtkPolyData;
-class VertexSourceInternal;
class OCC2VTK_EXPORT GEOM_VertexSource: public vtkPolyDataAlgorithm
{
static GEOM_VertexSource* New();
void AddVertex(const TopoDS_Vertex& theVertex);
- void Clear();
+ void Clear(){ myVertexSet.Clear();}
static
void OCC2VTK(const TopoDS_Vertex& theVertex,
vtkPoints* thePts);
protected:
- VertexSourceInternal* myData;
+ TVertexSet myVertexSet;
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
//
#include "GEOM_WireframeFace.h"
-#include "OCC2VTK_internal.h"
#include <GEOMUtils_Hatcher.hxx>
aPolyData->SetPoints(aPts);
aPts->Delete();
- TFaceSet::Iterator anIter(myData->myFaceSet);
+ TFaceSet::Iterator anIter(myFaceSet);
for(; anIter.More(); anIter.Next()){
const TopoDS_Face& aFace = anIter.Value();
OCC2VTK(aFace,aPolyData,aPts,NbIso,Discret);
vtkPolyData* thePolyData,
vtkPoints* thePts)
{
- GEOMUtils_Hatcher aHatcher(theFace);
+ GEOMUtils::Hatcher aHatcher(theFace);
aHatcher.Init(theNbIso[0], theNbIso[1]);
aHatcher.Perform();
void
GEOM_WireframeFace::
-CreateIso(const GEOMUtils_Hatcher &theHatcher,
+CreateIso(const GEOMUtils::Hatcher &theHatcher,
const Standard_Boolean IsUIso,
const int theDiscret,
- vtkPolyData *thePolyData,
- vtkPoints *thePts)
+ vtkPolyData *thePolyData,
+ vtkPoints *thePts)
{
Handle(TColStd_HArray1OfInteger) anIndices;
Handle(TColStd_HArray1OfReal) aParams;
#include <BRepAdaptor_Surface.hxx>
class vtkPolyData;
-class GEOMUtils_Hatcher;
+
+namespace GEOMUtils
+{
+ class Hatcher;
+}
class OCC2VTK_EXPORT GEOM_WireframeFace: public GEOM_FaceSource
{
static
void
- CreateIso(const GEOMUtils_Hatcher &theHatcher,
- const Standard_Boolean IsUIso,
- const int theDiscret,
- vtkPolyData *thePolyData,
- vtkPoints *thePts);
+ CreateIso(const GEOMUtils::Hatcher &theHatcher,
+ const Standard_Boolean IsUIso,
+ const int theDiscret,
+ vtkPolyData *thePolyData,
+ vtkPoints *thePts);
static
void
void SetShape(const TopoDS_Shape& theShape,
const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
bool theIsVector,
+ GEOM_VertexSource* theStandaloneVertexSource,
GEOM_EdgeSource* theIsolatedEdgeSource,
GEOM_EdgeSource* theOneFaceEdgeSource,
GEOM_EdgeSource* theSharedEdgeSource,
TopoDS_Iterator anItr(theShape);
for (; anItr.More(); anItr.Next()) {
SetShape(anItr.Value(),theEdgeMap,theIsVector,
+ theStandaloneVertexSource,
theIsolatedEdgeSource,
theOneFaceEdgeSource,
theSharedEdgeSource,
break;
}
case TopAbs_VERTEX: {
+ if ( theStandaloneVertexSource ) {
+ const TopoDS_Vertex& aVertex = TopoDS::Vertex(theShape);
+ theStandaloneVertexSource->AddVertex(aVertex);
+ }
break;
}
default: {
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+class GEOM_VertexSource;
class GEOM_EdgeSource;
class GEOM_WireframeFace;
class GEOM_ShadingFace;
OCC2VTK_EXPORT void SetShape(const TopoDS_Shape& theShape,
const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
bool theIsVector,
+ GEOM_VertexSource* theStandaloneVertexSource,
GEOM_EdgeSource* theIsolatedEdgeSource,
GEOM_EdgeSource* theOneFaceEdgeSource,
GEOM_EdgeSource* theSharedEdgeSource,
+++ /dev/null
-#ifndef OCC2VTK_INTERNAL_H
-#define OCC2VTK_INTERNAL_H
-
-#include <NCollection_BaseCollection.hxx>
-#include <NCollection_BaseList.hxx>
-#include <NCollection_TListNode.hxx>
-#include <NCollection_TListIterator.hxx>
-
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Face.hxx>
-
-template <class TheItemType> class GEOM_Set
- : public NCollection_BaseCollection<TheItemType>,
- public NCollection_BaseList
-{
-public:
- typedef NCollection_TListNode<TheItemType> SetNode;
- typedef NCollection_TListIterator<TheItemType> Iterator;
-
-public:
- //! Constructor
- GEOM_Set(const Handle(NCollection_BaseAllocator)& theAllocator=0L) :
- NCollection_BaseCollection<TheItemType>(theAllocator),
- NCollection_BaseList() {}
-
- //! Copy constructor
- GEOM_Set (const GEOM_Set& theOther) :
- NCollection_BaseCollection<TheItemType>(theOther.myAllocator),
- NCollection_BaseList()
- { *this = theOther; }
-
- //! Size - Number of items
- virtual Standard_Integer Size (void) const
- { return Extent(); }
-
- //! Replace this list by the items of theOther collection
- virtual void Assign (const NCollection_BaseCollection<TheItemType>& theOther)
- {
- if (this == &theOther)
- return;
- Clear();
- TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& anIter =
- theOther.CreateIterator();
- for (; anIter.More(); anIter.Next())
- {
- SetNode* pNew = new (this->myAllocator) SetNode(anIter.Value());
- PAppend (pNew);
- }
- }
-
- //! Replace this list by the items of theOther Set
- GEOM_Set& operator= (const GEOM_Set& theOther)
- {
- if (this == &theOther)
- return *this;
- Clear ();
- SetNode * pCur = (SetNode *) theOther.PFirst();
- while (pCur)
- {
- SetNode* pNew = new (this->myAllocator) SetNode(pCur->Value());
- PAppend (pNew);
- pCur = (SetNode *) pCur->Next();
- }
- return *this;
- }
-
- //! Clear this set
- void Clear (void)
- { PClear (SetNode::delNode, this->myAllocator); }
-
- //! Add item
- Standard_Boolean Add (const TheItemType& theItem)
- {
- Iterator anIter(*this);
- while (anIter.More())
- {
- if (anIter.Value() == theItem)
- return Standard_False;
- anIter.Next();
- }
- SetNode * pNew = new (this->myAllocator) SetNode(theItem);
- PPrepend (pNew);
- return Standard_True;
- }
-
- //! Remove item
- Standard_Boolean Remove (const TheItemType& theItem)
- {
- Iterator anIter(*this);
- while (anIter.More())
- {
- if (anIter.Value() == theItem)
- {
- PRemove (anIter, SetNode::delNode, this->myAllocator);
- return Standard_True;
- }
- anIter.Next();
- }
- return Standard_False;
- }
-
- //! Remove - wrapper against 'hiding' warnings
- void Remove (Iterator& theIter)
- { NCollection_BaseList::PRemove (theIter,
- SetNode::delNode,
- this->myAllocator); }
-
- //! Contains - item inclusion query
- Standard_Boolean Contains (const TheItemType& theItem) const
- {
- Iterator anIter(*this);
- for (; anIter.More(); anIter.Next())
- if (anIter.Value() == theItem)
- return Standard_True;
- return Standard_False;
- }
-
- //! IsASubset
- Standard_Boolean IsASubset (const GEOM_Set& theOther)
- {
- if (this == &theOther)
- return Standard_True;
- Iterator anIter(theOther);
- for (; anIter.More(); anIter.Next())
- if (!Contains(anIter.Value()))
- return Standard_False;
- return Standard_True;
- }
-
- //! IsAProperSubset
- Standard_Boolean IsAProperSubset (const GEOM_Set& theOther)
- {
- if (myLength <= theOther.Extent())
- return Standard_False;
- Iterator anIter(theOther);
- for (; anIter.More(); anIter.Next())
- if (!Contains(anIter.Value()))
- return Standard_False;
- return Standard_True;
- }
-
- //! Union
- void Union (const GEOM_Set& theOther)
- {
- if (this == &theOther)
- return;
- Iterator anIter(theOther);
- Iterator aMyIter;
- Standard_Integer i, iLength=myLength;
- for (; anIter.More(); anIter.Next())
- {
- Standard_Boolean isIn=Standard_False;
- const TheItemType& theItem = anIter.Value();
- for (aMyIter.Init(*this), i=1;
- i<=iLength;
- aMyIter.Next(), i++)
- if (theItem == aMyIter.Value())
- isIn = Standard_True;
- if (!isIn)
- {
- SetNode * pNew = new (this->myAllocator) SetNode(theItem);
- PAppend (pNew);
- }
- }
- }
-
- //! Intersection
- void Intersection (const GEOM_Set& theOther)
- {
- if (this == &theOther)
- return;
- Iterator anIter(*this);
- while (anIter.More())
- if (theOther.Contains(anIter.Value()))
- anIter.Next();
- else
- NCollection_BaseList::PRemove (anIter, SetNode::delNode, this->myAllocator);
- }
-
- //! Difference (Subtraction)
- void Difference (const GEOM_Set& theOther)
- {
- if (this == &theOther)
- return;
- Iterator anIter(*this);
- while (anIter.More())
- if (theOther.Contains(anIter.Value()))
- NCollection_BaseList::PRemove (anIter, SetNode::delNode, this->myAllocator);
- else
- anIter.Next();
- }
-
- //! Destructor - clears the List
- ~GEOM_Set (void)
- { Clear(); }
-
-private:
- //! Creates Iterator for use on BaseCollection
- virtual TYPENAME NCollection_BaseCollection<TheItemType>::Iterator&
- CreateIterator(void) const
- { return *(new (this->IterAllocator()) Iterator(*this)); }
-
-};
-
-typedef GEOM_Set<TopoDS_Vertex> TVertexSet;
-typedef GEOM_Set<TopoDS_Edge> TEdgeSet;
-typedef GEOM_Set<TopoDS_Face> TFaceSet;
-
-class VertexSourceInternal
-{
-public:
- TVertexSet myVertexSet;
-};
-
-class EdgeSourceInternal
-{
-public:
- TEdgeSet myEdgeSet;
-};
-
-class FaceSourceInternal
-{
-public:
- TFaceSet myFaceSet;
-};
-
-#endif // OCC2VTK_INTERNAL_H
${CMAKE_CURRENT_BINARY_DIR}
)
-IF(SALOME_GEOM_DEBUG_CC)
- # for debug purposes, to be removed
- INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/CurveCreator)
-ENDIF()
-
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${CAS_DEFINITIONS}
SET(_link_LIBRARIES
GEOMBase
)
-IF(SALOME_GEOM_DEBUG_CC)
- # for debug purposes, to be removed
- LIST(APPEND _link_LIBRARIES CurveCreator)
-ENDIF()
# --- resources ---
#include <GeometryGUI.h>
#include "GeometryGUI_Operations.h"
-#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
-#include <SUIT_ViewManager.h>
#include <SalomeApp_Application.h>
-#include <OCCViewer_ViewWindow.h>
-
-#include <TopTools_MapOfShape.hxx>
-#include <TopExp_Explorer.hxx>
-#include <Precision.hxx>
#include "OperationGUI_PartitionDlg.h" // Method PARTITION
#include "OperationGUI_ArchimedeDlg.h" // Method ARCHIMEDE
#include "OperationGUI_GetSharedShapesDlg.h"
#include "OperationGUI_ExtrudedFeatureDlg.h" // Methods EXTRUDED BOSS / CUT
-#ifdef DEBUG_CURVE_CREATOR
-// for debug purposes, to be removed
-#include "CurveCreator_Widget.h"
-#include <QVBoxLayout>
-#include <QPushButton>
-#endif
-
//=======================================================================
// function : OperationGUI()
// purpose : Constructor
case GEOMOp::OpExtrudedCut: (new OperationGUI_ExtrudedFeatureDlg (CUT, getGeometryGUI(), parent))->show(); break;
case GEOMOp::OpFillet1d: (new OperationGUI_Fillet1d2dDlg (getGeometryGUI(), parent, true))->show(); break;
case GEOMOp::OpFillet2d: (new OperationGUI_Fillet1d2dDlg (getGeometryGUI(), parent, false))->show(); break;
-#ifdef DEBUG_CURVE_CREATOR
- // for debug purposes, to be removed
- case GEOMOp::OpCurveCreator:
- {
- static CurveCreator_Curve *aStaticCurve = NULL;
-
- if (aStaticCurve == NULL) {
- aStaticCurve = new CurveCreator_Curve(CurveCreator::Dim2d);
- }
- if (CurveCreator::Dim2d == aStaticCurve->getDimension()) {
- OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)getGeometryGUI()->getApp()->activeViewManager()->getActiveView();
- vw->onTopView();
- }
-
- QDialog *aDialog = new QDialog(parent);
- QVBoxLayout *aMainLO = new QVBoxLayout;
- QPushButton *aQuitButton = new QPushButton(tr("Close"));
- CurveCreator_Widget *aWidget =
- new CurveCreator_Widget (aDialog, aStaticCurve);
-
- connect(aQuitButton, SIGNAL(clicked()), aDialog, SLOT(close()));
- aMainLO->addWidget(aWidget);
- aMainLO->addWidget(aQuitButton);
-
- aDialog->setLayout(aMainLO);
- aDialog->setAttribute(Qt::WA_DeleteOnClose);
- aDialog->show();
- }
- break;
-#endif
default:
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
}
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
mainFrame()->RadioButton3->close();
- GroupPoints = new DlgRef_2Sel2Spin(centralWidget());
+ GroupPoints = new DlgRef_2Sel3Spin1Check(centralWidget());
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_POINT"));
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS"));
GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT"));
+ GroupPoints->TextLabel5->setText(tr("GEOM_ANGLE"));
+ GroupPoints->checkBox->setText(tr(""));
GroupPoints->PushButton1->setIcon(image2);
GroupPoints->PushButton2->setIcon(image2);
+ GroupPoints->SpinBox_DZ->setDisabled(true);
- GroupDimensions = new DlgRef_2Spin(centralWidget());
+ GroupDimensions = new DlgRef_3Spin1CheckCyl(centralWidget());
GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS"));
GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT"));
+ GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
+ GroupDimensions->checkBox->setText(tr(""));
+ GroupDimensions->SpinBox_DZ->setDisabled(true);
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
// min, max, step and decimals for spin boxes & initial values
+ double SpecificStep = 5;
initSpinBox(GroupPoints->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
initSpinBox(GroupPoints->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
+ initSpinBox(GroupPoints->SpinBox_DZ, 0., 360., SpecificStep, "angle_precision" );
+
initSpinBox(GroupDimensions->SpinBox_DX, 0.00001, COORD_MAX, step, "length_precision" );
initSpinBox(GroupDimensions->SpinBox_DY, 0.00001, COORD_MAX, step, "length_precision" );
+ initSpinBox(GroupDimensions->SpinBox_DZ, 0., 360., SpecificStep, "angle_precision" );
// init variables
myEditCurrentArgument = GroupPoints->LineEdit1;
myPoint.nullify();
myDir.nullify();
- double aRadius(100.0), aHeight(300.0);
+ double aRadius(100.0), aHeight(300.0), aAngle(270.);
GroupPoints->SpinBox_DX->setValue(aRadius);
GroupPoints->SpinBox_DY->setValue(aHeight);
+ GroupPoints->SpinBox_DZ->setValue(aAngle);
GroupDimensions->SpinBox_DX->setValue(aRadius);
GroupDimensions->SpinBox_DY->setValue(aHeight);
+ GroupDimensions->SpinBox_DZ->setValue(aAngle);
// signals and slots connections
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupPoints->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupDimensions->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
-
+
+ connect(GroupPoints->checkBox, SIGNAL(toggled(bool)), this, SLOT(ActivateAngle()));
+ connect(GroupDimensions->checkBox, SIGNAL(toggled(bool)), this, SLOT(ActivateAngle()));
+
initName(tr("GEOM_CYLINDER"));
setConstructorId(1); // simplest constructor
updateGeometry();
resize(minimumSizeHint());
SelectionIntoArgument();
-
+
displayPreview(true);
}
this, SLOT(SelectionIntoArgument()));
}
}
-
displayPreview(true);
}
//=================================================================================
void PrimitiveGUI_CylinderDlg::ValueChangedInSpinBox()
{
+ QString msg;
+ if (!isValid(msg)) {
+ erasePreview();
+ return;
+ }
displayPreview(true);
}
{
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) &&
GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) &&
+ ( !GroupPoints->checkBox->isChecked() || GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) ) &&
myPoint && myDir;
+ if ( GroupPoints->checkBox->isChecked() &&
+ ( GroupPoints->SpinBox_DZ->value() <= 0. || GroupPoints->SpinBox_DZ->value() >= 360. ) ) {
+ msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
+ ok = false;
+ }
}
else if( getConstructorId() == 1 )
{
ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
- GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() );
+ GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
+ ( GroupDimensions->checkBox->isChecked() || GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) );
+ if ( GroupDimensions->checkBox->isChecked() &&
+ ( GroupDimensions->SpinBox_DZ->value() <= 0. || GroupDimensions->SpinBox_DZ->value() >= 360. ) ) {
+ msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
+ ok = false;
+ }
}
ok = qAbs( getHeight() ) > Precision::Confusion() && ok;
+ ok = qAbs( getRadius() ) > Precision::Confusion() && ok;
return ok;
}
bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects)
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
switch (getConstructorId()) {
case 0:
if ( myPoint && myDir ) {
- anObj = anOper->MakeCylinderPntVecRH(myPoint.get(), myDir.get(), getRadius(), getHeight());
+ if ( GroupPoints->checkBox->isChecked() ) {
+ anObj = anOper->MakeCylinderPntVecRHA(myPoint.get(), myDir.get(), getRadius(), getHeight(), getAngle()*M_PI/180.);
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ aParameters << GroupPoints->SpinBox_DY->text();
+ aParameters << GroupPoints->SpinBox_DZ->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ }
+ res = true;
+ }
+ else {
+ anObj = anOper->MakeCylinderPntVecRH(myPoint.get(), myDir.get(), getRadius(), getHeight());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ aParameters << GroupPoints->SpinBox_DY->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ }
+ res = true;
+ }
+ }
+ break;
+ case 1:
+ if ( GroupDimensions->checkBox->isChecked() ) {
+ anObj = anOper->MakeCylinderRHA(getRadius(), getHeight(), getAngle()*M_PI/180.);
if (!anObj->_is_nil() && !IsPreview())
{
- QStringList aParameters;
- aParameters << GroupPoints->SpinBox_DX->text();
- aParameters << GroupPoints->SpinBox_DY->text();
- anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ aParameters << GroupDimensions->SpinBox_DZ->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
}
res = true;
}
- break;
- case 1:
- anObj = anOper->MakeCylinderRH(getRadius(), getHeight());
- if (!anObj->_is_nil() && !IsPreview())
- {
- QStringList aParameters;
- aParameters << GroupDimensions->SpinBox_DX->text();
- aParameters << GroupDimensions->SpinBox_DY->text();
- anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ else {
+ anObj = anOper->MakeCylinderRH(getRadius(), getHeight());
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ aParameters << GroupDimensions->SpinBox_DY->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ }
+ res = true;
}
- res = true;
break;
}
return 0;
}
+//=================================================================================
+// function : getAngle()
+// purpose :
+//=================================================================================
+double PrimitiveGUI_CylinderDlg::getAngle() const
+{
+ int aConstructorId = getConstructorId();
+ if (aConstructorId == 0)
+ return GroupPoints->SpinBox_DZ->value();
+ else if (aConstructorId == 1)
+ return GroupDimensions->SpinBox_DZ->value();
+ return 0;
+}
+
//=================================================================================
// function : addSubshapeToStudy
// purpose : virtual method to add new SubObjects if local selection
GEOMBase::PublishSubObject( myDir.get() );
}
}
+
+//=================================================================================
+// function : ActivateAngle()
+// purpose : enable the
+//=================================================================================
+void PrimitiveGUI_CylinderDlg::ActivateAngle()
+{
+ int aConstructorId = getConstructorId();
+ if (aConstructorId == 0){
+ GroupPoints->SpinBox_DZ->setEnabled( GroupPoints->checkBox->isChecked() );
+ processPreview();
+ }
+ else if (aConstructorId == 1){
+ GroupDimensions->SpinBox_DZ->setEnabled( GroupDimensions->checkBox->isChecked() );
+ processPreview();
+ }
+}
#include "GEOMBase_Skeleton.h"
#include "GEOM_GenericObjPtr.h"
-class DlgRef_2Sel2Spin;
-class DlgRef_2Spin;
+class DlgRef_2Sel3Spin1Check;
+class DlgRef_3Spin1CheckCyl;
//=================================================================================
// class : PrimitiveGUI_CylinderDlg
void enterEvent( QEvent* );
double getRadius() const;
double getHeight() const;
+ double getAngle() const;
private:
GEOM::GeomObjPtr myPoint, myDir;
// to initialize the first selection field with a selected object on the dialog creation
bool myInitial;
- DlgRef_2Sel2Spin* GroupPoints;
- DlgRef_2Spin* GroupDimensions;
+ DlgRef_2Sel3Spin1Check* GroupPoints;
+ DlgRef_3Spin1CheckCyl* GroupDimensions;
private slots:
void ClickOnOk();
void ConstructorsClicked( int );
void ValueChangedInSpinBox();
void SetDoubleSpinBoxStep( double );
+ void ActivateAngle();
};
#endif // PRIMITIVEGUI_CYLINDERDLG_H
aLay->addStretch();
aLay->addWidget( aFrame );
- myHelpFileName = "using_measurement_tools_page.html#faces_anchor";
+ myHelpFileName = "free_faces_page.html";
connect( aCloseBtn, SIGNAL( clicked() ), SLOT( onClose() ) );
connect( aHelpBtn, SIGNAL( clicked() ), SLOT( onHelp() ) );
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <OCCViewer_ViewModel.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <GEOMImpl_Types.hxx>
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <OCCViewer_ViewModel.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include <GEOMImpl_Types.hxx>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_MessageBox.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
#include <Basics_Utils.hxx>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
// OCCT Includes
#include <TopAbs.hxx>
# --- headers ---
SET(SKETCHER_HEADERS
+ Sketcher.hxx
Sketcher_Profile.hxx
+ Sketcher_Utils.hxx
)
# --- sources ---
SET(SKETCHER_SOURCES
Sketcher_Profile.cxx
+ Sketcher_Utils.cxx
)
# --- rules ---
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : Sketcher.hxx
+// Author : Sergey KHROMOV
+
+#ifndef _SKETCHER_HXX_
+#define _SKETCHER_HXX_
+
+#if defined WIN32
+# if defined SKETCHER_SALOME_EXPORTS || defined SKETCHER_EXPORTS || defined GEOMSketcher_EXPORTS || defined GEOMSKETCHER_EXPORTS
+# define SKETCHER_SALOME_EXPORT _declspec( dllexport )
+# else
+# define SKETCHER_SALOME_EXPORT _declspec( dllimport )
+# endif
+#else
+# define SKETCHER_SALOME_EXPORT
+#endif
+
+#endif // SKETCHER_HXX
\ No newline at end of file
// File : Sketcher_Profile.h
// Author : Damien COQUERET
-#if defined WIN32
-# if defined SKETCHER_SALOME_EXPORTS || defined SKETCHER_EXPORTS || defined GEOMSketcher_EXPORTS || defined GEOMSKETCHER_EXPORTS
-# define SKETCHER_SALOME_EXPORT _declspec( dllexport )
-# else
-# define SKETCHER_SALOME_EXPORT _declspec( dllimport )
-# endif
-#else
-# define SKETCHER_SALOME_EXPORT
-#endif
+#ifndef _Sketcher_Profile_HXX_
+#define _Sketcher_Profile_HXX_
+
+
+#include "Sketcher.hxx"
#include <TopoDS_Shape.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_Array1OfAsciiString.hxx>
private:
TCollection_AsciiString myCommand;
};
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : Sketcher_Utils.cxx
+// Author : Sergey KHROMOV
+// Module : GEOM
+
+
+#include "Sketcher_Utils.hxx"
+
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <ElSLib.hxx>
+#include <GeomAPI_Interpolate.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
+#include <TopoDS_Wire.hxx>
+
+const double POINT_CONFUSION_TOLERANCE = 0.0001;
+
+
+//=======================================================================
+// function : MakePolyline
+// purpose :
+//=======================================================================
+TopoDS_Shape Sketcher_Utils::MakePolyline
+ (const std::list <double> &theCoords2D,
+ const Standard_Boolean IsClosed,
+ const gp_Ax3 &thePlane)
+{
+ std::list <gp_Pnt> aPoints;
+ TopoDS_Shape aResult;
+
+ To3D(theCoords2D, thePlane, aPoints);
+
+ Standard_Integer aNbPnts = aPoints.size();
+
+ if (aNbPnts > 1) {
+ if (IsClosed &&
+ aPoints.front().IsEqual(aPoints.back(), POINT_CONFUSION_TOLERANCE)) {
+ // The polyline should be closed, first and last points are confused.
+ // Remove the last point.
+ aPoints.pop_back();
+ --aNbPnts;
+ }
+ }
+
+ if (aNbPnts == 1) {
+ // The result is vertex.
+ aResult = BRepBuilderAPI_MakeVertex(aPoints.front()).Vertex();
+ } else if (aNbPnts > 1) {
+ // There are several points. Make a polyline.
+ std::list <gp_Pnt>::const_iterator anIter = aPoints.begin();
+ TopoDS_Vertex aVtxFirst =
+ BRepBuilderAPI_MakeVertex(*anIter).Vertex();
+ TopoDS_Vertex aVtx[2];
+ TopoDS_Edge aSegment;
+ BRepBuilderAPI_MakeWire aMkWire;
+
+ aVtx[0] = aVtxFirst;
+
+ for (++anIter; anIter != aPoints.end(); ++anIter) {
+ aVtx[1] = BRepBuilderAPI_MakeVertex(*anIter).Vertex();
+ aSegment = BRepBuilderAPI_MakeEdge(aVtx[0], aVtx[1]).Edge();
+ aMkWire.Add(aSegment);
+ aVtx[0] = aVtx[1];
+ }
+
+ if (IsClosed) {
+ // Create a closing segment.
+ aSegment = BRepBuilderAPI_MakeEdge(aVtx[0], aVtxFirst).Edge();
+ aMkWire.Add(aSegment);
+ }
+
+ aResult = aMkWire.Wire();
+ }
+
+ return aResult;
+}
+
+//=======================================================================
+// function : MakeInterpolation
+// purpose :
+//=======================================================================
+TopoDS_Shape Sketcher_Utils::MakeInterpolation
+ (const std::list <double> &theCoords2D,
+ const Standard_Boolean IsClosed,
+ const gp_Ax3 &thePlane)
+{
+ std::list <gp_Pnt> aPoints;
+ TopoDS_Shape aResult;
+
+ To3D(theCoords2D, thePlane, aPoints);
+
+ Standard_Integer aNbPnts = aPoints.size();
+
+ if (aNbPnts > 1) {
+ if (IsClosed &&
+ aPoints.front().IsEqual(aPoints.back(), POINT_CONFUSION_TOLERANCE)) {
+ // The polyline should be closed, first and last points are confused.
+ // Remove the last point.
+ aPoints.pop_back();
+ --aNbPnts;
+ }
+ }
+
+ if (aNbPnts == 1) {
+ // The result is vertex.
+ aResult = BRepBuilderAPI_MakeVertex(aPoints.front()).Vertex();
+ } else if (aNbPnts > 1) {
+ std::list <gp_Pnt>::const_iterator anIter = aPoints.begin();
+ Handle(TColgp_HArray1OfPnt) aHCurvePoints =
+ new TColgp_HArray1OfPnt(1, aNbPnts);
+ Standard_Integer i;
+
+ for (i = 1; anIter != aPoints.end(); ++anIter, ++i) {
+ aHCurvePoints->SetValue(i, *anIter);
+ }
+
+ // Compute BSpline
+ Standard_Real aTol = Precision::Confusion();
+ GeomAPI_Interpolate aGBC(aHCurvePoints, IsClosed, aTol);
+
+ aGBC.Perform();
+
+ if (aGBC.IsDone()) {
+ TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aGBC.Curve()).Edge();
+ aResult = BRepBuilderAPI_MakeWire(anEdge).Wire();
+ }
+ }
+
+ return aResult;
+}
+
+//=======================================================================
+// function : To3D
+// purpose :
+//=======================================================================
+void Sketcher_Utils::To3D(const std::list <double> &theCoords2D,
+ const gp_Ax3 &thePlane,
+ std::list <gp_Pnt> &thePoints)
+{
+ thePoints.clear();
+
+ if (theCoords2D.empty() || theCoords2D.size() % 2 == 1) {
+ // Odd number of coordinates or empty list. Invalid case.
+ return;
+ }
+
+ std::list <double>::const_iterator anIter = theCoords2D.begin();
+ Standard_Real aX = *anIter;
+ Standard_Real aY = *(++anIter);
+ gp_Pnt aPLast = ElSLib::PlaneValue (aX, aY, thePlane);
+ gp_Pnt aPnt;
+
+ thePoints.push_back(aPLast);
+
+ for (++anIter; anIter != theCoords2D.end(); ++anIter) {
+ aX = *anIter;
+ aY = *(++anIter);
+ aPnt = ElSLib::PlaneValue (aX, aY, thePlane);
+
+ if (!aPLast.IsEqual(aPnt, POINT_CONFUSION_TOLERANCE)) {
+ thePoints.push_back(aPnt);
+ aPLast = aPnt;
+ }
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : Sketcher_Utils.h
+// Author : Sergey KHROMOV
+
+
+#ifndef _Sketcher_Utils_HXX_
+#define _Sketcher_Utils_HXX_
+
+
+#include "Sketcher.hxx"
+
+#include <gp_Pnt.hxx>
+#include <TopoDS_Shape.hxx>
+
+#include <list>
+
+
+class gp_Ax3;
+
+
+/**
+ * This class represents a set of utils needed to compute sketcher geometry.
+ */
+class SKETCHER_SALOME_EXPORT Sketcher_Utils
+{
+
+public:
+
+ /**
+ * This method makes a shape from the list of 2D coordinates on the working
+ * plane. The result represents a vertex if there is only one point
+ * in the contour. If there are more then one points the result is a wire
+ * consisting of linear segments between points. It is either closed or not
+ * depending on the flag IsClosed. In case of failure the result is a null
+ * shape.
+ *
+ * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
+ * ..., xN, yN for N 2D points.
+ * \param IsClosed if Standard_True the first and last points are connected
+ * to form the closed contour.
+ * \param thePlane the working plane coordinate system.
+ * \return the result polyline.
+ */
+ static TopoDS_Shape MakePolyline(const std::list <double> &theCoords2D,
+ const Standard_Boolean IsClosed,
+ const gp_Ax3 &thePlane);
+
+ /**
+ * This method makes a shape from the list of 2D coordinates on the working
+ * plane. The result represents a vertex if there is only one point
+ * in the contour. If there are more then one points the result is a wire
+ * consisting of a points interpolation BSpline curve. It is either closed
+ * or not depending on the flag IsClosed. In case of failure the result is
+ * a null shape.
+ *
+ * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
+ * ..., xN, yN for N 2D points.
+ * \param IsClosed if Standard_True the first and last points are connected
+ * to form the closed contour.
+ * \param thePlane the working plane coordinate system.
+ * \return the result interpolation wire.
+ */
+ static TopoDS_Shape MakeInterpolation(const std::list <double> &theCoords2D,
+ const Standard_Boolean IsClosed,
+ const gp_Ax3 &thePlane);
+
+ /**
+ * This method converts the list of 2D point coordinates into 3D points
+ * basing on the working plane. The result list contains not confused points.
+ *
+ * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
+ * ..., xN, yN for N 2D points.
+ * \param thePlane the working plane coordinate system.
+ * \param thePoints the list of 3D points.
+ */
+ static void To3D(const std::list <double> &theCoords2D,
+ const gp_Ax3 &thePlane,
+ std::list <gp_Pnt> &thePoints);
+
+};
+
+#endif
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKSTEP}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(STEPExport_SOURCES
- STEPExport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(STEPExport ${STEPExport_SOURCES})
-TARGET_LINK_LIBRARIES(STEPExport ${_link_LIBRARIES})
-INSTALL(TARGETS STEPExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: STEPExport.cxx
-// Created: Wed May 19 14:53:52 2004
-// Author: Pavel TELKOV
-
-#include "utilities.h"
-
-#include <Basics_Utils.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-
-#include <STEPControl_Writer.hxx>
-#include <Interface_Static.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-
-#ifdef WIN32
- #if defined STEPEXPORT_EXPORTS || defined STEPExport_EXPORTS
- #define STEPEXPORT_EXPORT __declspec( dllexport )
- #else
- #define STEPEXPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define STEPEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- STEPEXPORT_EXPORT int Export (const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/)
- {
- MESSAGE("Export STEP into file " << theFileName.ToCString());
-
- try
- {
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- IFSelect_ReturnStatus status ;
- //VRV: OCC 4.0 migration
- STEPControl_Writer aWriter;
- //VSR: 16/09/09: Convert to METERS
- Interface_Static::SetCVal("xstep.cascade.unit","M");
- Interface_Static::SetCVal("write.step.unit", "M");
- Interface_Static::SetIVal("write.step.nonmanifold", 1);
- //JFA: PAL6162 status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
- status = aWriter.Transfer( theShape, STEPControl_AsIs );
- //VRV: OCC 4.0 migration
- if ( status == IFSelect_RetDone )
- status = aWriter.Write( theFileName.ToCString() );
-
- // Return previous locale
- if ( status == IFSelect_RetDone )
- return 1;
- }
- catch (Standard_Failure)
- {
- //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
- }
- return 0;
- }
-}
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKSTEP} ${CAS_TKCAF}
- ${CAS_TKLCAF}
- ${CAS_TKSTEPBase}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(STEPImport_SOURCES
- STEPImport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(STEPImport ${STEPImport_SOURCES})
-TARGET_LINK_LIBRARIES(STEPImport ${_link_LIBRARIES})
-INSTALL(TARGETS STEPImport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: STEPImport.cxx
-// Created: Wed May 19 14:41:10 2004
-// Author: Pavel TELKOV
-
-#include "utilities.h"
-
-#include <Basics_Utils.hxx>
-#include <Basics_OCCTVersion.hxx>
-
-#include <TDF_ChildIDIterator.hxx>
-#include <TDF_Label.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDataStd_Comment.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <Interface_Static.hxx>
-#include <STEPControl_Reader.hxx>
-#include <StepBasic_Product.hxx>
-#include <StepBasic_ProductDefinition.hxx>
-#include <StepBasic_ProductDefinitionFormation.hxx>
-#include <StepGeom_GeometricRepresentationItem.hxx>
-#include <StepShape_TopologicalRepresentationItem.hxx>
-#include <StepRepr_DescriptiveRepresentationItem.hxx>
-#include <StepRepr_ProductDefinitionShape.hxx>
-#include <StepRepr_PropertyDefinitionRepresentation.hxx>
-#include <StepRepr_Representation.hxx>
-#include <TransferBRep.hxx>
-#include <Transfer_Binder.hxx>
-#include <Transfer_TransientProcess.hxx>
-#include <XSControl_TransferReader.hxx>
-#include <XSControl_WorkSession.hxx>
-
-#include <BRep_Builder.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Iterator.hxx>
-#include <TopoDS_Shape.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TColStd_SequenceOfAsciiString.hxx>
-
-#include <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
-#ifdef WIN32
- #if defined STEPIMPORT_EXPORTS || defined STEPImport_EXPORTS
- #define STEPIMPORT_EXPORT __declspec( dllexport )
- #else
- #define STEPIMPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define STEPIMPORT_EXPORT
-#endif
-
-
-//=============================================================================
-/*!
- * GetShape()
- */
-//=============================================================================
-
-static TopoDS_Shape GetShape(const Handle(Standard_Transient) &theEnti,
- const Handle(Transfer_TransientProcess) &theTP)
-{
- TopoDS_Shape aResult;
- Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
-
- if (aBinder.IsNull()) {
- return aResult;
- }
-
- aResult = TransferBRep::ShapeResult(aBinder);
-
- return aResult;
-}
-
-//=============================================================================
-/*!
- * GetLabel()
- */
-//=============================================================================
-
-static TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
- const TDF_Label &theShapeLabel,
- const TopoDS_Shape &aShape)
-{
- TDF_Label aResult;
-
- if (theEnti->IsKind
- (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
- // check all named shapes using iterator
- TDF_ChildIDIterator anIt
- (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
-
- for (; anIt.More(); anIt.Next()) {
- Handle(TDataStd_Name) nameAttr =
- Handle(TDataStd_Name)::DownCast(anIt.Value());
-
- if (nameAttr.IsNull()) {
- continue;
- }
-
- TDF_Label aLab = nameAttr->Label();
- Handle(TNaming_NamedShape) shAttr;
-
- if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
- shAttr->Get().IsEqual(aShape)) {
- aResult = aLab;
- }
- }
- }
-
- // create label and set shape
- if (aResult.IsNull()) {
- TDF_TagSource aTag;
-
- aResult = aTag.NewChild(theShapeLabel);
-
- TNaming_Builder tnBuild (aResult);
-
- tnBuild.Generated(aShape);
- }
-
- return aResult;
-}
-
-//=============================================================================
-/*!
- * StoreName()
- */
-//=============================================================================
-
-static void StoreName(const Handle(Standard_Transient) &theEnti,
- const TopTools_IndexedMapOfShape &theIndices,
- const Handle(Transfer_TransientProcess) &theTP,
- const TDF_Label &theShapeLabel)
-{
- Handle(TCollection_HAsciiString) aName;
-
- if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
- theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
- aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
- } else {
- Handle(StepBasic_ProductDefinition) PD =
- Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
-
- if (PD.IsNull() == Standard_False) {
- Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
- aName = Prod->Name();
- }
- }
-
- bool isValidName = false;
-
- if (aName.IsNull() == Standard_False) {
- isValidName = true;
-
- if (aName->UsefullLength() < 1) {
- isValidName = false;
- } else if (aName->UsefullLength() == 4 &&
- toupper (aName->Value(1)) == 'N' &&
- toupper (aName->Value(2)) == 'O' &&
- toupper (aName->Value(3)) == 'N' &&
- toupper (aName->Value(4)) == 'E') {
- // skip 'N0NE' name
- isValidName = false;
- } else {
- // special check to pass names like "Open CASCADE STEP translator 6.3 1"
- TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
-
- if (aName->Length() >= aSkipName.Length()) {
- if (aName->String().SubString
- (1, aSkipName.Length()).IsEqual(aSkipName)) {
- isValidName = false;
- }
- }
- }
- }
-
- if (isValidName) {
- TCollection_ExtendedString aNameExt (aName->ToCString());
-
- // find target shape
- TopoDS_Shape S = GetShape(theEnti, theTP);
-
- if (S.IsNull()) {
- return;
- }
-
- // as PRODUCT can be included in the main shape
- // several times, we look here for all iclusions.
- Standard_Integer isub, nbSubs = theIndices.Extent();
-
- for (isub = 1; isub <= nbSubs; isub++) {
- TopoDS_Shape aSub = theIndices.FindKey(isub);
-
- if (aSub.IsPartner(S)) {
- TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
-
- // set a name
- TDataStd_Name::Set(L, aNameExt);
- }
- }
- }
-}
-
-//=============================================================================
-/*!
- * StoreMaterial()
- */
-//=============================================================================
-
-static void StoreMaterial
- (const Handle(Standard_Transient) &theEnti,
- const TopTools_IndexedMapOfShape &theIndices,
- const Handle(Transfer_TransientProcess) &theTP,
- const TDF_Label &theShapeLabel)
-{
- // Treat Product Definition Shape only.
- Handle(StepRepr_ProductDefinitionShape) aPDS =
- Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
- Handle(StepBasic_ProductDefinition) aProdDef;
-
- if(aPDS.IsNull() == Standard_False) {
- // Product Definition Shape ==> Product Definition
- aProdDef = aPDS->Definition().ProductDefinition();
- }
-
- if (aProdDef.IsNull() == Standard_False) {
- // Product Definition ==> Property Definition
- const Interface_Graph &aGraph = theTP->Graph();
- Interface_EntityIterator aSubs = aGraph.Sharings(aProdDef);
- TopoDS_Shape aShape;
-
- for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
- Handle(StepRepr_PropertyDefinition) aPropD =
- Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
-
- if(aPropD.IsNull() == Standard_False) {
- // Property Definition ==> Representation.
- Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
-
- for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
- Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
- Handle(StepRepr_PropertyDefinitionRepresentation)::
- DownCast(aSubs1.Value());
-
- if(aPDR.IsNull() == Standard_False) {
- // Property Definition ==> Material Name.
- Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
-
- if(aRepr.IsNull() == Standard_False) {
- Standard_Integer ir;
-
- for(ir = 1; ir <= aRepr->NbItems(); ir++) {
- Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
- Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
- Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
-
- if(aDRI.IsNull() == Standard_False) {
- // Get shape from Product Definition
- Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
-
- if(aMatName.IsNull() == Standard_False) {
- TCollection_ExtendedString
- aMatNameExt (aMatName->ToCString());
-
- if (aShape.IsNull()) {
- // Get the shape.
- aShape = GetShape(aProdDef, theTP);
-
- if (aShape.IsNull()) {
- return;
- }
- }
-
- // as PRODUCT can be included in the main shape
- // several times, we look here for all iclusions.
- Standard_Integer isub, nbSubs = theIndices.Extent();
-
- for (isub = 1; isub <= nbSubs; isub++) {
- TopoDS_Shape aSub = theIndices.FindKey(isub);
-
- if (aSub.IsPartner(aShape)) {
- TDF_Label aLabel =
- GetLabel(aProdDef, theShapeLabel, aSub);
-
- // set a name
- TDataStd_Comment::Set(aLabel, aMatNameExt);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-//=============================================================================
-/*!
- * Import()
- */
-//=============================================================================
-
-extern "C"
-{
- STEPIMPORT_EXPORT
- Handle(TCollection_HAsciiString) GetValue (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theParameterName,
- TCollection_AsciiString& theError)
- {
- Handle(TCollection_HAsciiString) aValue;
-
- if (theParameterName != "LEN_UNITS") {
- theError = theParameterName + " parameter reading is not supported by STEP plugin";
- return aValue;
- }
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- STEPControl_Reader aReader;
-
- Interface_Static::SetCVal("xstep.cascade.unit","M");
- Interface_Static::SetIVal("read.step.ideas", 1);
- Interface_Static::SetIVal("read.step.nonmanifold", 1);
-
- try {
-#if OCC_VERSION_LARGE > 0x06010000
- OCC_CATCH_SIGNALS;
-#endif
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
- if (status == IFSelect_RetDone) {
- TColStd_SequenceOfAsciiString anUnitLengthNames;
- TColStd_SequenceOfAsciiString anUnitAngleNames;
- TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
- aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
- if (anUnitLengthNames.Length() > 0) {
- aValue = new TCollection_HAsciiString( anUnitLengthNames.First() );
- /*
- TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
- if (aLenUnits == "millimetre")
- aValue = new TCollection_HAsciiString ("MM");
- else if (aLenUnits == "centimetre")
- aValue = new TCollection_HAsciiString ("CM");
- else if (aLenUnits == "metre")
- aValue = new TCollection_HAsciiString ("M");
- else if (aLenUnits == "INCH")
- aValue = new TCollection_HAsciiString ("INCH");
- // TODO (for other units than mm, cm, m or inch)
- //else if (aLenUnits == "")
- // aValue = new TCollection_HAsciiString ("");
-
- // tmp begin
- //std::cout << "$$$ --- " << anUnitLengthNames.First();
- //for (int ii = 2; ii <= anUnitLengthNames.Length(); ii++)
- // std::cout << ", " << anUnitLengthNames.Value(ii);
- //std::cout << std::endl;
- // tmp end
- */
- }
- }
- else {
- theError = theFileName + " reading failed";
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- }
-
- return aValue;
- }
-
- STEPIMPORT_EXPORT
- TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- TCollection_AsciiString& theError,
- const TDF_Label& theShapeLabel)
- {
- TopoDS_Shape aResShape;
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- STEPControl_Reader aReader;
-
- //VSR: 16/09/09: Convert to METERS
- Interface_Static::SetCVal("xstep.cascade.unit","M");
- Interface_Static::SetIVal("read.step.ideas", 1);
- Interface_Static::SetIVal("read.step.nonmanifold", 1);
-
- BRep_Builder B;
- TopoDS_Compound compound;
- B.MakeCompound(compound);
-
- try {
- OCC_CATCH_SIGNALS;
-
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
-
- if (status == IFSelect_RetDone) {
-
- // Regard or not the model units
- if (theFormatName == "STEP_SCALE") {
- // set UnitFlag to units from file
- TColStd_SequenceOfAsciiString anUnitLengthNames;
- TColStd_SequenceOfAsciiString anUnitAngleNames;
- TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
- aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
- if (anUnitLengthNames.Length() > 0) {
- TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
- if (aLenUnits == "millimetre")
- Interface_Static::SetCVal("xstep.cascade.unit", "MM");
- else if (aLenUnits == "centimetre")
- Interface_Static::SetCVal("xstep.cascade.unit", "CM");
- else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
- Interface_Static::SetCVal("xstep.cascade.unit", "M");
- else if (aLenUnits == "INCH")
- Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
- else {
- theError = "The file contains not supported units.";
- return aResShape;
- }
- // TODO (for other units than mm, cm, m or inch)
- //else if (aLenUnits == "")
- // Interface_Static::SetCVal("xstep.cascade.unit", "???");
- }
- }
- else {
- //cout<<"need re-scale a model"<<endl;
- // set UnitFlag to 'meter'
- Interface_Static::SetCVal("xstep.cascade.unit","M");
- }
-
- Standard_Boolean failsonly = Standard_False;
- aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity);
-
- /* Root transfers */
- Standard_Integer nbr = aReader.NbRootsForTransfer();
- aReader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity);
-
- for (Standard_Integer n = 1; n <= nbr; n++) {
- Standard_Boolean ok = aReader.TransferRoot(n);
- /* Collecting resulting entities */
- Standard_Integer nbs = aReader.NbShapes();
- if (!ok || nbs == 0)
- {
- // THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM);
- continue; // skip empty root
- }
- /* For a single entity */
- else if (nbr == 1 && nbs == 1) {
- aResShape = aReader.Shape(1);
- // ATTENTION: this is a workaround for mantis issue 0020442 remark 0010776
- // It should be removed after patching OCCT for bug OCC22436
- // (fix for OCCT is expected in service pack next to OCCT6.3sp12)
- if (aResShape.ShapeType() == TopAbs_COMPOUND) {
- int nbSub1 = 0;
- TopoDS_Shape currShape;
- TopoDS_Iterator It (aResShape, Standard_True, Standard_True);
- for (; It.More(); It.Next()) {
- nbSub1++;
- currShape = It.Value();
- }
- if (nbSub1 == 1)
- aResShape = currShape;
- }
- // END workaround
- break;
- }
-
- for (Standard_Integer i = 1; i <= nbs; i++) {
- TopoDS_Shape aShape = aReader.Shape(i);
- if (aShape.IsNull()) {
- // THROW_SALOME_CORBA_EXCEPTION("Null shape in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM) ;
- //return aResShape;
- continue;
- }
- else {
- B.Add(compound, aShape);
- }
- }
- }
- if (aResShape.IsNull())
- aResShape = compound;
-
- // Check if any BRep entity has been read, there must be at least a vertex
- if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() )
- {
- theError = "No geometrical data in the imported file.";
- return TopoDS_Shape();
- }
-
- // BEGIN: Store names and materials of sub-shapes from file
- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(aResShape, anIndices);
-
- Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
- Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
- if (!TR.IsNull()) {
- Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
-
- Standard_Integer nb = Model->NbEntities();
-
- for (Standard_Integer ie = 1; ie <= nb; ie++) {
- Handle(Standard_Transient) enti = Model->Value(ie);
-
- // Store names.
- StoreName(enti, anIndices, TP, theShapeLabel);
-
- // Store materials.
- StoreMaterial(enti, anIndices, TP, theShapeLabel);
- }
- }
- // END: Store names and materials
- }
- else {
-// switch (status) {
-// case IFSelect_RetVoid:
-// theError = "Nothing created or No data to process";
-// break;
-// case IFSelect_RetError:
-// theError = "Error in command or input data";
-// break;
-// case IFSelect_RetFail:
-// theError = "Execution was run, but has failed";
-// break;
-// case IFSelect_RetStop:
-// theError = "Execution has been stopped. Quite possible, an exception was raised";
-// break;
-// default:
-// break;
-// }
- theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- aResShape.Nullify();
- }
- // Return previous locale
- return aResShape;
- }
-}
--- /dev/null
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKSTEP}
+ ${CAS_TKSTEPBase}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLSTEPPlugin
+ GEOMEngine
+ GEOMClient
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLSTEPPlugin
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(STEPPluginEngine_HEADERS
+ STEPPlugin_IOperations_i.hh
+ STEPPlugin_Engine.hxx
+ STEPPlugin_OperationsCreator.hxx
+ STEPPlugin_IOperations.hxx
+ STEPPlugin_IExport.hxx
+ STEPPlugin_IImport.hxx
+ STEPPlugin_ImportDriver.hxx
+ STEPPlugin_ExportDriver.hxx
+ STEPPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ STEPPlugin_GUI.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(STEPPluginGUI_SOURCES
+ STEPPlugin_GUI.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(STEPPluginEngine_SOURCES
+ STEPPlugin_Engine.cxx
+ STEPPlugin_OperationsCreator.cxx
+ STEPPlugin_IOperations_i.cc
+ STEPPlugin_IOperations.cxx
+ STEPPlugin_ExportDriver.cxx
+ STEPPlugin_ImportDriver.cxx
+ STEPPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(STEPPlugin_RESOURCES
+ STEPPlugin_msg_en.ts
+ STEPPlugin_msg_fr.ts
+ STEPPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(STEPPluginEngine ${STEPPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(STEPPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS STEPPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(STEPPluginGUI ${STEPPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(STEPPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS STEPPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${STEPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${STEPPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_Engine.hxx"
+#include "STEPPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ STEPPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ STEPPlugin_OperationsCreator* aCreator = new STEPPlugin_OperationsCreator();
+ return aCreator;
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPLUGIN_ENGINE_HXX_
+#define _STEPPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined STEPPLUGINENGINE_EXPORTS || defined STEPPluginEngine_EXPORTS
+ #define STEPPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define STEPPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define STEPPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_ExportDriver.hxx"
+#include "STEPPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+
+// OOCT includes
+#include <IFSelect_ReturnStatus.hxx>
+#include <STEPControl_Writer.hxx>
+#include <Interface_Static.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& STEPPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("c47b9a61-c6a4-4335-8b13-6badb16b036f");
+ return aGUID;
+}
+
+//=======================================================================
+//function : STEPPlugin_ExportDriver
+//purpose :
+//=======================================================================
+STEPPlugin_ExportDriver::STEPPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ STEPPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+
+ MESSAGE("Export STEP into file " << aFileName.ToCString());
+
+ try
+ {
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ IFSelect_ReturnStatus status ;
+ //VRV: OCC 4.0 migration
+ STEPControl_Writer aWriter;
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("write.step.unit", "M");
+ Interface_Static::SetIVal("write.step.nonmanifold", 1);
+ status = aWriter.Transfer( aShape, STEPControl_AsIs );
+ //VRV: OCC 4.0 migration
+ if( status == IFSelect_RetDone )
+ status = aWriter.Write( aFileName.ToCString() );
+
+ // Return previous locale
+ if( status == IFSelect_RetDone )
+ return 1;
+ }
+ catch (Standard_Failure)
+ {
+ //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STEPExport", SALOME::BAD_PARAM);
+ }
+ return 0;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean STEPPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool STEPPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( STEPPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_ExportDriver_HXX
+#define _STEPPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( STEPPlugin_ExportDriver, GEOM_BaseDriver );
+
+class STEPPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ STEPPlugin_ExportDriver();
+ ~STEPPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( STEPPlugin_ExportDriver )
+};
+
+#endif // _STEPPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_GUI.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(STEPPlugin)
+
+//=======================================================================
+// function : STEPPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+STEPPlugin_GUI::STEPPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~STEPPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+STEPPlugin_GUI::~STEPPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool STEPPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_STEP"; break;
+ case 2:
+ cmd = "Import_STEP"; break;
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool STEPPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if ( theCommandID == "Export_STEP" )
+ {
+ result = exportSTEP( parent );
+ }
+ else if ( theCommandID == "Import_STEP" )
+ {
+ result = importSTEP( parent );
+ }
+ else
+ {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return result;
+}
+
+//=======================================================================
+// function : importSTEP
+// purpose :
+//=======================================================================
+bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
+{
+ 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::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
+ if ( CORBA::is_nil( stepOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "STEP_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+ SUIT_MessageBox::StandardButton stepAnswer = SUIT_MessageBox::NoButton;
+
+ for ( int i = 0; i < fileNames.count(); i++ )
+ {
+ QString fileName = fileNames.at( i );
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, stepOp.in() );
+ bool ignoreUnits = false;
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( SUIT_Tools::file( fileName, true ) ) );
+ transaction.start();
+
+ CORBA::String_var units = stepOp->ReadValue( fileName.toUtf8().constData(), "LEN_UNITS" );
+ QString unitsStr( units.in() );
+ bool unitsOK = unitsStr.isEmpty() || unitsStr == "M" || unitsStr.toLower() == "metre";
+
+ if ( !unitsOK )
+ {
+ if( stepAnswer == SUIT_MessageBox::NoToAll )
+ {
+ ignoreUnits = true;
+ }
+ else if( stepAnswer != SUIT_MessageBox::YesToAll )
+ {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel;
+ if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ stepAnswer = SUIT_MessageBox::question( parent,
+ tr( "WRN_WARNING" ),
+ tr( "SCALE_DIMENSIONS" ).arg( unitsStr ),
+ btns,
+ SUIT_MessageBox::No );
+ switch ( stepAnswer )
+ {
+ case SUIT_MessageBox::Cancel:
+ return true; // cancel (break) import operation
+ case SUIT_MessageBox::Yes:
+ case SUIT_MessageBox::YesToAll:
+ break; // scaling is confirmed
+ case SUIT_MessageBox::No:
+ case SUIT_MessageBox::NoAll:
+ ignoreUnits = true; // scaling is rejected
+ default:
+ break;
+ }
+ }
+ }
+
+ GEOM::ListOfGO_var result = stepOp->ImportSTEP( fileName.toUtf8().constData(), ignoreUnits );
+ if ( result->length() > 0 && stepOp->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() );
+
+ 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 );
+ }
+ transaction.commit();
+ GEOM_Displayer( study ).Display( main.in() );
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( stepOp->GetErrorCode() ) );
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ }
+ }
+
+ getGeometryGUI()->updateObjBrowser( true );
+ app->browseObjects( entryList );
+
+ if ( errors.count() > 0 )
+ {
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ }
+ return fileNames.count() > 0;
+}
+
+//=======================================================================
+// function : exportSTEP
+// purpose :
+//=======================================================================
+bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent )
+{
+ 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::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
+ if ( CORBA::is_nil( stepOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ QString fileName = app->getFileName( false,
+ QString( io->getName() ),
+ tr( "STEP_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, stepOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ stepOp->ExportSTEP( obj, fileName.toUtf8().constData() );
+
+ if ( stepOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stepOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new STEPPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef STEPPlugin_GUI_H
+#define STEPPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+class STEPPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ STEPPlugin_GUI( GeometryGUI* parent );
+ ~STEPPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importSTEP( SUIT_Desktop* );
+ bool exportSTEP( SUIT_Desktop* );
+};
+
+#endif // STEPPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_IECallBack.hxx"
+#include "STEPPlugin_IOperations.hxx"
+#include "STEPPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+STEPPlugin_IECallBack::STEPPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+STEPPlugin_IECallBack::~STEPPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool
+STEPPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ aPluginOperations->ExportSTEP( theOriginal, theFileName );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+STEPPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ bool anIsIgnoreUnits = ( theFormatName == "STEP_SCALE" ) ? true : false;
+ return aPluginOperations->ImportSTEP( theFileName, anIsIgnoreUnits );
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString
+STEPPlugin_IECallBack::ReadValue( int theDocId,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
+{
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ReadValue( theFileName, theParameterName );
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_IECallBack_HXX_
+#define _STEPPlugin_IECallBack_HXX_
+
+// internal includes
+#include "STEPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class STEPPLUGINENGINE_EXPORT STEPPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ STEPPlugin_IECallBack();
+ ~STEPPlugin_IECallBack();
+
+ bool Export( int theDocId,
+ 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 );
+
+ TCollection_AsciiString ReadValue( int theDocId,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_IExport_HXX_
+#define _STEPPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTSTEP_ARG_ORIGINAL 1
+#define EXPORTSTEP_ARG_FILENAME 2
+
+class STEPPlugin_IExport
+{
+public:
+ STEPPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTSTEP_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTSTEP_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTSTEP_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTSTEP_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _STEPPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_IImport_HXX_
+#define _STEPPlugin_IImport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTSTEP_ARG_FILENAME 1
+#define IMPORTSTEP_ARG_IGNORE_UNITS 2
+
+class STEPPlugin_IImport
+{
+public:
+ STEPPlugin_IImport( Handle(GEOM_Function) theFunction)
+ : _func(theFunction) {}
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( IMPORTSTEP_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( IMPORTSTEP_ARG_FILENAME ); }
+
+ void SetIsIgnoreUnits( bool theIsIgnoreUnits )
+ { _func->SetInteger( IMPORTSTEP_ARG_IGNORE_UNITS, int( theIsIgnoreUnits ) ); }
+ bool GetIsIgnoreUnits()
+ { return bool( _func->GetInteger( IMPORTSTEP_ARG_IGNORE_UNITS ) ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _STEPPlugin_IImport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_IOperations.hxx"
+#include "STEPPlugin_ExportDriver.hxx"
+#include "STEPPlugin_ImportDriver.hxx"
+#include "STEPPlugin_IExport.hxx"
+#include "STEPPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+STEPPlugin_IOperations::~STEPPlugin_IOperations()
+{
+ MESSAGE( "STEPPlugin_IOperations::~STEPPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportSTEP
+ * Export a shape to STEP format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ * \param theIsASCII The format of the exported file (ASCII or Binary)
+ * \param theDeflection The deflection of the shape to exported
+ */
+//=============================================================================
+void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ 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);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != STEPPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ STEPPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportSTEP(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\" )";
+
+ SetErrorCode(OK);
+}
+
+//=============================================================================
+/*!
+ * ImportSTEP
+ * Import a shape from STEP format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+STEPPlugin_IOperations::ImportSTEP( const TCollection_AsciiString& theFileName,
+ const bool theIsIgnoreUnits )
+{
+ SetErrorCode(KO);
+ if( theFileName.IsEmpty() ) return NULL;
+
+ //Add a new result object
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+
+ //Add an Import function
+ Handle(GEOM_Function) aFunction =
+ anImported->AddFunction( STEPPlugin_ImportDriver::GetID(), IMPORT_SHAPE);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != STEPPlugin_ImportDriver::GetID()) return NULL;
+
+ //Set parameters
+ STEPPlugin_IImport aCI( aFunction );
+ aCI.SetFileName( theFileName );
+ aCI.SetIsIgnoreUnits( theIsIgnoreUnits );
+
+ //Perform the Import
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Import driver failed" );
+ return NULL;
+ }
+ aSeq->Append(anImported);
+
+ // Greate material groups.
+ MakeMaterialGroups( anImported, aSeq );
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ if( theIsIgnoreUnits )
+ pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\", True)";
+ else
+ pd << aSeq << " = geompy.ImportSTEP(\"" << theFileName.ToCString() << "\")";
+ SetErrorCode(OK);
+
+ return aSeq;
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+TCollection_AsciiString
+STEPPlugin_IOperations::ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theParameterName )
+{
+ SetErrorCode(KO);
+
+ TCollection_AsciiString aValue, anError;
+
+ if (theFileName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
+
+ aValue = STEPPlugin_ImportDriver::GetValue( theFileName, theParameterName, anError );
+
+ if( aValue.IsEmpty() ) {
+ if( anError.IsEmpty() )
+ anError = theFileName + " doesn't contain requested parameter";
+ return aValue;
+ }
+ if (anError.IsEmpty())
+ SetErrorCode(OK);
+ else
+ SetErrorCode(anError.ToCString());
+
+ return aValue;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : STEPPlugin_IOperations.hxx
+
+#ifndef _STEPPlugin_IOperations_HXX_
+#define _STEPPlugin_IOperations_HXX_
+
+// internal includes
+#include "STEPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+
+class STEPPLUGINENGINE_EXPORT STEPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ STEPPlugin_IOperations( GEOM_Engine*, int );
+ ~STEPPlugin_IOperations();
+
+ void ExportSTEP( const Handle(GEOM_Object),
+ const TCollection_AsciiString& );
+
+ Handle(TColStd_HSequenceOfTransient) ImportSTEP( const TCollection_AsciiString&,
+ const bool );
+
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString&,
+ const TCollection_AsciiString& );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_IOperations_i.hh"
+#include "STEPPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+STEPPlugin_IOperations_i::STEPPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ STEPPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "STEPPlugin_IOperations_i::STEPPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+STEPPlugin_IOperations_i::~STEPPlugin_IOperations_i()
+{
+ MESSAGE( "STEPPlugin_IOperations_i::~STEPPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportSTEP
+ * Export a shape to STEP format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ */
+//=============================================================================
+void STEPPlugin_IOperations_i::ExportSTEP( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ //Export the shape to the file
+ GetOperations()->ExportSTEP( anOriginal, theFileName );
+}
+
+//=============================================================================
+/*!
+ * ImportSTEP
+ * Import a shape from STEP format
+ * \param theFileName The name of the file to import
+ * \param theIsIgnoreUnits If True, file length units will be ignored (set to 'meter')
+ * and result model will be scaled, if its units are not meters.
+ * If False (default), file length units will be taken into account.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* STEPPlugin_IOperations_i::ImportSTEP( const char* theFileName,
+ const bool theIsIgnoreUnits = false )
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Import the shape from the file
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportSTEP( theFileName, theIsIgnoreUnits );
+
+ if( !GetOperations()->IsDone() || aHSeq.IsNull() )
+ return aSeq._retn();
+
+ // Copy created objects.
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length( aLength );
+ for( Standard_Integer i = 1; i <= aLength; i++ )
+ aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
+
+ return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ * ReadValue
+ */
+//=============================================================================
+char* STEPPlugin_IOperations_i::ReadValue( const char* theFileName,
+ const char* theParameterName )
+{
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ TCollection_AsciiString aParam = GetOperations()->ReadValue( theFileName, theParameterName );
+
+ return CORBA::string_dup( aParam.ToCString() );
+}
+
+STEPPlugin_IOperations* STEPPlugin_IOperations_i::GetOperations()
+{
+ return (STEPPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_IOperations_i_HeaderFile
+#define _STEPPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( STEPPlugin )
+
+// internal includes
+#include "STEPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class STEPPlugin_IOperations;
+
+class STEPPLUGINENGINE_EXPORT STEPPlugin_IOperations_i :
+ public virtual POA_GEOM::ISTEPOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ STEPPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ STEPPlugin_IOperations* theImpl );
+ ~STEPPlugin_IOperations_i();
+
+ void ExportSTEP( GEOM::GEOM_Object_ptr, const char* );
+ GEOM::ListOfGO* ImportSTEP( const char*, const bool );
+ char* ReadValue( const char*, const char* );
+
+ STEPPlugin_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_ImportDriver.hxx"
+#include "STEPPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+#include "GEOMImpl_Types.hxx"
+
+// OOCT includes
+#include <TDF_ChildIDIterator.hxx>
+#include <TDF_Label.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Comment.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <Interface_Graph.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <Interface_Static.hxx>
+#include <STEPControl_Reader.hxx>
+#include <StepBasic_Product.hxx>
+#include <StepBasic_ProductDefinition.hxx>
+#include <StepBasic_ProductDefinitionFormation.hxx>
+#include <StepGeom_GeometricRepresentationItem.hxx>
+#include <StepShape_TopologicalRepresentationItem.hxx>
+#include <StepRepr_DescriptiveRepresentationItem.hxx>
+#include <StepRepr_ProductDefinitionShape.hxx>
+#include <StepRepr_PropertyDefinitionRepresentation.hxx>
+#include <StepRepr_Representation.hxx>
+#include <TransferBRep.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_WorkSession.hxx>
+#include <BRep_Builder.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TColStd_SequenceOfAsciiString.hxx>
+
+#include <StdFail_NotDone.hxx>
+#include <Standard_Failure.hxx>
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * GetShape()
+ */
+//=============================================================================
+
+TopoDS_Shape GetShape(const Handle(Standard_Transient) &theEnti,
+ const Handle(Transfer_TransientProcess) &theTP)
+{
+ TopoDS_Shape aResult;
+ Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
+
+ if (aBinder.IsNull()) {
+ return aResult;
+ }
+
+ aResult = TransferBRep::ShapeResult(aBinder);
+
+ return aResult;
+}
+
+//=============================================================================
+/*!
+ * GetLabel()
+ */
+//=============================================================================
+
+TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
+ const TDF_Label &theShapeLabel,
+ const TopoDS_Shape &aShape)
+{
+ TDF_Label aResult;
+
+ if (theEnti->IsKind
+ (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+ // check all named shapes using iterator
+ TDF_ChildIDIterator anIt
+ (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
+
+ for (; anIt.More(); anIt.Next()) {
+ Handle(TDataStd_Name) nameAttr =
+ Handle(TDataStd_Name)::DownCast(anIt.Value());
+
+ if (nameAttr.IsNull()) {
+ continue;
+ }
+
+ TDF_Label aLab = nameAttr->Label();
+ Handle(TNaming_NamedShape) shAttr;
+
+ if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
+ shAttr->Get().IsEqual(aShape)) {
+ aResult = aLab;
+ }
+ }
+ }
+
+ // create label and set shape
+ if (aResult.IsNull()) {
+ TDF_TagSource aTag;
+
+ aResult = aTag.NewChild(theShapeLabel);
+
+ TNaming_Builder tnBuild (aResult);
+
+ tnBuild.Generated(aShape);
+ }
+
+ return aResult;
+}
+
+//=============================================================================
+/*!
+ * StoreName()
+ */
+//=============================================================================
+
+void StoreName( const Handle(Standard_Transient) &theEnti,
+ const TopTools_IndexedMapOfShape &theIndices,
+ const Handle(Transfer_TransientProcess) &theTP,
+ const TDF_Label &theShapeLabel)
+{
+ Handle(TCollection_HAsciiString) aName;
+
+ if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
+ theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+ aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
+ } else {
+ Handle(StepBasic_ProductDefinition) PD =
+ Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
+
+ if (PD.IsNull() == Standard_False) {
+ Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
+ aName = Prod->Name();
+ }
+ }
+
+ bool isValidName = false;
+
+ if (aName.IsNull() == Standard_False) {
+ isValidName = true;
+
+ if (aName->UsefullLength() < 1) {
+ isValidName = false;
+ } else if (aName->UsefullLength() == 4 &&
+ toupper (aName->Value(1)) == 'N' &&
+ toupper (aName->Value(2)) == 'O' &&
+ toupper (aName->Value(3)) == 'N' &&
+ toupper (aName->Value(4)) == 'E') {
+ // skip 'N0NE' name
+ isValidName = false;
+ } else {
+ // special check to pass names like "Open CASCADE STEP translator 6.3 1"
+ TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
+
+ if (aName->Length() >= aSkipName.Length()) {
+ if (aName->String().SubString
+ (1, aSkipName.Length()).IsEqual(aSkipName)) {
+ isValidName = false;
+ }
+ }
+ }
+ }
+
+ if (isValidName) {
+ TCollection_ExtendedString aNameExt (aName->ToCString());
+
+ // find target shape
+ TopoDS_Shape S = GetShape(theEnti, theTP);
+
+ if (S.IsNull()) {
+ return;
+ }
+
+ // as PRODUCT can be included in the main shape
+ // several times, we look here for all iclusions.
+ Standard_Integer isub, nbSubs = theIndices.Extent();
+
+ for (isub = 1; isub <= nbSubs; isub++) {
+ TopoDS_Shape aSub = theIndices.FindKey(isub);
+
+ if (aSub.IsPartner(S)) {
+ TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
+
+ // set a name
+ TDataStd_Name::Set(L, aNameExt);
+ }
+ }
+ }
+}
+
+//=============================================================================
+/*!
+ * StoreMaterial()
+ */
+//=============================================================================
+
+void StoreMaterial( const Handle(Standard_Transient) &theEnti,
+ const TopTools_IndexedMapOfShape &theIndices,
+ const Handle(Transfer_TransientProcess) &theTP,
+ const TDF_Label &theShapeLabel )
+{
+ // Treat Product Definition Shape only.
+ Handle(StepRepr_ProductDefinitionShape) aPDS =
+ Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
+ Handle(StepBasic_ProductDefinition) aProdDef;
+
+ if(aPDS.IsNull() == Standard_False) {
+ // Product Definition Shape ==> Product Definition
+ aProdDef = aPDS->Definition().ProductDefinition();
+ }
+
+ if (aProdDef.IsNull() == Standard_False) {
+ // Product Definition ==> Property Definition
+ const Interface_Graph &aGraph = theTP->Graph();
+ Interface_EntityIterator aSubs = aGraph.Sharings(aProdDef);
+ TopoDS_Shape aShape;
+
+ for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
+ Handle(StepRepr_PropertyDefinition) aPropD =
+ Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
+
+ if(aPropD.IsNull() == Standard_False) {
+ // Property Definition ==> Representation.
+ Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
+
+ for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
+ Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
+ Handle(StepRepr_PropertyDefinitionRepresentation)::
+ DownCast(aSubs1.Value());
+
+ if(aPDR.IsNull() == Standard_False) {
+ // Property Definition ==> Material Name.
+ Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
+
+ if(aRepr.IsNull() == Standard_False) {
+ Standard_Integer ir;
+
+ for(ir = 1; ir <= aRepr->NbItems(); ir++) {
+ Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
+ Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
+ Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
+
+ if(aDRI.IsNull() == Standard_False) {
+ // Get shape from Product Definition
+ Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
+
+ if(aMatName.IsNull() == Standard_False) {
+ TCollection_ExtendedString
+ aMatNameExt (aMatName->ToCString());
+
+ if (aShape.IsNull()) {
+ // Get the shape.
+ aShape = GetShape(aProdDef, theTP);
+
+ if (aShape.IsNull()) {
+ return;
+ }
+ }
+
+ // as PRODUCT can be included in the main shape
+ // several times, we look here for all iclusions.
+ Standard_Integer isub, nbSubs = theIndices.Extent();
+
+ for (isub = 1; isub <= nbSubs; isub++) {
+ TopoDS_Shape aSub = theIndices.FindKey(isub);
+
+ if (aSub.IsPartner(aShape)) {
+ TDF_Label aLabel =
+ GetLabel(aProdDef, theShapeLabel, aSub);
+
+ // set a name
+ TDataStd_Comment::Set(aLabel, aMatNameExt);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& STEPPlugin_ImportDriver::GetID()
+{
+ static Standard_GUID aGUID("a25f88df-461b-45c0-ab6b-a82101fe6ce7");
+ return aGUID;
+}
+
+//=======================================================================
+//function : STEPPlugin_ImportDriver
+//purpose :
+//=======================================================================
+STEPPlugin_ImportDriver::STEPPlugin_ImportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer STEPPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ STEPPlugin_IImport aData( aFunction );
+
+ TCollection_AsciiString aFileName = aData.GetFileName().ToCString();
+ bool anIsIgnoreUnits = aData.GetIsIgnoreUnits();
+ TDF_Label aShapeLabel = aFunction->GetNamingEntry();
+
+ MESSAGE("Import STEP from file " << aFileName.ToCString() );
+
+ TopoDS_Shape aResShape;
+ TCollection_AsciiString anError;
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ STEPControl_Reader aReader;
+
+ //VSR: 16/09/09: Convert to METERS
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetIVal("read.step.ideas", 1);
+ Interface_Static::SetIVal("read.step.nonmanifold", 1);
+
+ BRep_Builder B;
+ TopoDS_Compound compound;
+ B.MakeCompound(compound);
+
+ try
+ {
+ OCC_CATCH_SIGNALS;
+ IFSelect_ReturnStatus status = aReader.ReadFile(aFileName.ToCString());
+ if (status == IFSelect_RetDone) {
+ // Regard or not the model units
+ if( anIsIgnoreUnits ) {
+ // set UnitFlag to units from file
+ TColStd_SequenceOfAsciiString anUnitLengthNames;
+ TColStd_SequenceOfAsciiString anUnitAngleNames;
+ TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
+ aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
+ if (anUnitLengthNames.Length() > 0) {
+ TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
+ if (aLenUnits == "millimetre")
+ Interface_Static::SetCVal("xstep.cascade.unit", "MM");
+ else if (aLenUnits == "centimetre")
+ Interface_Static::SetCVal("xstep.cascade.unit", "CM");
+ else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
+ Interface_Static::SetCVal("xstep.cascade.unit", "M");
+ else if (aLenUnits == "INCH")
+ Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
+ else {
+ anError = "The file contains not supported units.";
+ }
+ // TODO (for other units than mm, cm, m or inch)
+ // else if (aLenUnits == "")
+ // Interface_Static::SetCVal("xstep.cascade.unit", "???");
+ }
+ }
+ else {
+ // Need re-scale a model (set UnitFlag to 'meter')
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ }
+
+ Standard_Boolean failsonly = Standard_False;
+ aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity);
+
+ // Root transfers
+ Standard_Integer nbr = aReader.NbRootsForTransfer();
+ aReader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity);
+
+ for (Standard_Integer n = 1; n <= nbr; n++) {
+ Standard_Boolean ok = aReader.TransferRoot(n);
+ // Collecting resulting entities
+ Standard_Integer nbs = aReader.NbShapes();
+ if (!ok || nbs == 0)
+ continue; // skip empty root
+
+ // For a single entity
+ else if (nbr == 1 && nbs == 1) {
+ aResShape = aReader.Shape(1);
+ if (aResShape.ShapeType() == TopAbs_COMPOUND) {
+ int nbSub1 = 0;
+ TopoDS_Shape currShape;
+ TopoDS_Iterator It (aResShape, Standard_True, Standard_True);
+ for (; It.More(); It.Next()) {
+ nbSub1++;
+ currShape = It.Value();
+ }
+ if (nbSub1 == 1)
+ aResShape = currShape;
+ }
+ break;
+ }
+
+ for (Standard_Integer i = 1; i <= nbs; i++) {
+ TopoDS_Shape aShape = aReader.Shape(i);
+ if (aShape.IsNull())
+ continue;
+ else
+ B.Add(compound, aShape);
+ }
+ }
+ if( aResShape.IsNull() )
+ aResShape = compound;
+
+ // Check if any BRep entity has been read, there must be at least a vertex
+ if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() )
+ anError = "No geometrical data in the imported file.";
+
+ // BEGIN: Store names and materials of sub-shapes from file
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aResShape, anIndices);
+
+ Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
+ Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
+ if (!TR.IsNull()) {
+ Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
+
+ Standard_Integer nb = Model->NbEntities();
+
+ for (Standard_Integer ie = 1; ie <= nb; ie++) {
+ Handle(Standard_Transient) enti = Model->Value(ie);
+
+ // Store names.
+ StoreName(enti, anIndices, TP, aShapeLabel);
+
+ // Store materials.
+ StoreMaterial(enti, anIndices, TP, aShapeLabel);
+ }
+ }
+ // END: Store names and materials
+ }
+ else {
+ switch (status) {
+ case IFSelect_RetVoid:
+ anError = "Nothing created or No data to process";
+ break;
+ case IFSelect_RetError:
+ anError = "Error in command or input data";
+ break;
+ case IFSelect_RetFail:
+ anError = "Execution was run, but has failed";
+ break;
+ case IFSelect_RetStop:
+ anError = "Execution has been stopped. Quite possible, an exception was raised";
+ break;
+ default:
+ break;
+ }
+ anError = "Wrong format of the imported file. Can't import file.";
+ aResShape.Nullify();
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ anError = aFail->GetMessageString();
+ aResShape.Nullify();
+ }
+
+ if( aResShape.IsNull() ) {
+ StdFail_NotDone::Raise( anError.ToCString() );
+ return 0;
+ }
+
+ aFunction->SetValue( aResShape );
+
+ log.SetTouched( Label() );
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean STEPPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool STEPPlugin_ImportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction( Label() );
+
+ STEPPlugin_IImport aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "ImportSTEP";
+
+ switch ( aType ) {
+ case IMPORT_SHAPE:
+ AddParam( theParams, "File name", aCI.GetFileName() );
+ if( aCI.GetIsIgnoreUnits() )
+ AddParam( theParams, "Format", "STEP_SCALE" );
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+TCollection_AsciiString
+STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theParameterName,
+ TCollection_AsciiString& theError )
+{
+ Handle(TCollection_HAsciiString) aValue;
+
+ if (theParameterName != "LEN_UNITS") {
+ theError = theParameterName + " parameter reading is not supported by STEP plugin";
+ return TCollection_AsciiString();
+ }
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ STEPControl_Reader aReader;
+
+ Interface_Static::SetCVal( "xstep.cascade.unit","M" );
+ Interface_Static::SetIVal( "read.step.ideas", 1 );
+ Interface_Static::SetIVal( "read.step.nonmanifold", 1 );
+
+ try {
+ OCC_CATCH_SIGNALS;
+ IFSelect_ReturnStatus status = aReader.ReadFile( theFileName.ToCString() );
+ if (status == IFSelect_RetDone) {
+ TColStd_SequenceOfAsciiString anUnitLengthNames;
+ TColStd_SequenceOfAsciiString anUnitAngleNames;
+ TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
+ aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
+ if (anUnitLengthNames.Length() > 0) {
+ aValue = new TCollection_HAsciiString( anUnitLengthNames.First() );
+ /*
+ TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
+ if (aLenUnits == "millimetre")
+ aValue = new TCollection_HAsciiString ("MM");
+ else if (aLenUnits == "centimetre")
+ aValue = new TCollection_HAsciiString ("CM");
+ else if (aLenUnits == "metre")
+ aValue = new TCollection_HAsciiString ("M");
+ else if (aLenUnits == "INCH")
+ aValue = new TCollection_HAsciiString ("INCH");
+ // TODO (for other units than mm, cm, m or inch)
+ //else if (aLenUnits == "")
+ // aValue = new TCollection_HAsciiString ("");
+ */
+ }
+ }
+ else {
+ theError = theFileName + " reading failed";
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ theError = aFail->GetMessageString();
+ }
+ if (!aValue.IsNull())
+ return aValue->String();
+ else
+ return TCollection_AsciiString();
+}
+
+
+IMPLEMENT_STANDARD_HANDLE( STEPPlugin_ImportDriver, GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( STEPPlugin_ImportDriver, GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STEPPlugin_ImportDriver_HXX
+#define _STEPPlugin_ImportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( STEPPlugin_ImportDriver, GEOM_BaseDriver );
+
+class STEPPlugin_ImportDriver : public GEOM_BaseDriver
+{
+public:
+ STEPPlugin_ImportDriver();
+ ~STEPPlugin_ImportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+ static
+ TCollection_AsciiString GetValue( const TCollection_AsciiString&,
+ const TCollection_AsciiString&,
+ TCollection_AsciiString& );
+
+DEFINE_STANDARD_RTTI( STEPPlugin_ImportDriver )
+};
+
+#endif // _STEPPlugin_ImportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STEPPlugin_OperationsCreator.hxx"
+#include "STEPPlugin_IOperations_i.hh"
+#include "STEPPlugin_IOperations.hxx"
+#include "STEPPlugin_ExportDriver.hxx"
+#include "STEPPlugin_ImportDriver.hxx"
+#include "STEPPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, STEPPlugin_IOperations*> STEPPlugin_OperationsCreator::_mapOfOperations;
+
+STEPPlugin_OperationsCreator::STEPPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( STEPPlugin_ExportDriver::GetID(),
+ new STEPPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( STEPPlugin_ImportDriver::GetID(),
+ new STEPPlugin_ImportDriver() );
+
+ // Register callback
+ STEPPlugin_IECallBack* callback = new STEPPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "STEP", callback );
+ GEOMImpl_IECallBack::Register( "STEP_SCALE", callback );
+}
+
+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 ) );
+}
+
+STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new STEPPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_STEPPlugin_OperationsCreator_HXX_
+#define _GEOM_STEPPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "STEPPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class STEPPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class STEPPLUGINENGINE_EXPORT STEPPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ STEPPlugin_OperationsCreator();
+ ~STEPPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+
+private:
+ static STEPPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, STEPPlugin_IOperations*> _mapOfOperations;
+
+ friend class STEPPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTEP</source>
+ <translation>STEP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTEP</source>
+ <translation>Export STEP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTEP</source>
+ <translation>Export STEP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTEP</source>
+ <translation>STEP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTEP</source>
+ <translation>Import STEP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTEP</source>
+ <translation>Import STEP</translation>
+ </message>
+</context>
+<context>
+ <name>STEPPlugin_GUI</name>
+ <message>
+ <source>STEP_FILES</source>
+ <translation>STEP Files ( *.step *.stp )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export STEP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import STEP</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>Take into account the units (%1) embedded to the file?
+Ignoring units will cause model scaling (as dimensions are supposed to be specified in meters).</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTEP</source>
+ <translation>STEP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTEP</source>
+ <translation>Exporter STEP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTEP</source>
+ <translation>Exporter STEP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTEP</source>
+ <translation>STEP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTEP</source>
+ <translation>Importer STEP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTEP</source>
+ <translation>Importer STEP</translation>
+ </message>
+</context>
+<context>
+ <name>STEPPlugin_GUI</name>
+ <message>
+ <source>STEP_FILES</source>
+ <translation>STEP Fichiers ( *.step *.stp )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter STEP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer STEP</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>Voulez-vous prendre les unités du fichier (%1) en considération?
+Sinon le modèle sera mis à l'échelle GEOM (unités interprétées comme des mètres).</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTEP</source>
+ <translation type="unfinished">STEP</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTEP</source>
+ <translation type="unfinished">Export STEP</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTEP</source>
+ <translation type="unfinished">Export STEP</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTEP</source>
+ <translation type="unfinished">STEP</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTEP</source>
+ <translation type="unfinished">Import STEP</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTEP</source>
+ <translation type="unfinished">Import STEP</translation>
+ </message>
+</context>
+<context>
+ <name>STEPPlugin_GUI</name>
+ <message>
+ <source>STEP_FILES</source>
+ <translation type="unfinished">STEP Files ( *.step *.stp )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export STEP</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation type="unfinished">Import STEP</translation>
+ </message>
+ <message>
+ <source>SCALE_DIMENSIONS</source>
+ <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+ </message>
+</context>
+</TS>
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKSTL}
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(STLExport_SOURCES
- STLExport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(STLExport ${STLExport_SOURCES})
-TARGET_LINK_LIBRARIES(STLExport ${_link_LIBRARIES})
-INSTALL(TARGETS STLExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: STLExport.cxx
-// Created: Wed May 19 14:53:52 2004
-// Author: Pavel TELKOV
-// <ptv@mutex.nnov.opencascade.com>
-//
-#include "utilities.h"
-
-#include <StlAPI_Writer.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-
-#ifdef WIN32
-# if defined STLEXPORT_EXPORTS || defined STLExport_EXPORTS
-# define STLEXPORT_EXPORT __declspec( dllexport )
-# else
-# define STLEXPORT_EXPORT __declspec( dllimport )
-# endif
-#else
-# define STLEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- STLEXPORT_EXPORT
- int Export(const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
- {
- MESSAGE("Export STL into file " << theFileName.ToCString());
-
- try
- {
- StlAPI_Writer aWriter;
- bool aIsASCIIMode;
- aIsASCIIMode = (theFormatName.IsEqual("STL_ASCII")) ? true : false;
- aWriter.ASCIIMode() = aIsASCIIMode;
- aWriter.Write(theShape, theFileName.ToCString()) ;
- return 1;
- }
- catch(Standard_Failure)
- {
- //THROW_SALOME_CORBA_EXCEPTION("Exception catched in STLExport", SALOME::BAD_PARAM);
- }
- return 0;
- }
-}
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- ${CAS_TKSTL}
- ${KERNEL_SALOMELocalTrace}
- ${CAS_TKTopAlgo}
- ${CAS_TKBRep}
- ${CAS_TKG3d}
- )
-
-# --- sources ---
-
-SET(STLImport_SOURCES
- STLImport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(STLImport ${STLImport_SOURCES})
-TARGET_LINK_LIBRARIES(STLImport ${_link_LIBRARIES})
-INSTALL(TARGETS STLImport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: STLImport.cxx
-// Author: Sergey KHROMOV
-
-
-#include "utilities.h"
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepClass3d_SolidClassifier.hxx>
-#include <Precision.hxx>
-#include <StlAPI_Reader.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TDF_Label.hxx>
-
-
-#ifdef WIN32
- #if defined STLIMPORT_EXPORTS || defined STLImport_EXPORTS
- #define STLIMPORT_EXPORT __declspec( dllexport )
- #else
- #define STLIMPORT_EXPORT __declspec( dllimport )
- #endif
-#else
- #define STLIMPORT_EXPORT
-#endif
-
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
-STLIMPORT_EXPORT
- TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/,
- TCollection_AsciiString& theError,
- const TDF_Label&)
- {
- MESSAGE("Import STL from file " << theFileName.ToCString());
-
- StlAPI_Reader aReader;
- TopoDS_Shape aShape;
-
- aReader.Read(aShape, theFileName.ToCString());
-
- if (aShape.IsNull()) {
- theError = "STL Import failed";
- } else {
- // Fix the orientation of closed shell or solid.
- if (BRep_Tool::IsClosed(aShape)) {
- TopAbs_ShapeEnum aType = aShape.ShapeType();
-
- if (aType == TopAbs_SHELL || aType == TopAbs_SOLID) {
- TopoDS_Solid aSolid;
-
- if (aType == TopAbs_SHELL) {
- // Create a solid.
- BRep_Builder aBuilder;
-
- aBuilder.MakeSolid(aSolid);
- aBuilder.Add(aSolid, aShape);
- } else {
- aSolid = TopoDS::Solid(aShape);
- }
-
- // Classify infinite point against solid.
- BRepClass3d_SolidClassifier aClassifier(aSolid);
-
- aClassifier.PerformInfinitePoint(Precision::Confusion());
-
- if (aClassifier.State() == TopAbs_IN) {
- // The shape is inverted. Reverse it.
- aShape.Reverse();
- }
- }
- }
- }
-
- return aShape;
- }
-}
--- /dev/null
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKSTL}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLSTLPlugin
+ GEOMEngine
+ GEOMClient
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLSTLPlugin
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(STLPluginEngine_HEADERS
+ STLPlugin_IOperations_i.hh
+ STLPlugin_Engine.hxx
+ STLPlugin_OperationsCreator.hxx
+ STLPlugin_IOperations.hxx
+ STLPlugin_IExport.hxx
+ STLPlugin_IImport.hxx
+ STLPlugin_ImportDriver.hxx
+ STLPlugin_ExportDriver.hxx
+ STLPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ STLPlugin_GUI.h
+ STLPlugin_ExportDlg.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(STLPluginGUI_SOURCES
+ STLPlugin_GUI.cxx
+ STLPlugin_ExportDlg.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(STLPluginEngine_SOURCES
+ STLPlugin_Engine.cxx
+ STLPlugin_OperationsCreator.cxx
+ STLPlugin_IOperations_i.cc
+ STLPlugin_IOperations.cxx
+ STLPlugin_ExportDriver.cxx
+ STLPlugin_ImportDriver.cxx
+ STLPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(STLPlugin_RESOURCES
+ STLPlugin_msg_en.ts
+ STLPlugin_msg_fr.ts
+ STLPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(STLPluginEngine ${STLPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(STLPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS STLPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(STLPluginGUI ${STLPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(STLPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS STLPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${STLPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${STLPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_Engine.hxx"
+#include "STLPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ STLPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new STLPlugin_OperationsCreator();
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPLUGIN_ENGINE_HXX_
+#define _STLPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined STLPLUGINENGINE_EXPORTS || defined STLPluginEngine_EXPORTS
+ #define STLPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define STLPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define STLPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_ExportDlg.h"
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Study.h>
+
+// GEOM includes
+#include "GEOMBase.h"
+#include "GEOM_Constants.h"
+
+// OCC includes
+#include <BRepBndLib.hxx>
+
+// QT includes
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+#include <QComboBox>
+#include <QCheckBox>
+
+//=================================================================================
+// Constructor
+//=================================================================================
+STLPlugin_ExportDlg::STLPlugin_ExportDlg( const Handle(SALOME_InteractiveObject)& io, QWidget* parent )
+: SUIT_FileDlg( parent, false, true, true )
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ QLabel* deflectionLabel = new QLabel( tr( "DEFLECTION" ), this );
+
+ QWidget* options = new QWidget( this );
+ QHBoxLayout* optionsLayout = new QHBoxLayout( options );
+ optionsLayout->setMargin( 0 );
+ optionsLayout->setSpacing( 5 );
+
+ myDeflectionSB = new SalomeApp_DoubleSpinBox( options );
+ int aPrecision = resMgr->integerValue( "Geometry", "parametric_precision", 6 );
+ myDeflectionSB->setAcceptNames( false );
+ myDeflectionSB->setPrecision( aPrecision );
+ myDeflectionSB->setDecimals( aPrecision );
+ myDeflectionSB->setRange( GEOM::minDeflection(), 1.0 );
+ myDeflectionSB->setSingleStep( 1.0e-04 );
+
+ myModeCB = new QCheckBox( tr( "RELATIVE" ), options );
+
+ myFormatCB = new QCheckBox( tr( "ASCII" ) );
+
+ optionsLayout->addWidget( myDeflectionSB );
+ optionsLayout->addWidget( myModeCB );
+ optionsLayout->addWidget( myFormatCB );
+
+ layout()->addWidget( deflectionLabel );
+ layout()->addWidget( options );
+
+ myShapeSize = getShapeSize( io );
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Study* study = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+ int mgrId = app->activeViewManager()->getGlobalId();
+ QVariant v = study->getObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::Deflection ), QVariant() );
+ double deflection = v.isValid() ? v.toDouble() : SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "deflection_coef", 0.001 );
+
+ myDeflectionSB->setValue( deflection );
+ myModeCB->setChecked( true );
+ myFormatCB->setChecked( true );
+
+ connect( myModeCB, SIGNAL( clicked ( bool ) ), this, SLOT( modeChanged() ) );
+}
+
+//=================================================================================
+// Destructor
+//=================================================================================
+STLPlugin_ExportDlg::~STLPlugin_ExportDlg()
+{
+}
+
+//=================================================================================
+// modeChanged
+//=================================================================================
+void STLPlugin_ExportDlg::modeChanged()
+{
+ if ( myModeCB->isChecked() ) {
+ double deflection = myDeflectionSB->value() / myShapeSize;
+ deflection = ( deflection > 1.0 ) ? 1.0 : deflection;
+ myDeflectionSB->setRange( GEOM::minDeflection(), 1.0 );
+ myDeflectionSB->setValue( deflection );
+ }
+ else {
+ double deflection = myDeflectionSB->value() * myShapeSize;
+ myDeflectionSB->setRange( GEOM::minDeflection(), 10000.0 );
+ myDeflectionSB->setValue( deflection );
+ }
+}
+
+//=================================================================================
+// getShapeSize
+//=================================================================================
+double STLPlugin_ExportDlg::getShapeSize( const Handle(SALOME_InteractiveObject)& io )
+{
+ TopoDS_Shape shape;
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+ GEOMBase::GetShape( obj, shape, TopAbs_SHAPE );
+ Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
+ Bnd_Box bnd;
+ BRepBndLib::Add( shape, bnd );
+ bnd.Get( xmin, ymin, zmin, xmax, ymax, zmax );
+ double xd = fabs( xmax-xmin );
+ double yd = fabs( ymax-ymin );
+ double zd = fabs( zmax-zmin );
+ return std::max( std::max ( xd, yd ), zd );
+}
+
+//=================================================================================
+// isAscii
+//=================================================================================
+bool STLPlugin_ExportDlg::isAscii() const
+{
+ return myFormatCB->isChecked();
+}
+
+//=================================================================================
+// getDeflection
+//=================================================================================
+double STLPlugin_ExportDlg::getDeflection() const
+{
+ return myDeflectionSB->value();
+}
+
+//=================================================================================
+// isDeflectionRelative
+//=================================================================================
+bool STLPlugin_ExportDlg::isDeflectionRelative() const
+{
+ return myModeCB->isChecked();
+}
+
+//=================================================================================
+// getFileName
+//=================================================================================
+QString STLPlugin_ExportDlg::getFileName( const Handle(SALOME_InteractiveObject)& io,
+ const QString& filters, const QString& caption,
+ QWidget* parent, bool& isAscii,
+ double& deflection, bool& isRelative )
+{
+ QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
+
+ QString tmpfilename = io->getName();
+ tmpfilename = tmpfilename.simplified();
+ tmpfilename = tmpfilename.replace( QRegExp( "\\*" ), "" ).replace( QRegExp( "\\?" ), "" );
+
+ STLPlugin_ExportDlg fd( io, parent );
+ fd.setFileMode( AnyFile );
+ fd.setFilters( fls );
+ fd.setWindowTitle( caption );
+ if ( !tmpfilename.isEmpty() )
+ fd.processPath( tmpfilename );
+
+ QString filename;
+
+ if ( fd.exec() == QDialog::Accepted ) {
+ filename = fd.selectedFile();
+ isAscii = fd.isAscii();
+ deflection = fd.getDeflection();
+ isRelative = fd.isDeflectionRelative();
+ }
+
+ QApplication::processEvents();
+
+ return filename;
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef STLPlugin_ExportDlg_H
+#define STLPlugin_ExportDlg_H
+
+#include <SUIT_FileDlg.h>
+#include <SALOME_InteractiveObject.hxx>
+
+class QCheckBox;
+class SalomeApp_DoubleSpinBox;
+
+class STLPlugin_ExportDlg: public SUIT_FileDlg
+{
+ Q_OBJECT
+
+public:
+ STLPlugin_ExportDlg( const Handle(SALOME_InteractiveObject)& io, QWidget* parent );
+ ~STLPlugin_ExportDlg();
+
+ bool isAscii() const;
+ double getDeflection() const;
+ bool isDeflectionRelative() const;
+
+ static QString getFileName( const Handle(SALOME_InteractiveObject)& io,
+ const QString& filters,
+ const QString& caption,
+ QWidget* parent,
+ bool& isAscii,
+ double& deflection,
+ bool& isRelative );
+
+private slots:
+ void modeChanged();
+
+private:
+ static double getShapeSize( const Handle(SALOME_InteractiveObject)& io );
+
+private:
+ SalomeApp_DoubleSpinBox* myDeflectionSB;
+ QCheckBox* myModeCB;
+ QCheckBox* myFormatCB;
+ double myShapeSize;
+};
+
+#endif // STLPlugin_ExportDlg_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_ExportDriver.hxx"
+#include "STLPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+
+// OOCT includes
+#include <BRepBuilderAPI_Copy.hxx>
+#include <StlAPI_Writer.hxx>
+#include <TopoDS_Shape.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& STLPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("88678a6a-885c-477c-b90b-51934572c61d");
+ return aGUID;
+}
+
+//=======================================================================
+//function : STLPlugin_ExportDriver
+//purpose :
+//=======================================================================
+STLPlugin_ExportDriver::STLPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer STLPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ STLPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+ double aDeflection = aData.GetDeflection();
+ bool anIsASCII = aData.GetIsASCII();
+ bool anIsRelative = aData.GetIsRelative();
+
+ MESSAGE( "Export STL into file " << aFileName );
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ try
+ {
+ StlAPI_Writer aWriter;
+ // set relative mode on false for using custom deflection coefficient
+ aWriter.RelativeMode( ) = anIsRelative;
+ aWriter.ASCIIMode() = anIsASCII;
+ if( anIsRelative )
+ aWriter.SetCoefficient( aDeflection );
+ else
+ aWriter.SetDeflection( aDeflection );
+ BRepBuilderAPI_Copy aCopy( aShape, Standard_False );
+ aWriter.Write( aCopy.Shape(), aFileName.ToCString() );
+ log.SetTouched( Label() );
+ return 1;
+ }
+ catch( Standard_Failure )
+ {
+ //THROW_SALOME_CORBA_EXCEPTION("Exception catched in ExportSTL", SALOME::BAD_PARAM);
+ }
+ return 0;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean STLPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool STLPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( STLPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( STLPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_ExportDriver_HXX
+#define _STLPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( STLPlugin_ExportDriver, GEOM_BaseDriver );
+
+class STLPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ STLPlugin_ExportDriver();
+ ~STLPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( STLPlugin_ExportDriver )
+};
+
+#endif // _STLPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_GUI.h"
+#include "STLPlugin_ExportDlg.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(STLPlugin)
+
+//=======================================================================
+// function : STLPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+STLPlugin_GUI::STLPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~STLPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+STLPlugin_GUI::~STLPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool STLPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_STL"; break;
+ case 2:
+ cmd = "Import_STL"; break;
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool STLPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if( theCommandID == "Export_STL" ) {
+ result = exportSTL( parent );
+ }
+ else if (theCommandID == "Import_STL") {
+ result = importSTL( parent );
+ }
+ else {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return true;
+}
+
+//=======================================================================
+// function : importSTL
+// purpose :
+//=======================================================================
+bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
+{
+ 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::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
+ if ( CORBA::is_nil( stlOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "STL_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+
+ foreach( QString fileName, fileNames )
+ {
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, stlOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
+ transaction.start();
+ GEOM::ListOfGO_var result = stlOp->ImportSTL( fileName.toUtf8().constData() );
+ if ( result->length() > 0 && stlOp->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() );
+
+ entryList.append( so->GetID() );
+ transaction.commit();
+ GEOM_Displayer( study ).Display( main.in() );
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( stlOp->GetErrorCode() ) );
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ }
+ }
+ getGeometryGUI()->updateObjBrowser( true );
+ app->browseObjects( entryList );
+
+ if ( errors.count() > 0 )
+ {
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ }
+ }
+ return fileNames.count() > 0;
+}
+
+//=======================================================================
+// function : exportSTL
+// purpose :
+//=======================================================================
+bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
+{
+ 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::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
+ if ( CORBA::is_nil( stlOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ bool isASCII = false;
+ double deflection = 0.;
+ bool isRelative = false;
+ QString fileName = STLPlugin_ExportDlg::getFileName( io,
+ tr( "STL_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent,
+ isASCII,
+ deflection,
+ isRelative );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, stlOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ stlOp->ExportSTL( obj, fileName.toUtf8().constData(), isASCII, deflection, isRelative );
+
+ if ( stlOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stlOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new STLPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef STLPlugin_GUI_H
+#define STLPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+class STLPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ STLPlugin_GUI( GeometryGUI* parent );
+ ~STLPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importSTL( SUIT_Desktop* );
+ bool exportSTL( SUIT_Desktop* );
+};
+
+#endif // STLPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_IECallBack.hxx"
+#include "STLPlugin_IOperations.hxx"
+#include "STLPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+STLPlugin_IECallBack::STLPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+STLPlugin_IECallBack::~STLPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool
+STLPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ bool anIsASCII = ( theFormatName == "STL_Bin") ? false : true;
+ const double aDeflection = 0.001;
+ const bool anIsRelative = true;
+ aPluginOperations->ExportSTL( theOriginal, theFileName, anIsASCII, aDeflection, anIsRelative );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+STLPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ImportSTL( theFileName );
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_IECallBack_HXX_
+#define _STLPlugin_IECallBack_HXX_
+
+// internal includes
+#include "STLPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class STLPLUGINENGINE_EXPORT STLPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ STLPlugin_IECallBack();
+ ~STLPlugin_IECallBack();
+
+ virtual bool Export( int theDocId,
+ 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 );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_IExport_HXX_
+#define _STLPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTSTL_ARG_ORIGINAL 1
+#define EXPORTSTL_ARG_FILENAME 2
+#define EXPORTSTL_ARG_DEFLECTION 3
+#define EXPORTSTL_ARG_ISASCII 4
+#define EXPORTSTL_ARG_ISRELATIVE 5
+
+class STLPlugin_IExport
+{
+public:
+ STLPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTSTL_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTSTL_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTSTL_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTSTL_ARG_FILENAME ); }
+
+ void SetIsASCII( bool theIsASCII )
+ { _func->SetInteger( EXPORTSTL_ARG_ISASCII, int( theIsASCII ) ); }
+ bool GetIsASCII()
+ { return bool( _func->GetInteger( EXPORTSTL_ARG_ISASCII ) ); }
+
+ void SetIsRelative( bool theIsRelative )
+ { _func->SetInteger( EXPORTSTL_ARG_ISRELATIVE, int( theIsRelative ) ); }
+ bool GetIsRelative()
+ { return bool( _func->GetInteger( EXPORTSTL_ARG_ISRELATIVE ) ); }
+
+ void SetDeflection( double theDeflection )
+ { _func->SetReal( EXPORTSTL_ARG_DEFLECTION, theDeflection ); }
+ double GetDeflection()
+ { return _func->GetReal( EXPORTSTL_ARG_DEFLECTION ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _STLPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_IImport_HXX_
+#define _STLPlugin_IImport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTSTL_ARG_FILENAME 1
+
+class STLPlugin_IImport
+{
+public:
+ STLPlugin_IImport( Handle(GEOM_Function) theFunction)
+ : _func(theFunction) {}
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( IMPORTSTL_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( IMPORTSTL_ARG_FILENAME ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _STLPlugin_IImport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_IOperations.hxx"
+#include "STLPlugin_ExportDriver.hxx"
+#include "STLPlugin_ImportDriver.hxx"
+#include "STLPlugin_IExport.hxx"
+#include "STLPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "STLPlugin_IOperations::STLPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+STLPlugin_IOperations::~STLPlugin_IOperations()
+{
+ MESSAGE( "STLPlugin_IOperations::~STLPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportSTL
+ * Export a shape to STL format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ * \param theIsASCII The format of the exported file (ASCII or Binary)
+ * \param theDeflection The deflection of the shape to exported
+ * \param theIsRelative The mode for writing the file. If True (default value),
+ * the deflection is calculated relatively to the size of the shape;
+ * if False, the user defined deflection is used.
+ */
+//=============================================================================
+void STLPlugin_IOperations::ExportSTL( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const bool theIsASCII,
+ const double theDeflection,
+ const bool theIsRelative )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ 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);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( STLPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != STLPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ STLPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+ aCI.SetIsASCII( theIsASCII );
+ aCI.SetIsRelative( theIsRelative );
+ aCI.SetDeflection( theDeflection );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportSTL(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\", " << theIsASCII << ", " << theDeflection << ", "
+ << theIsRelative << ")";
+
+ SetErrorCode(OK);
+}
+
+//=============================================================================
+/*!
+ * ImportSTL
+ * Import a shape from STL format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+STLPlugin_IOperations::ImportSTL( const TCollection_AsciiString& theFileName )
+{
+ SetErrorCode(KO);
+ if( theFileName.IsEmpty() ) return NULL;
+
+ //Add a new result object
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+
+ //Add an Import function
+ Handle(GEOM_Function) aFunction =
+ anImported->AddFunction( STLPlugin_ImportDriver::GetID(), IMPORT_SHAPE);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != STLPlugin_ImportDriver::GetID()) return NULL;
+
+ //Set parameters
+ STLPlugin_IImport aCI( aFunction );
+ aCI.SetFileName( theFileName );
+
+ //Perform the Import
+ Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Import driver failed" );
+ return NULL;
+ }
+ aSeq->Append(anImported);
+
+ // Greate material groups.
+ // MakeMaterialGroups( anImported, aSeq );
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump pd (aFunction);
+ pd << aSeq << " = geompy.ImportSTL(\"" << theFileName.ToCString() << "\" )";
+ SetErrorCode(OK);
+
+ return aSeq;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : STLPlugin_IOperations.hxx
+
+#ifndef _STLPlugin_IOperations_HXX_
+#define _STLPlugin_IOperations_HXX_
+
+// internal includes
+#include "STLPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+
+class STLPLUGINENGINE_EXPORT STLPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ STLPlugin_IOperations( GEOM_Engine*, int );
+ ~STLPlugin_IOperations();
+
+ void ExportSTL( const Handle(GEOM_Object),
+ const TCollection_AsciiString&,
+ const bool,
+ const double,
+ const bool );
+
+ Handle(TColStd_HSequenceOfTransient)
+ ImportSTL( const TCollection_AsciiString& );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_IOperations_i.hh"
+#include "STLPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+STLPlugin_IOperations_i::STLPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ STLPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "STLPlugin_IOperations_i::STLPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+STLPlugin_IOperations_i::~STLPlugin_IOperations_i()
+{
+ MESSAGE( "STLPlugin_IOperations_i::~STLPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportSTL
+ * Export a shape to STL format
+ * \param theOriginal The shape to export
+ * \param theIsASCII The format of the exported file (ASCII or Binary)
+ * \param theFileName The name of the exported file
+ * \param theDeflection The deflection of the exported shape
+ */
+//=============================================================================
+void STLPlugin_IOperations_i::ExportSTL( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName,
+ const bool theIsASCII,
+ const double theDeflection,
+ const bool theIsRelative )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ GetOperations()->ExportSTL( anOriginal, theFileName, theIsASCII, theDeflection, theIsRelative );
+}
+
+//=============================================================================
+/*!
+ * ImportSTL
+ * Import a shape from STL format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* STLPlugin_IOperations_i::ImportSTL( const char* theFileName )
+{
+ GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Import the shape from the file
+ Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportSTL( theFileName );
+
+ if( !GetOperations()->IsDone() || aHSeq.IsNull() )
+ return aSeq._retn();
+
+ // Copy created objects.
+ Standard_Integer aLength = aHSeq->Length();
+ aSeq->length( aLength );
+ for( Standard_Integer i = 1; i <= aLength; i++ )
+ aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
+
+ return aSeq._retn();
+}
+
+STLPlugin_IOperations* STLPlugin_IOperations_i::GetOperations()
+{
+ return (STLPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_IOperations_i_HeaderFile
+#define _STLPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( STLPlugin )
+
+// internal includes
+#include "STLPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class STLPlugin_IOperations;
+
+class STLPLUGINENGINE_EXPORT STLPlugin_IOperations_i :
+ public virtual POA_GEOM::ISTLOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ STLPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ STLPlugin_IOperations* theImpl );
+ ~STLPlugin_IOperations_i();
+
+ void ExportSTL( GEOM::GEOM_Object_ptr, const char*, const bool, const double, const bool );
+ GEOM::ListOfGO* ImportSTL( const char* );
+
+ STLPlugin_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_ImportDriver.hxx"
+#include "STLPlugin_IImport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+#include "GEOMImpl_Types.hxx"
+
+// OOCT includes
+#include <StlAPI_Reader.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Solid.hxx>
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <TopoDS.hxx>
+#include <Precision.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& STLPlugin_ImportDriver::GetID()
+{
+ static Standard_GUID aGUID("69e33dc7-9630-4a73-ac19-cc4da1f659b8");
+ return aGUID;
+}
+
+//=======================================================================
+//function : STLPlugin_ImportDriver
+//purpose :
+//=======================================================================
+STLPlugin_ImportDriver::STLPlugin_ImportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer STLPlugin_ImportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ STLPlugin_IImport aData( aFunction );
+
+ TCollection_AsciiString aFileName = aData.GetFileName().ToCString();
+
+ MESSAGE( "Import STL to file " << aFileName );
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ StlAPI_Reader aReader;
+ TopoDS_Shape aShape;
+
+ aReader.Read( aShape, aData.GetFileName().ToCString() );
+
+ if( aShape.IsNull() ) return 0;
+
+ // Fix the orientation of closed shell or solid.
+ if( BRep_Tool::IsClosed( aShape ) ) {
+ TopAbs_ShapeEnum aType = aShape.ShapeType();
+ if( aType == TopAbs_SHELL || aType == TopAbs_SOLID ) {
+ TopoDS_Solid aSolid;
+ if( aType == TopAbs_SHELL ) {
+ // Create a solid.
+ BRep_Builder aBuilder;
+ aBuilder.MakeSolid( aSolid );
+ aBuilder.Add(aSolid, aShape );
+ }
+ else
+ aSolid = TopoDS::Solid( aShape );
+
+ // Classify infinite point against solid.
+ BRepClass3d_SolidClassifier aClassifier( aSolid );
+ aClassifier.PerformInfinitePoint(Precision::Confusion());
+
+ if( aClassifier.State() == TopAbs_IN ) {
+ // The shape is inverted. Reverse it.
+ aShape.Reverse();
+ }
+ }
+ }
+
+ aFunction->SetValue( aShape );
+
+ log.SetTouched( Label() );
+
+ return 1;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean STLPlugin_ImportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+
+bool STLPlugin_ImportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ if( Label().IsNull() ) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction( Label() );
+
+ STLPlugin_IImport aCI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "ImportSTL";
+
+ switch ( aType ) {
+ case IMPORT_SHAPE:
+ AddParam( theParams, "File name", aCI.GetFileName() );
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE( STLPlugin_ImportDriver, GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( STLPlugin_ImportDriver, GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _STLPlugin_ImportDriver_HXX
+#define _STLPlugin_ImportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( STLPlugin_ImportDriver, GEOM_BaseDriver );
+
+class STLPlugin_ImportDriver : public GEOM_BaseDriver
+{
+public:
+ STLPlugin_ImportDriver();
+ ~STLPlugin_ImportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( STLPlugin_ImportDriver )
+};
+
+#endif // _STLPlugin_ImportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "STLPlugin_OperationsCreator.hxx"
+#include "STLPlugin_IOperations_i.hh"
+#include "STLPlugin_IOperations.hxx"
+#include "STLPlugin_ExportDriver.hxx"
+#include "STLPlugin_ImportDriver.hxx"
+#include "STLPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, STLPlugin_IOperations*> STLPlugin_OperationsCreator::_mapOfOperations;
+
+STLPlugin_OperationsCreator::STLPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( STLPlugin_ExportDriver::GetID(),
+ new STLPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( STLPlugin_ImportDriver::GetID(),
+ new STLPlugin_ImportDriver() );
+ // Register callback
+ STLPlugin_IECallBack* callback = new STLPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "STL", callback );
+ GEOMImpl_IECallBack::Register( "STL_Bin", callback );
+ GEOMImpl_IECallBack::Register( "STL_ASCII", callback );
+}
+
+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 ) );
+}
+
+STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new STLPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_STLPlugin_OperationsCreator_HXX_
+#define _GEOM_STLPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "STLPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class STLPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class STLPLUGINENGINE_EXPORT STLPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ STLPlugin_OperationsCreator();
+ ~STLPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+private:
+ static STLPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, STLPlugin_IOperations*> _mapOfOperations;
+
+ friend class STLPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTL</source>
+ <translation>STL</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTL</source>
+ <translation>Export STL</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTL</source>
+ <translation>Export STL</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTL</source>
+ <translation>STL</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTL</source>
+ <translation>Import STL</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTL</source>
+ <translation>Import STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_GUI</name>
+ <message>
+ <source>STL_FILES</source>
+ <translation>STL files( *.stl )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export STL</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Import STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_ExportDlg</name>
+ <message>
+ <source>ASCII</source>
+ <translation>Save as ASCII</translation>
+ </message>
+ <message>
+ <source>RELATIVE</source>
+ <translation>Relative</translation>
+ </message>
+ <message>
+ <source>DEFLECTION</source>
+ <translation>Deflection</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTL</source>
+ <translation>STL</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTL</source>
+ <translation>Exporter STL</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTL</source>
+ <translation>Exporter STL</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTL</source>
+ <translation>STL</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTL</source>
+ <translation>Importer STL</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTL</source>
+ <translation>Importer STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_GUI</name>
+ <message>
+ <source>STL_FILES</source>
+ <translation>STL fichiers( *.stl )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter STL</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation>Importer STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_ExportDlg</name>
+ <message>
+ <source>ASCII</source>
+ <translation type="unfinished">Save as ASCII</translation>
+ </message>
+ <message>
+ <source>RELATIVE</source>
+ <translation>Relative</translation>
+ </message>
+ <message>
+ <source>DEFLECTION</source>
+ <translation>Déflexion</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTSTL</source>
+ <translation type="unfinished">STL</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTSTL</source>
+ <translation type="unfinished">Export STL</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTSTL</source>
+ <translation type="unfinished">Export STL</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTSTL</source>
+ <translation type="unfinished">STL</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTSTL</source>
+ <translation type="unfinished">Import STL</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTSTL</source>
+ <translation type="unfinished">Import STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_GUI</name>
+ <message>
+ <source>STL_FILES</source>
+ <translation type="unfinished">STL files( *.stl )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export STL</translation>
+ </message>
+ <message>
+ <source>IMPORT_TITLE</source>
+ <translation type="unfinished">Import STL</translation>
+ </message>
+</context>
+<context>
+ <name>STLPlugin_ExportDlg</name>
+ <message>
+ <source>ASCII</source>
+ <translation type="unfinished">Save as ASCII</translation>
+ </message>
+ <message>
+ <source>RELATIVE</source>
+ <translation type="unfinished">Relative</translation>
+ </message>
+ <message>
+ <source>DEFLECTION</source>
+ <translation type="unfinished">Deflection</translation>
+ </message>
+</context>
+</TS>
const Handle(TColStd_HArray1OfInteger)& theOrders,
const Handle(TColStd_HArray1OfInteger)& theSenses)
{
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
BRepBuilderAPI_MakeFace aMakeFace (theSurf, Precision::Confusion());
-#else
- BRepBuilderAPI_MakeFace aMakeFace (theSurf);
-#endif
TopoDS_Face aFace = aMakeFace.Face();
aFace.EmptyCopy();
// Qt
#include <QRect>
-class ShapeRec_Parameters
+#ifdef WIN32
+ #if defined GEOM_SHAPEREC_EXPORTS || defined GEOMShapeRec_EXPORTS
+ #define GEOM_SHAPEREC_EXPORT __declspec( dllexport )
+ #else
+ #define GEOM_SHAPEREC_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define GEOM_SHAPEREC_EXPORT
+#endif
+
+class GEOM_SHAPEREC_EXPORT ShapeRec_Parameters
{
public:
ShapeRec_Parameters();
int findContoursMethod;
};
-class ShapeRec_CornersParameters : public ShapeRec_Parameters
+class GEOM_SHAPEREC_EXPORT ShapeRec_CornersParameters : public ShapeRec_Parameters
{
public:
ShapeRec_CornersParameters();
double epsilon;
};
-class ShapeRec_CannyParameters : public ShapeRec_Parameters
+class GEOM_SHAPEREC_EXPORT ShapeRec_CannyParameters : public ShapeRec_Parameters
{
public:
ShapeRec_CannyParameters();
bool L2gradient;
};
-class ShapeRec_ColorFilterParameters : public ShapeRec_Parameters
+class GEOM_SHAPEREC_EXPORT ShapeRec_ColorFilterParameters : public ShapeRec_Parameters
{
public:
ShapeRec_ColorFilterParameters();
double maxThreshold;
};
-class ShapeRec_FeatureDetector
+class GEOM_SHAPEREC_EXPORT ShapeRec_FeatureDetector
{
public:
#include <LightApp_SelectionMgr.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
#include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION
#include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- options ---
-
-# additional include directories
-INCLUDE_DIRECTORIES(
- ${CAS_INCLUDE_DIRS}
- ${PTHREAD_INCLUDE_DIR}
- ${KERNEL_INCLUDE_DIRS}
- ${VTK_INCLUDE_DIRS}
- ${PROJECT_SOURCE_DIR}/src/OCC2VTK
- )
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(
- ${CAS_DEFINITIONS}
- )
-
-# libraries to link to
-SET(_link_LIBRARIES
- vtkIOLegacy
- OCC2VTK
- ${KERNEL_SALOMELocalTrace}
- )
-
-# --- sources ---
-
-SET(VTKExport_SOURCES
- VTKExport.cxx
- )
-
-# --- rules ---
-
-ADD_LIBRARY(VTKExport ${VTKExport_SOURCES})
-TARGET_LINK_LIBRARIES(VTKExport ${_link_LIBRARIES})
-INSTALL(TARGETS VTKExport EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-
-
+++ /dev/null
-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File: VTKExport.cxx
-// Author: Oleg UVAROV
-//
-#include "utilities.h"
-
-#include <Basics_Utils.hxx>
-
-#include <OCC2VTK_Tools.h>
-
-#include <GEOM_VertexSource.h>
-#include <GEOM_EdgeSource.h>
-#include <GEOM_WireframeFace.h>
-#include <GEOM_ShadingFace.h>
-
-#include <vtkAppendPolyData.h>
-#include <vtkPolyDataWriter.h>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <Poly_Triangulation.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-
-#ifdef WIN32
-# if defined VTKEXPORT_EXPORTS || defined VTKExport_EXPORTS
-# define VTKEXPORT_EXPORT __declspec( dllexport )
-# else
-# define VTKEXPORT_EXPORT __declspec( dllimport )
-# endif
-#else
-# define VTKEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- VTKEXPORT_EXPORT
- int Export(const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
- {
- MESSAGE("Export VTK into file " << theFileName.ToCString());
-
- try
- {
- GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
- GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
- GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
- GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
- GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
- GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
-
- vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
- myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
- myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
- myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
- myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );
- //myAppendFilter->AddInputConnection( myWireframeFaceSource->GetOutputPort() ); // iso-lines are unnecessary
- myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
-
- float aDeflection = 0.001;
- bool anIsVector = false;
-
- // Is shape triangulated?
- bool wasMeshed = true;
- TopExp_Explorer ex;
- TopLoc_Location aLoc;
- for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) {
- const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
- Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
- if(aPoly.IsNull()) {
- wasMeshed = false;
- break;
- }
- }
-
- GEOM::MeshShape( theShape, aDeflection );
-
- TopExp_Explorer aVertexExp( theShape, TopAbs_VERTEX );
- for( ; aVertexExp.More(); aVertexExp.Next() )
- {
- const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
- myVertexSource->AddVertex( aVertex );
- }
-
- TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
- TopExp::MapShapesAndAncestors( theShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
-
- GEOM::SetShape( theShape,
- anEdgeMap,
- anIsVector,
- myIsolatedEdgeSource,
- myOneFaceEdgeSource,
- mySharedEdgeSource,
- myWireframeFaceSource,
- myShadingFaceSource );
-
- myAppendFilter->Update();
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
- aWriter->SetInputConnection( myAppendFilter->GetOutputPort() );
- aWriter->SetFileName( theFileName.ToCString() );
- aWriter->Write();
- aWriter->Delete();
-
- myVertexSource->Delete();
- myIsolatedEdgeSource->Delete();
- myOneFaceEdgeSource->Delete();
- mySharedEdgeSource->Delete();
- myWireframeFaceSource->Delete();
- myShadingFaceSource->Delete();
-
- myAppendFilter->Delete();
-
- if(!wasMeshed)
- BRepTools::Clean(theShape);
-
- return 1;
- }
- catch(Standard_Failure)
- {
- //THROW_SALOME_CORBA_EXCEPTION("Exception catched in VTKExport", SALOME::BAD_PARAM);
- }
- return 0;
- }
-}
--- /dev/null
+# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${VTK_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/OCC2VTK
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKVTK}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLVTKPlugin
+ GEOMEngine
+ GEOMClient
+ vtkIOLegacy
+ OCC2VTK
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLVTKPlugin
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+
+# --- headers ---
+
+SET(VTKPluginEngine_HEADERS
+ VTKPlugin_IOperations_i.hh
+ VTKPlugin_Engine.hxx
+ VTKPlugin_OperationsCreator.hxx
+ VTKPlugin_IOperations.hxx
+ VTKPlugin_IExport.hxx
+ VTKPlugin_ExportDriver.hxx
+ VTKPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ VTKPlugin_GUI.h
+ VTKPlugin_ExportDlg.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(VTKPluginGUI_SOURCES
+ VTKPlugin_GUI.cxx
+ VTKPlugin_ExportDlg.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(VTKPluginEngine_SOURCES
+ VTKPlugin_Engine.cxx
+ VTKPlugin_OperationsCreator.cxx
+ VTKPlugin_IOperations_i.cc
+ VTKPlugin_IOperations.cxx
+ VTKPlugin_ExportDriver.cxx
+ VTKPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(VTKPlugin_RESOURCES
+ VTKPlugin_msg_en.ts
+ VTKPlugin_msg_fr.ts
+ VTKPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(VTKPluginEngine ${VTKPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(VTKPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS VTKPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(VTKPluginGUI ${VTKPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(VTKPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS VTKPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${VTKPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${VTKPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_Engine.hxx"
+#include "VTKPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ VTKPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ VTKPlugin_OperationsCreator* aCreator = new VTKPlugin_OperationsCreator();
+ return aCreator;
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _VTKPLUGIN_ENGINE_HXX_
+#define _VTKPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined VTKPLUGINENGINE_EXPORTS || defined VTKPluginEngine_EXPORTS
+ #define VTKPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define VTKPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define VTKPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_ExportDlg.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(VTKPlugin)
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Study.h>
+
+// GEOM includes
+#include "GEOM_Constants.h"
+
+// QT includes
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+
+//=================================================================================
+// Constructor
+//=================================================================================
+VTKPlugin_ExportDlg::VTKPlugin_ExportDlg( const Handle(SALOME_InteractiveObject)& io, QWidget* parent )
+: SUIT_FileDlg( parent, false, true, true )
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ QLabel* deflectionLabel = new QLabel( tr( "DEFLECTION" ), this );
+
+ myDeflectionSB = new SalomeApp_DoubleSpinBox( this );
+ int aPrecision = resMgr->integerValue( "Geometry", "parametric_precision", 6 );
+ myDeflectionSB->setAcceptNames( false );
+ myDeflectionSB->setPrecision( aPrecision );
+ myDeflectionSB->setDecimals( aPrecision );
+ myDeflectionSB->setRange( GEOM::minDeflection(), 1.0 );
+ myDeflectionSB->setSingleStep( 1.0e-04 );
+
+ layout()->addWidget( deflectionLabel );
+ layout()->addWidget( myDeflectionSB );
+
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ SalomeApp_Study* study = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+ int mgrId = app->activeViewManager()->getGlobalId();
+ QVariant v = study->getObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::Deflection ), QVariant() );
+ double deflection = v.isValid() ? v.toDouble() : SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "deflection_coef", 0.001 );
+ myDeflectionSB->setValue( deflection );
+}
+
+//=================================================================================
+// Destructor
+//=================================================================================
+VTKPlugin_ExportDlg::~VTKPlugin_ExportDlg()
+{
+}
+
+//=================================================================================
+// getDeflection
+//=================================================================================
+double VTKPlugin_ExportDlg::getDeflection() const
+{
+ return myDeflectionSB->value();
+}
+
+//=================================================================================
+// getFileName
+//=================================================================================
+QString VTKPlugin_ExportDlg::getFileName( const Handle(SALOME_InteractiveObject)& io,
+ const QString& filters, const QString& caption,
+ QWidget* parent, double& deflection )
+{
+ QStringList fls = filters.split( ";;", QString::SkipEmptyParts );
+
+ QString tmpfilename = io->getName();
+ tmpfilename = tmpfilename.simplified();
+ tmpfilename = tmpfilename.replace( QRegExp( "\\*" ), "" ).replace( QRegExp( "\\?" ), "" );
+
+ VTKPlugin_ExportDlg fd( io, parent );
+ fd.setFileMode( AnyFile );
+ fd.setFilters( fls );
+ fd.setWindowTitle( caption );
+ if ( !tmpfilename.isEmpty() )
+ fd.processPath( tmpfilename );
+
+ QString filename;
+
+ if ( fd.exec() == QDialog::Accepted ) {
+ filename = fd.selectedFile();
+ deflection = fd.getDeflection();
+ }
+
+ QApplication::processEvents();
+
+ return filename;
+}
+
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef VTKPlugin_ExportDlg_H
+#define VTKPlugin_ExportDlg_H
+
+// GUI includes
+#include <SUIT_FileDlg.h>
+#include <SALOME_InteractiveObject.hxx>
+
+class SalomeApp_DoubleSpinBox;
+
+class VTKPlugin_ExportDlg: public SUIT_FileDlg
+{
+ Q_OBJECT
+
+public:
+ VTKPlugin_ExportDlg( const Handle(SALOME_InteractiveObject)&, QWidget* parent );
+ ~VTKPlugin_ExportDlg();
+
+ double getDeflection() const;
+
+ static QString getFileName( const Handle(SALOME_InteractiveObject)& io,
+ const QString& filters,
+ const QString& caption,
+ QWidget* parent,
+ double& deflection );
+
+private:
+ SalomeApp_DoubleSpinBox* myDeflectionSB;
+ Handle(SALOME_InteractiveObject) myObject;
+};
+
+#endif // VTKPlugin_ExportDlg_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_ExportDriver.hxx"
+#include "VTKPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Basics_Utils.hxx>
+
+// GEOM includes
+#include "GEOM_Function.hxx"
+#include "OCC2VTK_Tools.h"
+#include "GEOM_VertexSource.h"
+#include "GEOM_EdgeSource.h"
+#include "GEOM_WireframeFace.h"
+#include "GEOM_ShadingFace.h"
+
+// OOCT includes
+#include <TCollection_AsciiString.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <Poly_Triangulation.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepTools.hxx>
+
+// VTK includes
+#include <vtkAppendPolyData.h>
+#include <vtkPolyDataWriter.h>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& VTKPlugin_ExportDriver::GetID()
+{
+ static Standard_GUID aGUID("0966443c-6f3c-4ebe-ba46-c0833786d817");
+ return aGUID;
+}
+
+//=======================================================================
+//function : VTKPlugin_ExportDriver
+//purpose :
+//=======================================================================
+VTKPlugin_ExportDriver::VTKPlugin_ExportDriver()
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer VTKPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction( Label() );
+
+ VTKPlugin_IExport aData (aFunction);
+
+ // retrieve the being exported shape
+ TopoDS_Shape aShape;
+ Handle(GEOM_Function) aRefFunction = aData.GetOriginal();
+ if( aRefFunction.IsNull() ) return 0;
+ aShape = aRefFunction->GetValue();
+ if( aShape.IsNull() ) return 0;
+ // set the result of function to be used by next operations
+ aFunction->SetValue( aShape );
+
+ TCollection_AsciiString aFileName = aData.GetFileName();
+ float aDeflection = float( aData.GetDeflection() );
+
+ MESSAGE( "Export VTK into file " << aFileName );
+ try
+ {
+ GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
+ GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
+ GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
+ GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
+ GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
+ GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
+
+ vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
+ myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );
+ //myAppendFilter->AddInputConnection( myWireframeFaceSource->GetOutputPort() ); // iso-lines are unnecessary
+ myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
+
+ bool anIsVector = false;
+
+ // Is shape triangulated?
+ bool wasMeshed = true;
+ TopExp_Explorer ex;
+ TopLoc_Location aLoc;
+ for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) {
+ const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
+ Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
+ if(aPoly.IsNull()) {
+ wasMeshed = false;
+ break;
+ }
+ }
+
+ GEOM::MeshShape( aShape, aDeflection );
+
+ TopExp_Explorer aVertexExp( aShape, TopAbs_VERTEX );
+ for( ; aVertexExp.More(); aVertexExp.Next() )
+ {
+ const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
+ myVertexSource->AddVertex( aVertex );
+ }
+
+ TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
+ TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
+
+ GEOM::SetShape( aShape,
+ anEdgeMap,
+ anIsVector,
+ 0,
+ myIsolatedEdgeSource,
+ myOneFaceEdgeSource,
+ mySharedEdgeSource,
+ myWireframeFaceSource,
+ myShadingFaceSource );
+
+ myAppendFilter->Update();
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
+ aWriter->SetInputConnection( myAppendFilter->GetOutputPort() );
+ aWriter->SetFileName( aFileName.ToCString() );
+ aWriter->Write();
+ aWriter->Delete();
+
+ myVertexSource->Delete();
+ myIsolatedEdgeSource->Delete();
+ myOneFaceEdgeSource->Delete();
+ mySharedEdgeSource->Delete();
+ myWireframeFaceSource->Delete();
+ myShadingFaceSource->Delete();
+
+ myAppendFilter->Delete();
+
+ if(!wasMeshed)
+ BRepTools::Clean(aShape);
+
+ return 1;
+ }
+ catch( Standard_Failure )
+ {
+ //THROW_SALOME_CORBA_EXCEPTION("Exception catched in ExportVTK", SALOME::BAD_PARAM);
+ }
+ return 0;
+}
+
+//=======================================================================
+//function : MustExecute
+//purpose :
+//=======================================================================
+Standard_Boolean VTKPlugin_ExportDriver::MustExecute( const TFunction_Logbook& ) const
+{
+ return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief Returns a name of creation operation and names and values of creation parameters
+ */
+//================================================================================
+bool VTKPlugin_ExportDriver::
+GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& theParams )
+{
+ return false;
+}
+
+IMPLEMENT_STANDARD_HANDLE( VTKPlugin_ExportDriver,GEOM_BaseDriver );
+IMPLEMENT_STANDARD_RTTIEXT( VTKPlugin_ExportDriver,GEOM_BaseDriver );
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _VTKPlugin_ExportDriver_HXX
+#define _VTKPlugin_ExportDriver_HXX
+
+// GEOM includes
+#include "GEOM_BaseDriver.hxx"
+
+// OCCT includes
+#include <TFunction_Logbook.hxx>
+
+DEFINE_STANDARD_HANDLE( VTKPlugin_ExportDriver, GEOM_BaseDriver );
+
+class VTKPlugin_ExportDriver : public GEOM_BaseDriver
+{
+public:
+ VTKPlugin_ExportDriver();
+ ~VTKPlugin_ExportDriver() {};
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute( TFunction_Logbook& log ) const;
+ Standard_Boolean MustExecute( const TFunction_Logbook& ) const;
+ virtual void Validate( TFunction_Logbook& ) const {}
+
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
+
+DEFINE_STANDARD_RTTI( VTKPlugin_ExportDriver )
+};
+
+#endif // _VTKPlugin_ExportDriver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_GUI.h"
+#include "VTKPlugin_ExportDlg.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(VTKPlugin)
+
+//=======================================================================
+// function : VTKPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+VTKPlugin_GUI::VTKPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~VTKPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+VTKPlugin_GUI::~VTKPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool VTKPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_VTK"; break;
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool VTKPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if( theCommandID == "Export_VTK" ) {
+ result = exportVTK( parent );
+ }
+ else {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return true;
+}
+
+//=======================================================================
+// function : exportVTK
+// purpose :
+//=======================================================================
+bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
+{
+ 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::IVTKOperations_var stlOp = GEOM::IVTKOperations::_narrow( op );
+ if ( CORBA::is_nil( stlOp ) ) return false;
+
+ LightApp_SelectionMgr* sm = app->selectionMgr();
+ if ( !sm ) return false;
+
+ SALOME_ListIO selectedObjects;
+ sm->selectedObjects( selectedObjects );
+ bool ok = false;
+
+ SALOME_ListIteratorOfListIO it( selectedObjects );
+ for ( ; it.More(); it.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = it.Value();
+ GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io );
+
+ if ( CORBA::is_nil( obj ) ) continue;
+
+ double deflection = 0.;
+ QString fileName = VTKPlugin_ExportDlg::getFileName( io,
+ tr( "VTK_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent,
+ deflection );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, stlOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ stlOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection );
+
+ if ( stlOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stlOp->GetErrorCode() ) );
+ return false;
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& e )
+ {
+ transaction.abort();
+ return false;
+ }
+ ok = true;
+ }
+
+ if ( !ok )
+ {
+ SUIT_MessageBox::warning( parent,
+ tr( "WRN_WARNING" ),
+ tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) );
+ }
+ return ok;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new VTKPlugin_GUI( parent );
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef VTKPlugin_GUI_H
+#define VTKPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+class VTKPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ VTKPlugin_GUI( GeometryGUI* parent );
+ ~VTKPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool exportVTK( SUIT_Desktop* );
+};
+
+#endif // VTKPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_IECallBack.hxx"
+#include "VTKPlugin_IOperations.hxx"
+#include "VTKPlugin_OperationsCreator.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+VTKPlugin_IECallBack::VTKPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+VTKPlugin_IECallBack::~VTKPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool VTKPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ const double aDeflection = 0.001;
+ aPluginOperations->ExportVTK( theOriginal, theFileName, aDeflection );
+ return true;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _VTKPlugin_IECallBack_HXX_
+#define _VTKPlugin_IECallBack_HXX_
+
+// internal includes
+#include "VTKPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class VTKPLUGINENGINE_EXPORT VTKPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ VTKPlugin_IECallBack();
+ ~VTKPlugin_IECallBack();
+
+ bool Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _VTKPlugin_IExport_HXX_
+#define _VTKPlugin_IExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define EXPORTVTK_ARG_ORIGINAL 1
+#define EXPORTVTK_ARG_FILENAME 2
+#define EXPORTVTK_ARG_DEFLECTION 3
+
+class VTKPlugin_IExport
+{
+public:
+ VTKPlugin_IExport( Handle(GEOM_Function) theFunction )
+ : _func(theFunction) {}
+
+ void SetOriginal( Handle( GEOM_Function ) theOriginal)
+ { _func->SetReference( EXPORTVTK_ARG_ORIGINAL, theOriginal ); }
+ Handle( GEOM_Function ) GetOriginal()
+ { return _func->GetReference( EXPORTVTK_ARG_ORIGINAL ); }
+
+ void SetFileName( const TCollection_AsciiString& theFileName )
+ { _func->SetString( EXPORTVTK_ARG_FILENAME, theFileName ); }
+ TCollection_AsciiString GetFileName()
+ { return _func->GetString( EXPORTVTK_ARG_FILENAME ); }
+
+ void SetDeflection( double theDeflection )
+ { _func->SetReal( EXPORTVTK_ARG_DEFLECTION, theDeflection ); }
+ double GetDeflection()
+ { return _func->GetReal( EXPORTVTK_ARG_DEFLECTION ); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _VTKPlugin_IExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_IOperations.hxx"
+#include "VTKPlugin_ExportDriver.hxx"
+#include "VTKPlugin_IExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "VTKPlugin_IOperations::VTKPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+VTKPlugin_IOperations::~VTKPlugin_IOperations()
+{
+ MESSAGE( "VTKPlugin_IOperations::~VTKPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * ExportVTK
+ * Export a shape to VTK format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the file to exported
+ * \param theDeflection The deflection of the shape to exported
+ */
+//=============================================================================
+void VTKPlugin_IOperations::ExportVTK( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const double theDeflection )
+{
+ SetErrorCode(KO);
+ if( theOriginal.IsNull() ) return;
+
+ Handle(GEOM_Function) aRefFunction = theOriginal->GetLastFunction();
+ 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);
+
+ //Add an Export function
+ Handle(GEOM_Function) aFunction = result->AddFunction( VTKPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
+ if( aFunction.IsNull() ) return;
+
+ //Check if the function is set correctly
+ if( aFunction->GetDriverGUID() != VTKPlugin_ExportDriver::GetID() ) return;
+
+ //Set parameters
+ VTKPlugin_IExport aCI( aFunction );
+ aCI.SetOriginal( aRefFunction );
+ aCI.SetFileName( theFileName );
+ aCI.SetDeflection( theDeflection );
+
+ //Perform the Export
+ try {
+ OCC_CATCH_SIGNALS;
+ if( !GetSolver()->ComputeFunction( aFunction ) ) {
+ SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" );
+ return;
+ }
+ }
+ catch( Standard_Failure ) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode( aFail->GetMessageString() );
+ return;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << "geompy.ExportVTK(" << theOriginal << ", \""
+ << theFileName.ToCString() << "\", " << theDeflection << ")";
+
+ SetErrorCode(OK);
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : VTKPlugin_IOperations.hxx
+
+#ifndef _VTKPlugin_IOperations_HXX_
+#define _VTKPlugin_IOperations_HXX_
+
+// internal includes
+#include "VTKPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+
+class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ VTKPlugin_IOperations( GEOM_Engine*, int );
+ ~VTKPlugin_IOperations();
+
+ void ExportVTK( const Handle(GEOM_Object),
+ const TCollection_AsciiString&,
+ const double );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_IOperations_i.hh"
+#include "VTKPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+VTKPlugin_IOperations_i::VTKPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ VTKPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "VTKPlugin_IOperations_i::VTKPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+VTKPlugin_IOperations_i::~VTKPlugin_IOperations_i()
+{
+ MESSAGE( "VTKPlugin_IOperations_i::~VTKPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportVTK
+ * Export a shape to VTK format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ * \param theDeflection The deflection of the exported shape
+ */
+//=============================================================================
+void VTKPlugin_IOperations_i::ExportVTK( GEOM::GEOM_Object_ptr theOriginal,
+ const char* theFileName,
+ const double theDeflection )
+{
+ // duplicate the original shape
+ GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference shape
+ Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
+ if (anOriginal.IsNull()) return;
+
+ //Export the shape to the file
+ GetOperations()->ExportVTK( anOriginal, theFileName, theDeflection );
+}
+
+VTKPlugin_IOperations* VTKPlugin_IOperations_i::GetOperations()
+{
+ return (VTKPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _VTKPlugin_IOperations_i_HeaderFile
+#define _VTKPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( VTKPlugin )
+
+// internal includes
+#include "VTKPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class VTKPlugin_IOperations;
+
+class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations_i :
+ public virtual POA_GEOM::IVTKOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ VTKPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ VTKPlugin_IOperations* theImpl );
+ ~VTKPlugin_IOperations_i();
+
+ void ExportVTK( GEOM::GEOM_Object_ptr, const char*, const double );
+
+ VTKPlugin_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "VTKPlugin_OperationsCreator.hxx"
+#include "VTKPlugin_IOperations_i.hh"
+#include "VTKPlugin_IOperations.hxx"
+#include "VTKPlugin_ExportDriver.hxx"
+#include "VTKPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, VTKPlugin_IOperations*> VTKPlugin_OperationsCreator::_mapOfOperations;
+
+VTKPlugin_OperationsCreator::VTKPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( VTKPlugin_ExportDriver::GetID(),
+ new VTKPlugin_ExportDriver() );
+
+ // Register callback
+ VTKPlugin_IECallBack* callback = new VTKPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "VTK", callback );
+}
+
+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 ) );
+}
+
+VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new VTKPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_VTKPlugin_OperationsCreator_HXX_
+#define _GEOM_VTKPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "VTKPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class VTKPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class VTKPLUGINENGINE_EXPORT VTKPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ VTKPlugin_OperationsCreator();
+ ~VTKPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+private:
+ static VTKPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, VTKPlugin_IOperations*> _mapOfOperations;
+
+ friend class VTKPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTVTK</source>
+ <translation>VTK</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTVTK</source>
+ <translation>Export VTK</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTVTK</source>
+ <translation>Export VTK</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTVTK</source>
+ <translation>VTK</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTVTK</source>
+ <translation>Import VTK</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTVTK</source>
+ <translation>Import VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_GUI</name>
+ <message>
+ <source>VTK_FILES</source>
+ <translation>VTK files( *.vtk )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Export VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_ExportDlg</name>
+ <message>
+ <source>DEFLECTION</source>
+ <translation>Deflection</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTVTK</source>
+ <translation>VTK</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTVTK</source>
+ <translation>Exporter VTK</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTVTK</source>
+ <translation>Exporter VTK</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTVTK</source>
+ <translation>VTK</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTVTK</source>
+ <translation>Importer VTK</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTVTK</source>
+ <translation>Importer VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_GUI</name>
+ <message>
+ <source>VTK_FILES</source>
+ <translation>VTK fichiers( *.vtk )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation>Exporter VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_ExportDlg</name>
+ <message>
+ <source>DEFLECTION</source>
+ <translation>Déflexion</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTVTK</source>
+ <translation type="unfinished">VTK</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTVTK</source>
+ <translation type="unfinished">Export VTK</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTVTK</source>
+ <translation type="unfinished">Export VTK</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTVTK</source>
+ <translation type="unfinished">VTK</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTVTK</source>
+ <translation type="unfinished">Import VTK</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTVTK</source>
+ <translation type="unfinished">Import VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_GUI</name>
+ <message>
+ <source>VTK_FILES</source>
+ <translation type="unfinished">VTK files( *.vtk )</translation>
+ </message>
+ <message>
+ <source>EXPORT_TITLE</source>
+ <translation type="unfinished">Export VTK</translation>
+ </message>
+</context>
+<context>
+ <name>VTKPlugin_ExportDlg</name>
+ <message>
+ <source>DEFLECTION</source>
+ <translation type="unfinished">Deflection</translation>
+ </message>
+</context>
+</TS>
parseXaoNode(doc, root, xaoObject);
xmlFreeDoc(doc); // free document
- xmlCleanupParser(); // free globals
+ //xmlCleanupParser(); // free globals //vsr: xmlCleanupParser should not be called from the application
}
void parseXaoNode(xmlDocPtr doc, xmlNodePtr xaoNode, Xao* xaoObject)
{
std::string version = readStringProp(xaoNode, C_ATTR_XAO_VERSION, false, "");
if (version != "")
- xaoObject->setAuthor(version);
+ xaoObject->setVersion(version);
std::string author = readStringProp(xaoNode, C_ATTR_XAO_AUTHOR, false, "");
xaoObject->setAuthor(author);
int component = readIntegerProp(valNode, C_ATTR_VALUE_COMPONENT, true, -1);
xmlChar* data = xmlNodeGetContent(valNode->children);
- std::string value = (char*)data;
+ std::string value;
if (data != NULL)
{
value = (char*)data;
--- /dev/null
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE(UseQt4Ext)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+ ${CAS_INCLUDE_DIRS}
+ ${KERNEL_INCLUDE_DIRS}
+ ${PROJECT_BINARY_DIR}/idl
+ ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+ ${PROJECT_SOURCE_DIR}/src/GEOM
+ ${PROJECT_SOURCE_DIR}/src/GEOMImpl
+ ${PROJECT_SOURCE_DIR}/src/GEOM_I
+ ${PROJECT_SOURCE_DIR}/src/GEOMClient
+ ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+ ${PROJECT_SOURCE_DIR}/src/XAO
+ )
+
+IF(SALOME_BUILD_GUI)
+ INCLUDE_DIRECTORIES(
+ ${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${PROJECT_SOURCE_DIR}/src/OBJECT
+ ${PROJECT_SOURCE_DIR}/src/GEOMGUI
+ ${PROJECT_SOURCE_DIR}/src/GEOMBase
+ ${PROJECT_SOURCE_DIR}/src/DlgRef
+ )
+ENDIF()
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+ ${CAS_DEFINITIONS}
+ ${OMNIORB_DEFINITIONS}
+ )
+
+IF(WIN32)
+ ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
+IF(SALOME_BUILD_GUI)
+ADD_DEFINITIONS(
+ ${QT_DEFINITIONS}
+ )
+ENDIF()
+
+# libraries to link to
+SET(_link_engine_LIBRARIES
+ ${CAS_TKXAO}
+ ${KERNEL_SALOMELocalTrace}
+ ${KERNEL_OpUtil}
+ SalomeIDLGEOM
+ SalomeIDLXAOPlugin
+ GEOMEngine
+ GEOMClient
+ XAO
+ )
+
+IF(SALOME_BUILD_GUI)
+ SET(_link_gui_LIBRARIES
+ SalomeIDLXAOPlugin
+ DlgRef
+ GEOMObject
+ GEOM
+ GEOMBase
+ )
+ENDIF()
+
+# --- headers ---
+
+SET(XAOPluginEngine_HEADERS
+ XAOPlugin_IOperations_i.hh
+ XAOPlugin_Engine.hxx
+ XAOPlugin_OperationsCreator.hxx
+ XAOPlugin_IOperations.hxx
+ XAOPlugin_IImportExport.hxx
+ XAOPlugin_Driver.hxx
+ XAOPlugin_IECallBack.hxx
+ )
+
+IF(SALOME_BUILD_GUI)
+ # header files / to be processed by moc
+ SET(_moc_HEADERS
+ XAOPlugin_ExportDlg.h
+ XAOPlugin_ImportDlg.h
+ )
+ENDIF()
+
+# --- sources ---
+
+IF(SALOME_BUILD_GUI)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+ SET(XAOPluginGUI_SOURCES
+ XAOPlugin_GUI.cxx
+ XAOPlugin_ExportDlg.cxx
+ XAOPlugin_ImportDlg.cxx
+ ${_moc_SOURCES}
+ )
+ENDIF()
+
+SET(XAOPluginEngine_SOURCES
+ XAOPlugin_Engine.cxx
+ XAOPlugin_OperationsCreator.cxx
+ XAOPlugin_IOperations_i.cc
+ XAOPlugin_IOperations.cxx
+ XAOPlugin_Driver.cxx
+ XAOPlugin_IECallBack.cxx
+ )
+
+# resource files / to be processed by lrelease
+SET(XAOPlugin_RESOURCES
+ XAOPlugin_images.ts
+ XAOPlugin_msg_en.ts
+ XAOPlugin_msg_fr.ts
+ XAOPlugin_msg_ja.ts
+ )
+
+# --- rules ---
+
+ADD_LIBRARY(XAOPluginEngine ${XAOPluginEngine_SOURCES})
+TARGET_LINK_LIBRARIES(XAOPluginEngine ${_link_engine_LIBRARIES})
+INSTALL(TARGETS XAOPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+IF(SALOME_BUILD_GUI)
+ ADD_LIBRARY(XAOPluginGUI ${XAOPluginGUI_SOURCES})
+ TARGET_LINK_LIBRARIES(XAOPluginGUI ${_link_gui_LIBRARIES})
+ INSTALL(TARGETS XAOPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+ QT4_INSTALL_TS_RESOURCES("${XAOPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
+ENDIF()
+
+
+INSTALL(FILES ${XAOPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_Driver.hxx"
+#include "XAOPlugin_IImportExport.hxx"
+
+// GEOM includes
+#include "GEOMImpl_Types.hxx"
+#include "GEOM_Function.hxx"
+
+#include <XAO_Xao.hxx>
+#include <XAO_Geometry.hxx>
+#include <XAO_Group.hxx>
+#include <XAO_XaoUtils.hxx>
+
+// OCC includes
+#include <Standard_Stream.hxx>
+#include <TFunction_Logbook.hxx>
+#include <StdFail_NotDone.hxx>
+
+//=======================================================================
+//function : GetID
+//purpose :
+//=======================================================================
+const Standard_GUID& XAOPlugin_Driver::GetID()
+{
+ static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16");
+ return aGUID;
+}
+
+//=======================================================================
+//function : XAOPlugin_Driver
+//purpose :
+//=======================================================================
+XAOPlugin_Driver::XAOPlugin_Driver()
+{
+}
+
+//=======================================================================
+//function : ~XAOPlugin_Driver
+//purpose :
+//=======================================================================
+XAOPlugin_Driver::~XAOPlugin_Driver()
+{
+}
+
+Standard_Boolean XAOPlugin_Driver::MustExecute(const TFunction_Logbook&) const
+{
+ return Standard_True;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const
+{
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+ XAOPlugin_IImportExport iexao(function);
+ TCollection_AsciiString xao = iexao.GetData();
+
+ TopoDS_Shape shape;
+
+ Standard_Integer functionType = function->GetType();
+ if (functionType == EXPORT_SHAPE)
+ {
+ }
+ else if (functionType == IMPORT_SHAPE)
+ {
+ }
+ else
+ {
+ // other construction modes here
+ }
+
+ if (shape.IsNull()) return 0;
+ function->SetValue(shape);
+
+ log.SetTouched(Label());
+
+ return 1;
+}
+
+IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver);
+IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver);
+
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _XAOPlugin_Driver_HXX
+#define _XAOPlugin_Driver_HXX
+
+// OCCT includes
+#include <TFunction_Driver.hxx>
+
+DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, TFunction_Driver);
+
+class XAOPlugin_Driver: public TFunction_Driver
+{
+public:
+ XAOPlugin_Driver();
+ ~XAOPlugin_Driver();
+
+ static const Standard_GUID& GetID();
+ virtual Standard_Integer Execute(TFunction_Logbook& log) const;
+ Standard_Boolean MustExecute(const TFunction_Logbook&) const;
+ virtual void Validate(TFunction_Logbook&) const {}
+
+DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
+};
+
+#endif // _XAOPlugin_Driver_HXX
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_Engine.hxx"
+#include "XAOPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ XAOPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new XAOPlugin_OperationsCreator();
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _XAOPLUGIN_ENGINE_HXX_
+#define _XAOPLUGIN_ENGINE_HXX_
+
+#ifdef WIN32
+ #if defined XAOPLUGINENGINE_EXPORTS || defined XAOPluginEngine_EXPORTS
+ #define XAOPLUGINENGINE_EXPORT __declspec( dllexport )
+ #else
+ #define XAOPLUGINENGINE_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define XAOPLUGINENGINE_EXPORT
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_ExportDlg.h"
+#include "XAOPlugin_IOperations_i.hh"
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_FileDlg.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SalomeApp_Tools.h>
+#include <LightApp_SelectionMgr.h>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "GEOMImpl_Types.hxx"
+
+// OCCT Includes
+#include <TopoDS_Shape.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
+// QT includes
+#include <QLabel>
+#include <QLineEdit>
+#include <QButtonGroup>
+#include <QListWidget>
+#include <QFileDialog>
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QMap>
+
+//=================================================================================
+// Constructor
+//=================================================================================
+XAOPlugin_ExportDlg::XAOPlugin_ExportDlg(GeometryGUI* geometryGUI, QWidget* parent)
+:
+ GEOMBase_Skeleton(geometryGUI, parent, false)
+{
+ m_mainObj = GEOM::GEOM_Object::_nil();
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("XAOPLUGIN_EXPORT_ICON")));
+ QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+ setWindowTitle(tr("XAOPLUGIN_EXPORT_TITLE"));
+
+ /***************************************************************/
+ mainFrame()->GroupConstructors->setTitle(tr("XAOPLUGIN_EXPORT_TITLE"));
+ mainFrame()->RadioButton1->setIcon(imageOp);
+ mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton3->close();
+
+ // hide name
+ mainFrame()->GroupBoxName->hide();
+
+ //****************************
+ // Selection Group box
+ QGroupBox* gbxExport = new QGroupBox(parent);
+
+ QGridLayout* gridLayoutExport = new QGridLayout(gbxExport);
+#ifndef Q_OS_MAC
+ gridLayoutExport->setSpacing(6);
+ gridLayoutExport->setContentsMargins(9, 9, 9, 9);
+#endif
+ gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
+
+ // Line 0
+ QLabel* lblShape = new QLabel(tr("XAOPLUGIN_EXPORT_INGSHAPE"), gbxExport);
+ btnShapeSelect = new QPushButton(gbxExport);
+ btnShapeSelect->setIcon(iconSelect);
+ ledShape = new QLineEdit(gbxExport);
+ ledShape->setMinimumSize(QSize(100, 0));
+
+ int line = 0, col = 0;
+ gridLayoutExport->addWidget(lblShape, line, col++, 1, 1);
+ gridLayoutExport->addWidget(btnShapeSelect, line, col++, 1, 1);
+ gridLayoutExport->addWidget(ledShape, line, col++, 1, 1);
+
+ // Line 1
+ QLabel* lblFileName = new QLabel(tr("XAOPLUGIN_EXPORT_FILENAME"), gbxExport);
+ btnFileSelect = new QPushButton(gbxExport);
+ ledFileName = new QLineEdit(gbxExport);
+ btnFileSelect->setText("...");
+
+ line++; col = 0;
+ gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1);
+ gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1);
+ gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1);
+
+ // Line 2
+ QLabel* lblAuthor = new QLabel(tr("XAOPLUGIN_EXPORT_AUTHOR"), gbxExport);
+ ledAuthor = new QLineEdit(gbxExport);
+
+ line++; col = 0;
+ gridLayoutExport->addWidget(lblAuthor, line, col++, 2, 1);
+ col++; // span
+ gridLayoutExport->addWidget(ledAuthor, line, col++, 1, 1);
+
+ //****************************
+ // Filter Group box
+ QGroupBox* gbxFilter = new QGroupBox(parent);
+
+ QGridLayout* gridLayoutFilter = new QGridLayout(gbxFilter);
+#ifndef Q_OS_MAC
+ gridLayoutFilter->setSpacing(6);
+ gridLayoutFilter->setContentsMargins(9, 9, 9, 9);
+#endif
+ gridLayoutFilter->setObjectName(QString::fromUtf8("gbxFilter"));
+
+ // Line 0
+ QLabel* lblGroups = new QLabel(tr("XAOPLUGIN_EXPORT_LGROUPS"), gbxFilter);
+ QLabel* lblFields = new QLabel(tr("XAOPLUGIN_EXPORT_LFIELDS"), gbxFilter);
+
+ line = 0, col = 0;
+ gridLayoutFilter->addWidget(lblGroups, line, col++, 1, 1);
+ gridLayoutFilter->addWidget(lblFields, line, col++, 1, 1);
+
+ // Line 1
+ lstGroups = new QListWidget(gbxFilter);
+ lstGroups->setSelectionMode(QAbstractItemView::NoSelection);
+ lstFields = new QListWidget(gbxFilter);
+ lstFields->setSelectionMode(QAbstractItemView::NoSelection);
+
+ line++; col = 0;
+ gridLayoutFilter->addWidget(lstGroups, line, col++, 1, 1);
+ gridLayoutFilter->addWidget(lstFields, line, col++, 1, 1);
+
+ //****************************
+ QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+ layout->setMargin(0);
+ layout->setSpacing(6);
+ layout->addWidget(gbxExport);
+ layout->addWidget(gbxFilter);
+
+ // set help
+ setHelpFileName("xao_format_page.html");
+
+ Init();
+}
+
+//=================================================================================
+// Destructor
+//=================================================================================
+XAOPlugin_ExportDlg::~XAOPlugin_ExportDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::Init()
+{
+ // Get setting of step value from file configuration
+ m_groups.clear();
+ m_fields.clear();
+
+ // Signal/slot connections
+ connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+ connect(btnShapeSelect, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(((SalomeApp_Application*) (SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked()));
+
+ initName(tr("XAOPLUGIN_EXPORTXAO"));
+ SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : processObject()
+// purpose : Fill dialog fields in accordance with myObj
+//=================================================================================
+void XAOPlugin_ExportDlg::processObject()
+{
+ lstGroups->clear();
+ lstFields->clear();
+ m_groups.clear();
+ m_fields.clear();
+
+ if (m_mainObj->_is_nil())
+ {
+ ledShape->setText("");
+ }
+ else
+ {
+ ledShape->setText(GEOMBase::GetName(m_mainObj));
+ GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+
+ // add groups names
+ GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true);
+ for (int i = 0, n = groups->length(); i < n; i++)
+ {
+ QListWidgetItem* item = new QListWidgetItem();
+ item->setData(Qt::UserRole, QVariant(i));
+ item->setText(GEOMBase::GetName(groups[i]));
+ item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
+ item->setCheckState(Qt::Checked);
+ lstGroups->addItem(item);
+ m_groups.append(GEOM::GeomObjPtr(groups[i].in()));
+ }
+ lstGroups->sortItems(Qt::AscendingOrder);
+
+ // add fields
+ GEOM::GEOM_IFieldOperations_var fieldOp = getGeomEngine()->GetIFieldOperations(getStudyId());
+
+ GEOM::ListOfFields_var fields = fieldOp->GetFields(m_mainObj);
+ for (int i = 0, n = fields->length(); i < n; i++)
+ {
+ QListWidgetItem* item = new QListWidgetItem();
+ item->setData(Qt::UserRole, QVariant(i));
+ item->setText(fields[i]->GetName());
+ item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
+ item->setCheckState(Qt::Checked);
+ lstFields->addItem(item);
+ m_fields.append(GEOM::GeomFieldPtr(fields[i].in()));
+ }
+ lstFields->sortItems(Qt::AscendingOrder);
+ }
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::ClickOnOk()
+{
+ setIsApplyAndClose(true);
+ if (ClickOnApply())
+ ClickOnCancel();
+ setIsApplyAndClose(false);
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+bool XAOPlugin_ExportDlg::ClickOnApply()
+{
+ if (!isApplyAndClose())
+ {
+ setIsDisableBrowsing(true);
+ setIsDisplayResult(false);
+ }
+
+ QString msg;
+ if (!isValid(msg))
+ {
+ showError(msg);
+ return false;
+ }
+ SUIT_OverrideCursor wc;
+ SUIT_Session::session()->activeApplication()->putInfo("");
+
+ try
+ {
+ if (openCommand())
+ if (!execute())
+ {
+ abortCommand();
+ showError();
+ return false;
+ }
+ }
+ catch (const SALOME::SALOME_Exception& e)
+ {
+ SalomeApp_Tools::QtCatchCorbaException(e);
+ abortCommand();
+ return false;
+ }
+ commitCommand();
+
+ if (!isApplyAndClose())
+ {
+ setIsDisableBrowsing(false);
+ setIsDisplayResult(true);
+ }
+
+ processObject();
+ return true;
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed or other case
+//=================================================================================
+void XAOPlugin_ExportDlg::SelectionIntoArgument()
+{
+ m_mainObj = GEOM::GEOM_Object::_nil();
+ LightApp_SelectionMgr* selMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO selList;
+ selMgr->selectedObjects(selList);
+
+ if (selList.Extent() == 1)
+ {
+ m_mainObj = GEOMBase::ConvertIOinGEOMObject(selList.First());
+ }
+
+ processObject();
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::SetEditCurrentArgument()
+{
+ ledShape->setFocus();
+ myEditCurrentArgument = ledShape;
+ SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : btnFileSelectClicked()
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::btnFileSelectClicked()
+{
+ QString file = SUIT_FileDlg::getFileName(this, ledFileName->text(),
+ tr("XAOPLUGIN_FILES"),
+ tr("XAOPLUGIN_EXPORT_SELECT"), false);
+ if ( !file.isEmpty() )
+ ledFileName->setText( file );
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+}
+
+//=================================================================================
+// function : enterEvent [REDEFINED]
+// purpose :
+//=================================================================================
+void XAOPlugin_ExportDlg::enterEvent(QEvent*)
+{
+ if (!mainFrame()->GroupConstructors->isEnabled())
+ ActivateThisDialog();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr XAOPlugin_ExportDlg::createOperation()
+{
+ return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" );
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool XAOPlugin_ExportDlg::isValid(QString& msg)
+{
+ // check shape
+ if (ledShape->text().isEmpty())
+ return false;
+
+ // check file name
+ if (ledFileName->text().isEmpty())
+ return false;
+
+ return true;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool XAOPlugin_ExportDlg::execute()
+{
+ bool res = false;
+
+ QString author = ledAuthor->text();
+ QString fileName = ledFileName->text();
+
+ // get selected groups
+ QList<QListWidgetItem*> selGroups;
+ for (int j = 0; j < lstGroups->count(); ++j)
+ {
+ if (lstGroups->item(j)->checkState() == Qt::Checked)
+ selGroups.append(lstGroups->item(j));
+ }
+
+ GEOM::ListOfGO_var groups = new GEOM::ListOfGO();
+ groups->length(selGroups.count());
+ int i = 0;
+ for (QList<QListWidgetItem*>::iterator it = selGroups.begin(); it != selGroups.end(); ++it)
+ {
+ QListWidgetItem* item = (*it);
+ int index = item->data(Qt::UserRole).toInt();
+ groups[i++] = m_groups[index].copy();
+ }
+
+ // get selected fields
+ QList<QListWidgetItem*> selFields;
+ for (int j = 0; j < lstFields->count(); ++j)
+ {
+ if (lstFields->item(j)->checkState() == Qt::Checked)
+ selFields.append(lstFields->item(j));
+ }
+
+ GEOM::ListOfFields_var fields = new GEOM::ListOfFields();
+ fields->length(selFields.count());
+ i = 0;
+ for (QList<QListWidgetItem*>::iterator it = selFields.begin(); it != selFields.end(); ++it)
+ {
+ QListWidgetItem* item = (*it);
+ int index = item->data(Qt::UserRole).toInt();
+ fields[i++] = m_fields[index].copy();
+ }
+
+ // call engine function
+ GEOM::IXAOOperations_var aXAOOp = GEOM::IXAOOperations::_narrow( getOperation() );
+ res = aXAOOp->ExportXAO(m_mainObj, groups, fields,
+ author.toStdString().c_str(),
+ fileName.toStdString().c_str());
+ return res;
+}
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef XAOPlugin_ExportDlg_H
+#define XAOPlugin_ExportDlg_H
+
+// GEOM includes
+#include "GEOMBase_Skeleton.h"
+
+class QLineEdit;
+class QButtonGroup;
+class QListWidget;
+class QPushButton;
+
+//=================================================================================
+// class : XAOPlugin_ExportDlg
+// purpose :
+//=================================================================================
+class XAOPlugin_ExportDlg: public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ XAOPlugin_ExportDlg(GeometryGUI*, QWidget* = 0);
+ ~XAOPlugin_ExportDlg();
+
+protected:
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid(QString&);
+ virtual bool execute();
+
+private:
+ void Init();
+ void enterEvent(QEvent*);
+ void processObject();
+
+private:
+ GEOM::GEOM_Object_var m_mainObj;
+ QList<GEOM::GeomObjPtr> m_groups;
+ QList<GEOM::GeomFieldPtr> m_fields;
+ QLineEdit* ledShape;
+ QLineEdit* ledFileName;
+ QLineEdit* ledAuthor;
+ QListWidget* lstGroups;
+ QListWidget* lstFields;
+ QPushButton* btnShapeSelect;
+ QPushButton* btnFileSelect;
+
+private slots:
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void btnFileSelectClicked();
+};
+
+#endif // XAOPlugin_ExportDlg_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_GUI.h"
+#include "XAOPlugin_ExportDlg.h"
+#include "XAOPlugin_ImportDlg.h"
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SalomeApp_Application.h>
+
+// GEOM includes
+#include "GeometryGUI.h"
+
+//=======================================================================
+// function : XAOPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+XAOPlugin_GUI::XAOPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~XAOPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+XAOPlugin_GUI::~XAOPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool XAOPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ switch ( theCommandID ) {
+ case 1:
+ return OnGUIEvent("Export_XAO", parent);
+ case 2:
+ return OnGUIEvent("Import_XAO", parent);
+ default:
+ return OnGUIEvent("", parent);
+ }
+ return false;
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool XAOPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
+
+ getGeometryGUI()->EmitSignalDeactivateDialog();
+
+ QDialog* dialog = NULL;
+ if( theCommandID == "Export_XAO" )
+ dialog = new XAOPlugin_ExportDlg(getGeometryGUI(), parent);
+ else if( theCommandID == "Import_XAO" )
+ dialog = new XAOPlugin_ImportDlg(getGeometryGUI(), parent);
+ else
+ app->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+
+ if (dialog != NULL)
+ dialog->show();
+
+ return true;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI(GeometryGUI* parent)
+ {
+ return new XAOPlugin_GUI(parent);
+ }
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef XAOPlugin_GUI_H
+#define XAOPlugin_GUI_H
+
+#include "GEOMPluginGUI.h"
+
+//=================================================================================
+// class : XAOPlugin_GUI
+// purpose :
+//=================================================================================
+class XAOPlugin_GUI: public GEOMPluginGUI
+{
+public:
+ XAOPlugin_GUI(GeometryGUI* parent);
+ ~XAOPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+};
+
+#endif // XAOPlugin_GUI_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_IECallBack.hxx"
+#include "XAOPlugin_IOperations.hxx"
+#include "XAOPlugin_OperationsCreator.hxx"
+#include "GEOMImpl_IShapesOperations.hxx"
+
+//=============================================================================
+/*!
+ * constructor
+ */
+//=============================================================================
+XAOPlugin_IECallBack::XAOPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+XAOPlugin_IECallBack::~XAOPlugin_IECallBack()
+{
+}
+
+//=============================================================================
+/*!
+ * Export
+ */
+//=============================================================================
+bool
+XAOPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
+{
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations( theDocId );
+
+ Handle(TColStd_HSequenceOfTransient) groups = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Groups );
+ Handle(TColStd_HSequenceOfTransient) fields = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Fields );
+ std::list<Handle(GEOM_Object)> lgroups;
+ std::list<Handle(GEOM_Field)> lfields;
+ for (int i = 1; i <= groups->Length(); i++)
+ lgroups.push_back( Handle(GEOM_Object)::DownCast( groups->Value(i) ) );
+ for (int i = 1; i <= fields->Length(); i++)
+ lfields.push_back( Handle(GEOM_Field)::DownCast( fields->Value(i) ) );
+ aPluginOperations->ExportXAO( theOriginal, lgroups, lfields, "SIMAN Author", theFileName.ToCString() );
+ return true;
+}
+
+//=============================================================================
+/*!
+ * Import
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+XAOPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
+{
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
+
+ Handle(TColStd_HSequenceOfTransient) result = new TColStd_HSequenceOfTransient();
+ Handle(TColStd_HSequenceOfTransient) subshapes = new TColStd_HSequenceOfTransient();
+ Handle(TColStd_HSequenceOfTransient) groups = new TColStd_HSequenceOfTransient();
+ Handle(TColStd_HSequenceOfTransient) fields = new TColStd_HSequenceOfTransient();
+ Handle(GEOM_Object) shape;
+
+ bool ok = aPluginOperations->ImportXAO( theFileName.ToCString(), shape, subshapes, groups, fields );
+ if ( ok ) {
+ result->Append( shape );
+ for ( int i = 1; i <= groups->Length(); i++ )
+ result->Append( groups->Value(i) );
+ for ( int i = 1; i <= fields->Length(); i++ )
+ result->Append( fields->Value(i) );
+ }
+ return result;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _XAOPlugin_IECallBack_HXX_
+#define _XAOPlugin_IECallBack_HXX_
+
+// internal includes
+#include "XAOPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Object.hxx"
+#include "GEOMImpl_IECallBack.hxx"
+
+// OCC includes
+#include <TCollection_AsciiString.hxx>
+
+class XAOPLUGINENGINE_EXPORT XAOPlugin_IECallBack : public GEOMImpl_IECallBack
+{
+public:
+ XAOPlugin_IECallBack();
+ ~XAOPlugin_IECallBack();
+
+ virtual bool Export( int theDocId,
+ 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 );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _XAOPlugin_IImportExport_HXX_
+#define _XAOPlugin_IImportExport_HXX_
+
+#include "GEOM_Function.hxx"
+
+#define IMPORTEXPORTXAO_ARG_DATA 1
+
+class XAOPlugin_IImportExport
+{
+public:
+ XAOPlugin_IImportExport(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+ void SetData(const TCollection_AsciiString& data) { _func->SetString(IMPORTEXPORTXAO_ARG_DATA, data); }
+ const TCollection_AsciiString GetData() { return _func->GetString(IMPORTEXPORTXAO_ARG_DATA); }
+
+private:
+ Handle(GEOM_Function) _func;
+};
+
+#endif // _XAOPlugin_IImportExport_HXX_
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_IOperations.hxx"
+#include "XAOPlugin_Driver.hxx"
+#include "XAOPlugin_IImportExport.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+#include <Utils_SALOME_Exception.hxx>
+
+// GEOM includes
+#include "GEOM_PythonDump.hxx"
+#include "GEOMImpl_Types.hxx"
+#include "GEOMImpl_IGroupOperations.hxx"
+#include "GEOMImpl_IShapesOperations.hxx"
+#include "GEOMImpl_IFieldOperations.hxx"
+#include "GEOM_ISubShape.hxx"
+
+#include <XAO_Geometry.hxx>
+#include <XAO_BrepGeometry.hxx>
+#include <XAO_Xao.hxx>
+#include <XAO_Group.hxx>
+#include <XAO_Field.hxx>
+#include <XAO_BooleanField.hxx>
+#include <XAO_IntegerField.hxx>
+#include <XAO_DoubleField.hxx>
+#include <XAO_StringField.hxx>
+#include <XAO_DoubleStep.hxx>
+#include <XAO_StringStep.hxx>
+
+#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+
+// OCC includes
+#include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+#include <TDataStd_Integer.hxx>
+
+
+XAO::Dimension shapeEnumToDimension(const TopAbs_ShapeEnum& shape)
+{
+ XAO::Dimension dim;
+ switch( shape ) {
+ case TopAbs_VERTEX:
+ dim = XAO::VERTEX; break;
+ case TopAbs_EDGE:
+ dim = XAO::EDGE; break;
+ case TopAbs_FACE:
+ dim = XAO::FACE; break;
+ case TopAbs_SOLID:
+ dim = XAO::SOLID; break;
+ default:
+ throw SALOME_Exception("Bad type"); // TODO
+ }
+ return dim;
+}
+
+TopAbs_ShapeEnum getGroupDimension(XAO::Group* group)
+{
+ XAO::Dimension dim = group->getDimension();
+ TopAbs_ShapeEnum rdim;
+ switch ( dim )
+ {
+ case XAO::VERTEX:
+ rdim = TopAbs_VERTEX; break;
+ case XAO::EDGE:
+ rdim = TopAbs_EDGE; break;
+ case XAO::FACE:
+ rdim = TopAbs_FACE; break;
+ case XAO::SOLID:
+ rdim = TopAbs_SOLID; break;
+ default:
+ rdim = TopAbs_COMPOUND; break;
+ }
+ return rdim;
+}
+
+//=============================================================================
+/*!
+ * Constructor
+ */
+//=============================================================================
+XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
+: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+{
+ MESSAGE( "XAOPlugin_IOperations::XAOPlugin_IOperations" );
+}
+
+//=============================================================================
+/*!
+ * Destructor
+ */
+//=============================================================================
+XAOPlugin_IOperations::~XAOPlugin_IOperations()
+{
+ MESSAGE( "XAOPlugin_IOperations::~XAOPlugin_IOperations" );
+}
+
+void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupList,
+ XAO::Xao* xaoObject,
+ XAO::BrepGeometry* geometry )
+{
+ // add the groups
+ std::list<Handle(GEOM_Object)>::iterator groupIterator = groupList.begin();
+ while (groupIterator != groupList.end())
+ {
+ Handle(GEOM_Object) currGroup = (*groupIterator++);
+ Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup);
+
+ TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup);
+ XAO::Dimension dim = shapeEnumToDimension(shapeGroup);
+ XAO::Group* group = xaoObject->addGroup(dim, currGroup->GetName().ToCString());
+
+ switch (shapeGroup)
+ {
+ case TopAbs_VERTEX:
+ for (int i = 1; i <= groupIds->Length(); i++)
+ {
+ std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
+ int index = geometry->getVertexIndexByReference(ref);
+ group->add(index);
+ }
+ break;
+ case TopAbs_EDGE:
+ for (int i = 1; i <= groupIds->Length(); i++)
+ {
+ std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
+ int index = geometry->getEdgeIndexByReference(ref);
+ group->add(index);
+ }
+ break;
+ case TopAbs_FACE:
+ for (int i = 1; i <= groupIds->Length(); i++)
+ {
+ std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
+ int index = geometry->getFaceIndexByReference(ref);
+ group->add(index);
+ }
+ break;
+ case TopAbs_SOLID:
+ for (int i = 1; i <= groupIds->Length(); i++)
+ {
+ std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i));
+ int index = geometry->getSolidIndexByReference(ref);
+ group->add(index);
+ }
+ break;
+ }
+ }
+}
+
+void XAOPlugin_IOperations::exportFields( std::list<Handle(GEOM_Field)> fieldList,
+ XAO::Xao* xaoObject,
+ XAO::BrepGeometry* geometry )
+{
+ std::list<Handle(GEOM_Field)>::iterator fieldIterator = fieldList.begin();
+ while (fieldIterator != fieldList.end())
+ {
+ Handle(GEOM_Field) currField = (*fieldIterator++);
+
+ int fdim = currField->GetDimension();
+ int ftype = currField->GetDataType();
+ int nbComponents = currField->GetNbComponents();
+ std::string name = currField->GetName().ToCString();
+
+ XAO::Field* field = xaoObject->addField((XAO::Type)ftype, (XAO::Dimension)fdim, nbComponents, name);
+
+ Handle(TColStd_HArray1OfExtendedString) components = currField->GetComponents();
+ for (int i = components->Lower(), j = 0; i <= components->Upper(); ++i, ++j)
+ {
+ field->setComponentName(j, TCollection_AsciiString(components->Value(i)).ToCString());
+ }
+
+ std::list< Handle(GEOM_FieldStep)> steps = currField->GetSteps();
+ std::list<Handle(GEOM_FieldStep)>::iterator stepIterator = steps.begin();
+ while (stepIterator != steps.end())
+ {
+ Handle(GEOM_FieldStep) currStep = (*stepIterator++);
+
+ XAO::Step* step = field->addNewStep(currStep->GetID());
+ step->setStamp(currStep->GetStamp());
+
+ switch (ftype)
+ {
+ case 0: // bool
+ {
+ XAO::BooleanStep* bs = (XAO::BooleanStep*)step;
+ Handle(TColStd_HArray1OfInteger) bvalues = currStep->GetIntValues();
+ std::vector<bool> bv;
+ bv.reserve(bvalues->Upper());
+ for ( int i = bvalues->Lower(), nb = bvalues->Upper(); i <= nb; ++i )
+ {
+ bv.push_back(bvalues->Value(i) != 0);
+ }
+ bs->setValues(bv);
+ break;
+ }
+ case 1: // integer
+ {
+ XAO::IntegerStep* is = (XAO::IntegerStep*)step;
+ Handle(TColStd_HArray1OfInteger) ivalues = currStep->GetIntValues();
+ std::vector<int> iv;
+ iv.reserve(ivalues->Upper());
+ for ( int i = ivalues->Lower(), nb = ivalues->Upper(); i <= nb; ++i )
+ {
+ iv.push_back(ivalues->Value(i));
+ }
+ is->setValues(iv);
+ break;
+ }
+ case 2: // double
+ {
+ XAO::DoubleStep* ds = (XAO::DoubleStep*)step;
+ Handle(TColStd_HArray1OfReal) dvalues = currStep->GetDoubleValues();
+ std::vector<double> dv;
+ dv.reserve(dvalues->Upper());
+ for ( int i = dvalues->Lower(), nb = dvalues->Upper(); i <= nb; ++i )
+ {
+ dv.push_back(dvalues->Value(i));
+ }
+ ds->setValues(dv);
+ break;
+ }
+ case 3: // string
+ {
+ XAO::StringStep* ss = (XAO::StringStep*)step;
+ Handle(TColStd_HArray1OfExtendedString) svalues = currStep->GetStringValues();
+ std::vector<std::string> sv;
+ sv.reserve(svalues->Upper());
+ for ( int i = svalues->Lower(), nb = svalues->Upper(); i <= nb; ++i )
+ {
+ sv.push_back(TCollection_AsciiString(svalues->Value(i)).ToCString());
+ }
+ ss->setValues(sv);
+ break;
+ }
+ }
+ }
+ }
+}
+
+void XAOPlugin_IOperations::exportSubshapes( const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry )
+{
+ Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects( shape, false );
+ int nbSubObjects = subObjects->Length();
+ // set the names of the sub shapes
+ for (int i = 1; i <= nbSubObjects; i++)
+ {
+ Handle(Standard_Transient) transientSubObject = subObjects->Value(i);
+ if (transientSubObject.IsNull())
+ continue;
+
+ Handle(GEOM_Object) subObject = Handle(GEOM_Object)::DownCast( transientSubObject );
+ if (subObject->GetType() != GEOM_GROUP)
+ {
+ int subIndex = myShapesOperations->GetSubShapeIndex( shape, subObject );
+ switch (subObject->GetValue().ShapeType())
+ {
+ case TopAbs_VERTEX:
+ geometry->changeVertexName(subIndex, subObject->GetName().ToCString());
+ break;
+ case TopAbs_EDGE:
+ geometry->changeEdgeName(subIndex, subObject->GetName().ToCString());
+ break;
+ case TopAbs_FACE:
+ geometry->changeFaceName(subIndex, subObject->GetName().ToCString());
+ break;
+ case TopAbs_SOLID:
+ geometry->changeSolidName(subIndex, subObject->GetName().ToCString());
+ break;
+ }
+ }
+ }
+}
+
+//=============================================================================
+/*!
+ * Export a shape to XAO format
+ * \param shape The shape to export
+ * \param groups The list of groups to export
+ * \param fields The list of fields to export
+ * \param fileName The name of the file to exported
+ * \return boolean indicating if export was succeful.
+ */
+//=============================================================================
+bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape,
+ std::list<Handle(GEOM_Object)> groupList,
+ std::list<Handle(GEOM_Field)> fieldList,
+ const char* author,
+ const char* fileName )
+{
+ SetErrorCode(KO);
+
+ if (shape.IsNull()) return false;
+
+ // add a new shape function with parameters
+ Handle(GEOM_Function) lastFunction = shape->GetLastFunction();
+ if (lastFunction.IsNull()) return false;
+
+ // add a new result object
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
+
+ // add an Export function
+ Handle(GEOM_Function) exportFunction = result->AddFunction(XAOPlugin_Driver::GetID(), EXPORT_SHAPE);
+ if (exportFunction.IsNull()) return false;
+ if (exportFunction->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
+
+ // create the XAO object
+ XAO::Xao* xaoObject = new XAO::Xao();
+ xaoObject->setAuthor(author);
+
+ // add the geometry
+ XAO::BrepGeometry* geometry = (XAO::BrepGeometry*)XAO::Geometry::createGeometry(XAO::BREP);
+ TopoDS_Shape topoShape = shape->GetValue();
+ exportFunction->SetValue(topoShape);
+ XAO::BrepGeometry* brep = (XAO::BrepGeometry*)geometry;
+ brep->setTopoDS_Shape(topoShape);
+
+ geometry->setName(shape->GetName().ToCString());
+ exportSubshapes(shape, geometry);
+ xaoObject->setGeometry(geometry);
+
+ exportGroups(groupList, xaoObject, geometry);
+ exportFields(fieldList, xaoObject, geometry);
+
+ // export the XAO to the file
+ xaoObject->exportXAO(fileName);
+
+ // make a Python command
+ GEOM::TPythonDump pd(exportFunction);
+ pd << "exported = geompy.ExportXAO(" << shape;
+
+ // list of groups
+ pd << ", [";
+ if (groupList.size() > 0)
+ {
+ std::list<Handle(GEOM_Object)>::iterator itGroup = groupList.begin();
+ pd << (*itGroup++);
+ while (itGroup != groupList.end())
+ {
+ pd << ", " << (*itGroup++);
+ }
+ }
+
+ // list of fields
+ pd << "], [";
+ if (fieldList.size() > 0)
+ {
+ std::list<Handle(GEOM_Field)>::iterator itField = fieldList.begin();
+ pd << (*itField++);
+ while (itField != fieldList.end())
+ {
+ pd << ", " << (*itField++);
+ }
+ }
+ pd << "], ";
+ pd << "\"" << author << "\", \"" << fileName << "\")";
+
+ SetErrorCode(OK);
+ delete xaoObject;
+
+ return true;
+}
+
+void XAOPlugin_IOperations::importSubShapes( XAO::Geometry* xaoGeometry,
+ Handle(GEOM_Function) function, int shapeType, int dim,
+ Handle(TColStd_HSequenceOfTransient)& subShapeList )
+{
+ Handle(GEOM_Object) subShape;
+ Handle(GEOM_Function) aFunction;
+ Handle(TColStd_HArray1OfInteger) anArray;
+
+ XAO::GeometricElementList::iterator elementIterator = xaoGeometry->begin((XAO::Dimension)dim);
+ for (; elementIterator != xaoGeometry->end((XAO::Dimension)dim); elementIterator++)
+ {
+ XAO::GeometricElement element = elementIterator->second;
+ if (!element.hasName())
+ continue;
+
+ std::string name = element.getName();
+ std::string ref = element.getReference();
+ int iref = XAO::XaoUtils::stringToInt(ref);
+
+ anArray = new TColStd_HArray1OfInteger(1, 1);
+ anArray->SetValue(1, iref);
+
+ subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1);
+ if (aFunction.IsNull())
+ return;
+
+ subShape->SetName(name.c_str());
+ subShape->SetType(shapeType);
+
+ GEOM_ISubShape aSSI(aFunction);
+ aSSI.SetMainShape(function);
+ aSSI.SetIndices(anArray);
+
+ //aFunction->SetValue(aValue);
+ subShapeList->Append(subShape);
+
+ // Put this subshape in the list of sub-shapes of theMainShape
+ function->AddSubShapeReference(aFunction);
+ }
+}
+
+//=============================================================================
+/*!
+ * Import a shape from XAO format
+ * \param fileName The name of the file to import
+ * \param shape The imported shape
+ * \param subShapes The list of imported groups
+ * \param groups The list of imported groups
+ * \param fields The list of imported fields
+ * \return boolean indicating if import was succeful.
+ */
+//=============================================================================
+bool XAOPlugin_IOperations::ImportXAO( const char* fileName,
+ Handle(GEOM_Object)& shape,
+ Handle(TColStd_HSequenceOfTransient)& subShapes,
+ Handle(TColStd_HSequenceOfTransient)& groups,
+ Handle(TColStd_HSequenceOfTransient)& fields )
+{
+ SetErrorCode(KO);
+
+ if (fileName == NULL || groups.IsNull() || fields.IsNull())
+ return false;
+
+ // Read the XAO
+ XAO::Xao* xaoObject = new XAO::Xao();
+ try
+ {
+ xaoObject->importXAO(fileName);
+ }
+ catch (XAO::XAO_Exception& exc)
+ {
+ delete xaoObject;
+ SetErrorCode(exc.what());
+ return false;
+ }
+
+ XAO::Geometry* xaoGeometry = xaoObject->getGeometry();
+ if (xaoGeometry == NULL)
+ {
+ delete xaoObject;
+ SetErrorCode("Cannot import XAO: geometry format not supported.");
+ return false;
+ }
+
+ // create the shape
+ shape = GetEngine()->AddObject(GetDocID(), 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;
+
+ // set the geometry
+ if (xaoGeometry->getFormat() == XAO::BREP)
+ {
+ XAO::BrepGeometry* brep = (XAO::BrepGeometry*)xaoGeometry;
+ TopoDS_Shape geomShape = brep->getTopoDS_Shape();
+ function->SetValue(geomShape);
+ shape->SetName(xaoGeometry->getName().c_str());
+ }
+ else
+ {
+ delete xaoObject;
+ SetErrorCode("Cannot import XAO: geometry format not supported.");
+ return false;
+ }
+
+ // create sub shapes with names
+ importSubShapes(xaoGeometry, function, GEOM_POINT, XAO::VERTEX, subShapes);
+ importSubShapes(xaoGeometry, function, GEOM_EDGE, XAO::EDGE, subShapes);
+ importSubShapes(xaoGeometry, function, GEOM_FACE, XAO::FACE, subShapes);
+ importSubShapes(xaoGeometry, function, GEOM_SOLID, XAO::SOLID, subShapes);
+
+ // create groups
+ int nbGroups = xaoObject->countGroups();
+ for (int i = 0; i < nbGroups; ++i)
+ {
+ XAO::Group* xaoGroup = xaoObject->getGroup(i);
+
+ // build an array with the indexes of the sub shapes
+ int nbElt = xaoGroup->count();
+ Handle(TColStd_HArray1OfInteger) array = new TColStd_HArray1OfInteger(1, nbElt);
+ int j = 0;
+ for (std::set<int>::iterator it = xaoGroup->begin(); it != xaoGroup->end(); ++it)
+ {
+ int index = (*it);
+ std::string ref = xaoGeometry->getElementReference(xaoGroup->getDimension(), index);
+ array->SetValue(++j, XAO::XaoUtils::stringToInt(ref));
+ }
+
+ // create the group with the array of sub shapes indexes
+ Handle(GEOM_Object) group = GetEngine()->AddSubShape(shape, array);
+ group->SetType(GEOM_GROUP);
+ group->SetName(xaoGroup->getName().c_str());
+
+ // Set a sub-shape type
+ TDF_Label freeLabel = group->GetFreeLabel();
+ TDataStd_Integer::Set(freeLabel, (Standard_Integer) getGroupDimension(xaoGroup));
+ groups->Append(group);
+
+ function = group->GetLastFunction();
+ }
+
+ // create the fields
+ int nbFields = xaoObject->countFields();
+ for (int i = 0; i < nbFields; ++i)
+ {
+ XAO::Field* xaoField = xaoObject->getField(i);
+
+ Handle(TColStd_HArray1OfExtendedString) components = new TColStd_HArray1OfExtendedString(0, xaoField->countComponents()-1);
+ for (int j = 0; j < xaoField->countComponents(); ++j)
+ {
+ components->SetValue(j, (TCollection_ExtendedString)xaoField->getComponentName(j).c_str());
+ }
+
+ Handle(GEOM_Field) field = myFieldOperations->CreateField(shape,
+ xaoField->getName().c_str(),
+ (int)xaoField->getType(),
+ (int)xaoField->getDimension(),
+ components);
+
+ switch (xaoField->getType())
+ {
+ case XAO::BOOLEAN:
+ {
+ XAO::BooleanField* bfield = (XAO::BooleanField*)xaoField;
+ for (int j = 0; j < xaoField->countSteps(); ++j)
+ {
+ XAO::BooleanStep* bstep = bfield->getStep(j);
+ Handle(GEOM_FieldStep) step = field->AddStep(bstep->getStep(), bstep->getStamp());
+
+ Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, bstep->countValues()-1);
+ std::vector<bool> bvalues = bstep->getValues();
+ for (int k = 0; k < bstep->countValues(); ++k)
+ {
+ values->SetValue(k, bvalues[k] ? 1 : 0);
+ }
+ step->SetValues(values);
+ }
+ break;
+ }
+ case XAO::INTEGER:
+ {
+ XAO::IntegerField* ifield = (XAO::IntegerField*)xaoField;
+ for (int j = 0; j < xaoField->countSteps(); ++j)
+ {
+ XAO::IntegerStep* istep = ifield->getStep(j);
+ Handle(GEOM_FieldStep) step = field->AddStep(istep->getStep(), istep->getStamp());
+
+ Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, istep->countValues()-1);
+ std::vector<int> ivalues = istep->getValues();
+ for (int k = 0; k < istep->countValues(); ++k)
+ {
+ values->SetValue(k, ivalues[k]);
+ }
+ step->SetValues(values);
+ }
+ break;
+ }
+ case XAO::DOUBLE:
+ {
+ XAO::DoubleField* dfield = (XAO::DoubleField*)xaoField;
+ for (int j = 0; j < xaoField->countSteps(); ++j)
+ {
+ XAO::DoubleStep* dstep = dfield->getStep(j);
+ Handle(GEOM_FieldStep) step = field->AddStep(dstep->getStep(), dstep->getStamp());
+
+ Handle(TColStd_HArray1OfReal) values = new TColStd_HArray1OfReal(0, dstep->countValues()-1);
+ std::vector<double> dvalues = dstep->getValues();
+ for (int k = 0; k < dstep->countValues(); ++k)
+ {
+ values->SetValue(k, dvalues[k]);
+ }
+ step->SetValues(values);
+ }
+ break;
+ }
+ case XAO::STRING:
+ {
+ XAO::StringField* sfield = (XAO::StringField*)xaoField;
+ for (int j = 0; j < xaoField->countSteps(); ++j)
+ {
+ XAO::StringStep* sstep = sfield->getStep(j);
+ Handle(GEOM_FieldStep) step = field->AddStep(sstep->getStep(), sstep->getStamp());
+
+ Handle(TColStd_HArray1OfExtendedString) values = new TColStd_HArray1OfExtendedString(0, sstep->countValues()-1);
+ std::vector<std::string> svalues = sstep->getValues();
+ for (int k = 0; k < sstep->countValues(); ++k)
+ {
+ values->SetValue(k, TCollection_ExtendedString(svalues[k].c_str()));
+ }
+ step->SetValues(values);
+ }
+ break;
+ }
+ }
+
+ fields->Append(field);
+ }
+
+ // make a Python command
+ GEOM::TPythonDump pd(function);
+ pd << "(imported, " << shape << ", ";
+
+ // list of sub shapes
+ pd << "[";
+ int nbSubshapes = subShapes->Length();
+ if (nbSubshapes > 0)
+ {
+ for (int i = 1; i <= nbSubshapes; i++)
+ {
+ Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(subShapes->Value(i));
+ pd << obj << ((i < nbSubshapes) ? ", " : "");
+ }
+ }
+ pd << "], [";
+
+ // list of groups
+ if (nbGroups > 0)
+ {
+ for (int i = 1; i <= nbGroups; i++)
+ {
+ Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(groups->Value(i));
+ pd << obj << ((i < nbGroups) ? ", " : "");
+ }
+ }
+
+ pd << "], [";
+
+ // list of fields
+ if (nbFields > 0)
+ {
+ for (int i = 1; i <= nbFields; i++)
+ {
+ Handle(GEOM_Field) obj = Handle(GEOM_Field)::DownCast(fields->Value(i));
+ pd << obj << ((i < nbFields) ? ", " : "");
+ }
+ }
+ pd << "]";
+ pd << ") = geompy.ImportXAO(\"" << fileName << "\")";
+
+ delete xaoObject;
+ SetErrorCode(OK);
+
+ return true;
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : XAOPlugin_IOperations.hxx
+
+#ifndef _XAOPlugin_IOperations_HXX_
+#define _XAOPlugin_IOperations_HXX_
+
+// internal includes
+#include "XAOPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOMImpl_IBaseIEOperations.hxx"
+#include "GEOM_Object.hxx"
+#include "GEOM_Field.hxx"
+
+#include <list>
+
+namespace XAO {
+ class Geometry;
+ class BrepGeometry;
+ class Xao;
+}
+
+class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+{
+public:
+ XAOPlugin_IOperations( GEOM_Engine*, int );
+ ~XAOPlugin_IOperations();
+
+ bool ExportXAO( Handle(GEOM_Object) shape,
+ std::list<Handle(GEOM_Object)> groupList,
+ std::list<Handle(GEOM_Field)> fieldList,
+ const char* author,
+ const char* fileName );
+
+ bool ImportXAO( const char* fileName,
+ Handle(GEOM_Object)& shape,
+ Handle(TColStd_HSequenceOfTransient)& subShapes,
+ Handle(TColStd_HSequenceOfTransient)& groups,
+ Handle(TColStd_HSequenceOfTransient)& fields );
+
+private:
+ void importSubShapes( XAO::Geometry* xaoGeometry,
+ Handle(GEOM_Function) function,
+ int shapeType,
+ int dim,
+ Handle(TColStd_HSequenceOfTransient)& subshapeList );
+ void exportSubshapes( const Handle(GEOM_Object)& shape,
+ XAO::BrepGeometry* geometry );
+ void exportFields( std::list<Handle(GEOM_Field)> fieldList,
+ XAO::Xao* xaoObject,
+ XAO::BrepGeometry* geometry );
+ void exportGroups( std::list<Handle(GEOM_Object)> groupList,
+ XAO::Xao* xaoObject,
+ XAO::BrepGeometry* geometry );
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_IOperations_i.hh"
+#include "XAOPlugin_IOperations.hxx"
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+XAOPlugin_IOperations_i::XAOPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ XAOPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "XAOPlugin_IOperations_i::XAOPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+XAOPlugin_IOperations_i::~XAOPlugin_IOperations_i()
+{
+ MESSAGE( "XAOPlugin_IOperations_i::~XAOPlugin_IOperations_i" );
+}
+
+//=============================================================================
+/*!
+ * Export a shape to XAO format
+ * \param shape The shape to export
+ * \param groups The list of groups to export
+ * \param fields The list of fields to export
+ * \param author The author of the export
+ * \param fileName The name of the exported file
+ * \return boolean indicating if export was succeful.
+ */
+//=============================================================================
+CORBA::Boolean XAOPlugin_IOperations_i::ExportXAO( GEOM::GEOM_Object_ptr shape,
+ const GEOM::ListOfGO& groups,
+ const GEOM::ListOfFields& fields,
+ const char* author,
+ const char* fileName)
+{
+ bool isGood = false;
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Get the reference shape
+ Handle(GEOM_Object) reference = GetObjectImpl( shape );
+
+ // Get the reference groups
+ int ind = 0;
+ std::list<Handle(GEOM_Object)> groupsObj;
+ for (; ind < groups.length(); ind++)
+ {
+ Handle(GEOM_Object) gobj = GetObjectImpl( groups[ind] );
+ if (gobj.IsNull()) return false;
+ groupsObj.push_back(gobj);
+ }
+
+ // Get the reference fields
+ ind = 0;
+ std::list<Handle(GEOM_Field)> fieldsObj;
+ for( ; ind < fields.length(); ind++ )
+ {
+ Handle(GEOM_Field) fobj = Handle(GEOM_Field)::DownCast( GetBaseObjectImpl( fields[ind] ) );
+ if( fobj.IsNull() ) return false;
+ fieldsObj.push_back(fobj);
+ }
+
+ if( !reference.IsNull() )
+ {
+ // Export XAO
+ isGood = GetOperations()->ExportXAO( reference, groupsObj, fieldsObj, author, fileName );
+ }
+
+ return isGood;
+}
+
+//=============================================================================
+/*!
+ * Import a shape from XAO format
+ * \param fileName The name of the file to import
+ * \param shape The imported shape
+ * \param subShapes The list of imported subShapes
+ * \param groups The list of imported groups
+ * \param fields The list of imported fields
+ * \return boolean indicating if import was succeful.
+ */
+//=============================================================================
+CORBA::Boolean XAOPlugin_IOperations_i::ImportXAO( const char* fileName,
+ GEOM::GEOM_Object_out shape,
+ GEOM::ListOfGO_out subShapes,
+ GEOM::ListOfGO_out groups,
+ GEOM::ListOfFields_out fields)
+{
+ GEOM::GEOM_Object_var vshape;
+ shape = vshape._retn();
+
+ subShapes = new GEOM::ListOfGO;
+ groups = new GEOM::ListOfGO;
+ fields = new GEOM::ListOfFields;
+
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ Handle(TColStd_HSequenceOfTransient) importedSubShapes = new TColStd_HSequenceOfTransient();
+ Handle(TColStd_HSequenceOfTransient) importedGroups = new TColStd_HSequenceOfTransient();
+ Handle(TColStd_HSequenceOfTransient) importedFields = new TColStd_HSequenceOfTransient();
+ Handle(GEOM_Object) hshape;
+ bool res = GetOperations()->ImportXAO( fileName, hshape, importedSubShapes, importedGroups, importedFields );
+
+ if( !GetOperations()->IsDone() || !res )
+ return false;
+
+ // parse fields
+ int n = importedSubShapes->Length();
+ subShapes->length(n);
+ for( int i = 1; i <= n; i++ )
+ {
+ (*subShapes)[i - 1] = GetObject( Handle(GEOM_Object)::DownCast( importedSubShapes->Value(i) ) );
+ }
+
+ // parse groups
+ n = importedGroups->Length();
+ groups->length(n);
+ for( int i = 1; i <= n; i++ )
+ {
+ (*groups)[i - 1] = GetObject( Handle(GEOM_Object)::DownCast( importedGroups->Value(i) ) );
+ }
+
+ // parse fields
+ n = importedFields->Length();
+ fields->length(n);
+ for( int i = 1; i <= n; i++ )
+ {
+ (*fields)[i - 1] = GEOM::GEOM_Field::_narrow(
+ GetBaseObject( Handle(GEOM_Field)::DownCast( importedFields->Value(i) ) ) );
+ }
+
+ shape = GetObject( hshape );
+
+ return res;
+}
+
+XAOPlugin_IOperations* XAOPlugin_IOperations_i::GetOperations()
+{
+ return (XAOPlugin_IOperations*)GetImpl();
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _XAOPlugin_IOperations_i_HeaderFile
+#define _XAOPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( XAOPlugin )
+
+// internal includes
+#include "XAOPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_IOperations_i.hh"
+
+class XAOPlugin_IOperations;
+
+class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations_i :
+ public virtual POA_GEOM::IXAOOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ XAOPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ XAOPlugin_IOperations* theImpl );
+ ~XAOPlugin_IOperations_i();
+
+ CORBA::Boolean ExportXAO( GEOM::GEOM_Object_ptr shape,
+ const GEOM::ListOfGO& groups,
+ const GEOM::ListOfFields& fields,
+ const char* author,
+ const char* fileName );
+
+ CORBA::Boolean ImportXAO( const char* fileName,
+ GEOM::GEOM_Object_out shape,
+ GEOM::ListOfGO_out subShapes,
+ GEOM::ListOfGO_out groups,
+ GEOM::ListOfFields_out fields );
+
+ XAOPlugin_IOperations* GetOperations();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_ImportDlg.h"
+#include "XAOPlugin_IOperations_i.hh"
+
+// KERNEL includes
+#include <SALOMEDS_wrap.hxx>
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_FileDlg.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "GEOM_Field.hxx"
+#include "GEOMImpl_Types.hxx"
+
+// OCCT Includes
+#include <TopoDS_Shape.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
+// QT includes
+#include <QLabel>
+#include <QLineEdit>
+#include <QButtonGroup>
+#include <QListWidget>
+#include <QFileDialog>
+#include <QRadioButton>
+#include <QGroupBox>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QMap>
+
+//=================================================================================
+// Constructor
+//=================================================================================
+XAOPlugin_ImportDlg::XAOPlugin_ImportDlg(GeometryGUI* geometryGUI, QWidget* parent)
+:
+ GEOMBase_Skeleton(geometryGUI, parent, false)
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("XAOPLUGIN_IMPORT_ICON")));
+ QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+ setWindowTitle(tr("XAOPLUGIN_IMPORT_TITLE"));
+
+ /***************************************************************/
+ mainFrame()->GroupConstructors->setTitle(tr("XAOPLUGIN_IMPORT_TITLE"));
+ mainFrame()->RadioButton1->setIcon(imageOp);
+ mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton3->close();
+
+ // hide name
+ mainFrame()->GroupBoxName->hide();
+
+ //****************************
+ // Selection Group box
+ QGroupBox* gbxExport = new QGroupBox(parent);
+
+ QGridLayout* gridLayoutExport = new QGridLayout(gbxExport);
+#ifndef Q_OS_MAC
+ gridLayoutExport->setSpacing(6);
+ gridLayoutExport->setContentsMargins(9, 9, 9, 9);
+#endif
+ gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
+
+ int line = 0, col = 0;
+ QLabel* lblFileName = new QLabel(tr("XAOPLUGIN_IMPORT_FILENAME"), gbxExport);
+ btnFileSelect = new QPushButton(gbxExport);
+ ledFileName = new QLineEdit(gbxExport);
+ btnFileSelect->setText("...");
+
+ line++; col = 0;
+ gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1);
+ gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1);
+ gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1);
+
+ //****************************
+ QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+ layout->setMargin(0);
+ layout->setSpacing(6);
+ layout->addWidget(gbxExport);
+
+ // set help
+ setHelpFileName("xao_format_page.html");
+
+ Init();
+}
+
+//=================================================================================
+// Destructor
+//=================================================================================
+XAOPlugin_ImportDlg::~XAOPlugin_ImportDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void XAOPlugin_ImportDlg::Init()
+{
+ // Signal/slot connections
+ connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+ connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked()));
+
+ initName(tr("XAOPLUGIN_IMPORTXAO"));
+ //SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose :
+//=================================================================================
+void XAOPlugin_ImportDlg::ClickOnOk()
+{
+ setIsApplyAndClose(true);
+ if (ClickOnApply())
+ ClickOnCancel();
+ setIsApplyAndClose(false);
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+bool XAOPlugin_ImportDlg::ClickOnApply()
+{
+ if(!isApplyAndClose()) {
+ setIsDisableBrowsing( true );
+ setIsDisplayResult( false );
+ }
+
+ QString msg;
+ if ( !isValid( msg ) ) {
+ showError( msg );
+ return false;
+ }
+ SUIT_OverrideCursor wc;
+ SUIT_Session::session()->activeApplication()->putInfo( "" );
+
+ try {
+ if ( openCommand() )
+ if (!execute (/*isApplyAndClose()*/))
+ {
+ abortCommand();
+ showError();
+ return false;
+ }
+ }
+ catch( const SALOME::SALOME_Exception& e ) {
+ SalomeApp_Tools::QtCatchCorbaException( e );
+ abortCommand();
+ return false;
+ }
+ commitCommand();
+
+ if(!isApplyAndClose()) {
+ setIsDisableBrowsing( false );
+ setIsDisplayResult( true );
+ }
+
+ return true;
+}
+
+//=================================================================================
+// function : btnFileSelectClicked()
+// purpose :
+//=================================================================================
+void XAOPlugin_ImportDlg::btnFileSelectClicked()
+{
+ QString file = SUIT_FileDlg::getFileName(this, ledFileName->text(),
+ tr("XAOPLUGIN_FILES"),
+ tr("XAOPLUGIN_IMPORT_SELECT"));
+ if ( !file.isEmpty() )
+ ledFileName->setText( file );
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void XAOPlugin_ImportDlg::ActivateThisDialog()
+{
+ GEOMBase_Skeleton::ActivateThisDialog();
+}
+
+//=================================================================================
+// function : enterEvent [REDEFINED]
+// purpose :
+//=================================================================================
+void XAOPlugin_ImportDlg::enterEvent(QEvent*)
+{
+ if (!mainFrame()->GroupConstructors->isEnabled())
+ ActivateThisDialog();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr XAOPlugin_ImportDlg::createOperation()
+{
+ return getGeomEngine()->GetPluginOperations( getStudyId(), "XAOPluginEngine" );
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool XAOPlugin_ImportDlg::isValid(QString& msg)
+{
+ // check file name
+ if (ledFileName->text().isEmpty())
+ return false;
+
+ return true;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool XAOPlugin_ImportDlg::execute()
+{
+ bool res = false;
+
+ QString fileName = ledFileName->text();
+ GEOM::GEOM_Object_var shape;
+ GEOM::ListOfGO_var groups, subShapes;
+ GEOM::ListOfFields_var fields;
+
+ GEOM::IXAOOperations_var ieOp = GEOM::IXAOOperations::_narrow(getOperation());
+ res = ieOp->ImportXAO(fileName.toUtf8().constData(), shape, subShapes, groups, fields);
+
+ if (!shape->_is_nil())
+ {
+ m_mainShape = shape;
+ }
+ else
+ {
+ m_mainShape = NULL;
+ }
+
+ if (m_mainShape != NULL)
+ {
+ QStringList anEntryList;
+ anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
+ for (int i = 0; i < subShapes->length(); i++)
+ {
+ addInStudy(subShapes[i].in(), subShapes[i]->GetName());
+ }
+ for (int i = 0; i < groups->length(); i++)
+ {
+ addInStudy(groups[i].in(), groups[i]->GetName());
+ }
+ for (int i = 0; i < fields->length(); i++)
+ {
+ addFieldInStudy(fields[i].in(), m_mainShape);
+ }
+
+ updateObjBrowser();
+ if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) {
+ LightApp_Application* aLightApp = dynamic_cast<LightApp_Application*>( anApp );
+ aLightApp->browseObjects( anEntryList );
+ }
+ }
+
+ return res;
+}
+
+QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEOM::GEOM_Object_ptr theFather)
+{
+ if ( !hasCommand() )
+ return QString();
+
+ _PTR(Study) aStudy = getStudy()->studyDS();
+ 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);
+
+ QString anEntry;
+ if ( !aSO->_is_nil() ) {
+ CORBA::String_var entry = aSO->GetID();
+ anEntry = entry.in();
+ }
+
+ // add steps
+ GEOM::ListOfLong_var steps = theField->GetSteps();
+ for (int i = 0; i < steps->length(); ++i)
+ {
+ 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 );
+ }
+
+ aSO->UnRegister();
+
+ return anEntry;
+}
+
+GEOM::GEOM_Object_ptr XAOPlugin_ImportDlg::getFather(GEOM::GEOM_Object_ptr object)
+{
+ GEOM::GEOM_Object_var fatherObj;
+ if (object->GetType() != GEOM_IMPORT && m_mainShape != NULL)
+ {
+ //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(getStudyId());
+ //fatherObj = groupOper->GetMainShape(object);
+ fatherObj = m_mainShape;
+ }
+ return fatherObj._retn();
+}
+
+QString XAOPlugin_ImportDlg::getObjectName(GEOM::GEOM_Object_ptr object) const
+{
+ if (object->_is_nil())
+ return QString::null;
+ return object->GetName();
+}
+
--- /dev/null
+// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef XAOPlugin_ImportDlg_H
+#define XAOPlugin_ImportDlg_H
+
+// GEOM includes
+#include "GEOMBase_Skeleton.h"
+
+class QLineEdit;
+class QButtonGroup;
+class QListWidget;
+
+//=================================================================================
+// class : XAOPlugin_ImportDlg
+// purpose :
+//=================================================================================
+class XAOPlugin_ImportDlg: public GEOMBase_Skeleton
+{
+ Q_OBJECT
+
+public:
+ XAOPlugin_ImportDlg(GeometryGUI*, QWidget* = 0);
+ ~XAOPlugin_ImportDlg();
+
+protected:
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid( QString& );
+ virtual bool execute();
+ virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr object );
+ virtual QString getObjectName( GEOM::GEOM_Object_ptr object ) const;
+ virtual QString addFieldInStudy( GEOM::GEOM_Field_ptr theField,
+ GEOM::GEOM_Object_ptr theFather );
+
+private:
+ void Init();
+ void enterEvent(QEvent*);
+
+private:
+ QLineEdit* ledFileName;
+ QPushButton* btnFileSelect;
+ GEOM::GEOM_Object_var m_mainShape;
+
+private slots:
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void btnFileSelectClicked();
+};
+
+#endif // XAOPlugin_ImportDlg_H
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// internal includes
+#include "XAOPlugin_OperationsCreator.hxx"
+#include "XAOPlugin_IOperations_i.hh"
+#include "XAOPlugin_IOperations.hxx"
+#include "XAOPlugin_Driver.hxx"
+#include "XAOPlugin_IECallBack.hxx"
+
+// KERNEL includes
+#include <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, XAOPlugin_IOperations*> XAOPlugin_OperationsCreator::_mapOfOperations;
+
+XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( XAOPlugin_Driver::GetID(),
+ new XAOPlugin_Driver() );
+
+ // Register callback
+ GEOMImpl_IECallBack::Register( "XAO", new XAOPlugin_IECallBack() );
+}
+
+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 ) );
+}
+
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new XAOPlugin_IOperations( theGenImpl, theStudyId );
+ return _mapOfOperations[theStudyId];
+}
--- /dev/null
+// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _GEOM_XAOPlugin_OperationsCreator_HXX_
+#define _GEOM_XAOPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "XAOPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class XAOPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class XAOPLUGINENGINE_EXPORT XAOPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ XAOPlugin_OperationsCreator();
+ ~XAOPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+private:
+ static XAOPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+private:
+ static std::map <int, XAOPlugin_IOperations*> _mapOfOperations;
+
+ friend class XAOPlugin_IECallBack;
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>XAOPLUGIN_EXPORT_ICON</source>
+ <translation>exportxao.png</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_ICON</source>
+ <translation>importxao.png</translation>
+ </message>
+ <!-- @@ insert new functions before this line @@ do not remove this line @@ -->
+ </context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTXAO</source>
+ <translation>XAO</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTXAO</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTXAO</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTXAO</source>
+ <translation>XAO</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTXAO</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTXAO</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_SELECT</source>
+ <translation>Import from XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_SELECT</source>
+ <translation>Export to XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_FILES</source>
+ <translation>XAO files (*.xao)</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ExportDlg</name>
+ <message>
+ <source>XAOPLUGIN_EXPORT_TITLE</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORTXAO</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_INGSHAPE</source>
+ <translation>Shape</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_FILENAME</source>
+ <translation>File Name</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_AUTHOR</source>
+ <translation>Author</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LGROUPS</source>
+ <translation>Groups</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LFIELDS</source>
+ <translation>Fields</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ImportDlg</name>
+ <message>
+ <source>XAOPLUGIN_IMPORT_TITLE</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORTXAO</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_INGSHAPE</source>
+ <translation>Shape</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_FILENAME</source>
+ <translation>File Name</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LGROUPS</source>
+ <translation>Groups</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LFIELDS</source>
+ <translation>Fields</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_STEP</source>
+ <translation>Step</translation>
+ </message>
+</context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_US">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTXAO</source>
+ <translation>XAO</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTXAO</source>
+ <translation>Exporter XAO</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTXAO</source>
+ <translation>Exporter XAO</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTXAO</source>
+ <translation>XAO</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTXAO</source>
+ <translation>Importer XAO</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTXAO</source>
+ <translation>Importer XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_SELECT</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_SELECT</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_FILES</source>
+ <translation>Fichiers XAO (*.xao)</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ExportDlg</name>
+ <message>
+ <source>XAOPLUGIN_EXPORT_TITLE</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORTXAO</source>
+ <translation>Export XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_INGSHAPE</source>
+ <translation>Objet</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_FILENAME</source>
+ <translation>Fichier</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_AUTHOR</source>
+ <translation>Auteur</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LGROUPS</source>
+ <translation>Groupes</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LFIELDS</source>
+ <translation>Champs</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ImportDlg</name>
+ <message>
+ <source>XAOPLUGIN_IMPORT_TITLE</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORTXAO</source>
+ <translation>Import XAO</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_INGSHAPE</source>
+ <translation>Objet</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_FILENAME</source>
+ <translation>Fichier</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LGROUPS</source>
+ <translation>Groupes</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LFIELDS</source>
+ <translation>Champs</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_STEP</source>
+ <translation>Pas</translation>
+ </message>
+</context>
+</TS>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+<context>
+ <name>@default</name>
+ <message>
+ <source>MEN_EXPORTXAO</source>
+ <translation>エクスポートしました。</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORTXAO</source>
+ <translation>エクスポートしました。</translation>
+ </message>
+ <message>
+ <source>STB_EXPORTXAO</source>
+ <translation>ソテーした形式でフォームをエクスポートします。</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORTXAO</source>
+ <translation>インポートしました。</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORTXAO</source>
+ <translation>インポートしました。</translation>
+ </message>
+ <message>
+ <source>STB_IMPORTXAO</source>
+ <translation>ソテーしたフォームをインポートします。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_SELECT</source>
+ <translation>XAOからインポート</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_SELECT</source>
+ <translation>エクスポートしました。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_FILES</source>
+ <translation>ファイルした (*.xao)</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ExportDlg</name>
+ <message>
+ <source>XAOPLUGIN_EXPORT_TITLE</source>
+ <translation>エクスポートしました。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORTXAO</source>
+ <translation>エクスポートしました。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_INGSHAPE</source>
+ <translation>オブジェクト</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_FILENAME</source>
+ <translation>ファイル</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_AUTHOR</source>
+ <translation>作成者</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LGROUPS</source>
+ <translation>グループ</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_EXPORT_LFIELDS</source>
+ <translation>フィールド</translation>
+ </message>
+</context>
+<context>
+ <name>XAOPlugin_ImportDlg</name>
+ <message>
+ <source>XAOPLUGIN_IMPORT_TITLE</source>
+ <translation>インポートしました。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORTXAO</source>
+ <translation>インポートしました。</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_INGSHAPE</source>
+ <translation>オブジェクト</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_FILENAME</source>
+ <translation>ファイル</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LGROUPS</source>
+ <translation>グループ</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_IMPORT_LFIELDS</source>
+ <translation>フィールド</translation>
+ </message>
+ <message>
+ <source>XAOPLUGIN_STEP</source>
+ <translation>Step</translation>
+ </message>
+</context>
+</TS>
\ No newline at end of file