-This is the version 1.4.0 of GEOM
+This is the version 2.0.0 of GEOM
Compatible with :
- - KERNEL 1.4.0
+ - KERNEL 2.0.0
@COMMENCE@
-SUBDIRS = idl src
+SUBDIRS = idl src doc
RESOURCES_FILES = \
GEOM_en.xml \
GEOM_fr.xml \
+GEOM.config \
GEOMCatalog.xml \
GEOMDS_Resources \
arc.png \
# test if SALOMEconfig.h has changed (contents)
salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
@if ! [ -a $@ ]; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
if ! cmp $< $@; then \
- cp -p $< $@; \
+ cp -p -f $< $@; \
fi; \
include/salome/sstream: salome_adm/unix/sstream
install-include: $(include_list)
$(INSTALL) -d $(includedir)
- @for f in X $(include_list); do \
- if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(includedir)/. || exit 1); \
- fi; \
+ @for f in X $(include_list); do \
+ if test $$f != X; then \
+ ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
+ fi; \
done
# install script in $(bindir) :
# C++
CXX = @CXX@
-CXXFLAGS = @CXXFLAGS@
+CXXFLAGS = @CXXFLAGS@ -Wparentheses -Wreturn-type -Wmissing-declarations -Winline
CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@
# JAVA
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
-OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@
OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
CORBA_LIBS = @CORBA_LIBS@
CORBA_CXXFLAGS = @CORBA_CXXFLAGS@
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@
IDL = @IDL@
sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
incmakedir=${prefix}/salome_adm/unix
-docdir=$(datadir)/doc
+docdir=${prefix}/doc/salome
#
# begin of package rules
#
-.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
-THIS IS SALOME - GEOM VERSION: 1.4.0
+THIS IS SALOME - GEOM VERSION: 2.0.0
# Created from configure.in.base
#
+
AC_INIT(src)
AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
AC_CANONICAL_HOST
fi
# make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
-cd bin
+mkdir -p bin/salome
+cd bin/salome
+
for i in $ROOT_SRCDIR/bin/*
do
local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
case "$local_bin" in
*.in | *~) ;;
- ./bin/CVS) ;;
- *) ln -fs $i; echo $local_bin ;;
+ ./bin/CVS | ./bin/salome) ;;
+ *) /usr/bin/install -C $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR
srcdir=@srcdir@
VPATH=.:@srcdir@
-SUBDIRS=html
+SUBDIRS= salome
-doc:
+@COMMENCE@
+
+docs:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
+
+uninstall:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME - GEOM - v.1.4.0"
+PROJECT_NAME = "SALOME - GEOM - v.2.0.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English
-foldersTree = gFld("<b>SALOME v.1.4.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.2.0.0 </b>", "", "")
insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
--- /dev/null
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+
+ <meta name="GENERATOR"
+ content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+ <title>Geometry Module Documentation</title>
+</head>
+ <body bgcolor="#cccccc" text="#000000" link="#0000ee" alink="#0000ee"
+ vlink="#551a8b">
+
+<div align="center">
+<center>
+<center>
+ </center>
+
+<table width="96%" align="center">
+ <tbody>
+ <tr>
+ <td><a href="http://www.opencascade.com"><img
+ src="tui/GEOM/sources/logocorp.gif" border="0" height="46" width="122">
+ </a></td>
+ <td>
+
+ <div align="right"><a href="http://www.opencascade.org/SALOME/"><img
+ src="tui/GEOM/sources/application.gif" border="0" height="46" width="108">
+ </a></div>
+ </td>
+ </tr>
+
+ </tbody>
+</table>
+
+<div align="center">
+<center>
+<hr width="100%" size="2">
+<h1>Geometry MODULE Documentation</h1>
+ </center>
+ </div>
+
+<table width="96%">
+ <tbody>
+
+ </tbody>
+</table>
+ </center>
+
+<div align="center">
+<p> <img src="tui/GEOM/sources/Application-About.png"
+ alt="Application-About.png" width="30%" height="20%">
+ </p>
+ </div>
+
+<center>
+<table width="96%">
+ <tbody>
+
+ </tbody>
+</table>
+ <br>
+ <br>
+ <br>
+ </center>
+
+<address> </address>
+
+<center><big><a href="gui/GEOM/geom.html">GUI Documentation</a></big></center>
+
+<address> </address>
+
+<center></center>
+
+<center><br>
+ </center>
+
+<address> </address>
+
+<center><big><a href="tui/GEOM/index.html">TUI Documentation</a></big></center>
+
+<address> </address>
+
+<center></center>
+
+<center><br>
+ <br>
+ </center>
+ </div>
+ <br>
+ <br>
+ <br>
+</body>
+</html>
--- /dev/null
+
+# -* Makefile *-
+#
+# Author : Patrick GOLDBRONN (CEA)
+# Date : 30/11/2001
+# $Header$
+#
+# source path
+top_srcdir=@top_srcdir@
+top_builddir=../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@
+
+SUBDIRS= tui gui
+
+@COMMENCE@
+
+docs:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done; \
+ cp -f $(srcdir)/GEOM_index.html GEOM_index.html
+
+clean:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
+
+distclean: clean
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
+
+install:
+ $(MAKE) docs
+ (cd tui && $(MAKE) install);
+ (cd gui && $(MAKE) install);
+ cp -f GEOM_index.html $(docdir)
+
+uninstall:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done; \
+ rm -fr $(docdir)/GEOM_index.html
--- /dev/null
+# Copyright (C) 2003 CEA/DEN, EDF R&D
+#
+#
+#
+# File : Makefile.in
+# Author : Vasily Rusyaev (Open Cascade NN)
+# Module : doc
+# $Header:
+
+top_srcdir=@top_srcdir@
+top_builddir=../../..
+srcdir=@srcdir@
+VPATH=.:@srcdir@
+
+@COMMENCE@
+
+docs:
+ cp -fr $(srcdir)/GEOM ./
+ -find $(PWD) -name CVS -exec rm -rf {} \;
+
+clean:
+ rm -fr `ls | grep -v "Makefile"`
+
+distclean: clean
+ rm -fr GEOM
+
+install:
+ mkdir -p $(docdir)/gui
+ cp -rf GEOM $(docdir)/gui
+ -find $(PWD) -name CVS -exec rm -rf {} \;
+
+uninstall:
+ rm -rf $(docdir)/gui/GEOM
in DirStruct dstruct,
in double major_radius,
in double minor_radius) raises (SALOME::SALOME_Exception) ;
-
+
+ //-----------------------------------------------------------//
+ // Sketcher //
+ //-----------------------------------------------------------//
+ GEOM_Shape MakeSketcher (in string Cmd) raises (SALOME::SALOME_Exception) ;
+
//-----------------------------------------------------------//
// Primitives Construction //
//-----------------------------------------------------------//
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
-VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome
+VPATH=.:${KERNEL_ROOT_DIR}/idl/salome
@COMMENCE@
PY_CLIENT_IDL = $(IDL_FILES)
# we copy all idl file in $(top_builddir)/idl
-inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
+inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
+$(top_builddir)/idl/salome:
+ mkdir $@
+
+$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
# $(CP) $< $@
- cp -f $< $@
+ cp -f $^ $(top_builddir)/idl/salome
lib: pyidl
$(PYTHON_BUILD_SITE):
$(INSTALL) -d $@
-$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
+$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
install: install-pyidl install-idl
# create directory $(idldir) and copy idl files into it
-install-idl: $(IDL_FILES)
+install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(idldir)
$(INSTALL_DATA) $^ $(idldir)
-install-pyidl: $(IDL_FILES)
+install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(PYTHON_SITE_INSTALL)
@for file in $^ dummy; do \
if [ $$file != "dummy" ]; then \
distclean:
-$(RM) *.py
- -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
+ -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(RM) Makefile
--- /dev/null
+language=en
\ No newline at end of file
<endsubmenu />
<separator pos-id=""/>
<popup-item item-id="404" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <submenu label-id="Sketch Constraints" item-id="405" pos-id="">
- <popup-item item-id="4051" pos-id="" label-id="Set Plane" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="4052" pos-id="" label-id="Tangent" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4053" pos-id="" label-id="Perpendicular" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
- <endsubmenu />
- <submenu label-id="Sketch Options" item-id="406" pos-id="">
- <popup-item item-id="4061" pos-id="" label-id="Length Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
- <popup-item item-id="4062" pos-id="" label-id="Angle Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
- <popup-item item-id="4063" pos-id="" label-id="Radius Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
- <popup-item item-id="4064" pos-id="" label-id="X Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
- <popup-item item-id="4065" pos-id="" label-id="Y Dimension" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
- </submenu>
- <endsubmenu />
<separator pos-id=""/>
<popup-item item-id="407" pos-id="" label-id="Explode" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<submenu label-id="Build" item-id="408" pos-id="">
<popup-item item-id="901" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
-<popupmenu label-id="Sketch" context-id="Sketch" parent-id="Viewer" object-id="">
- <popup-item item-id="4041" pos-id="" label-id="Segment" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
- <popup-item item-id="4042" pos-id="" label-id="Arc" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="4043" pos-id="" label-id="Set Angle" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4044" pos-id="" label-id="Set X" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4045" pos-id="" label-id="Set Y" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="4046" pos-id="" label-id="Undo" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="4047" pos-id="" label-id="End" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4048" pos-id="" label-id="Close" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-</popupmenu>
-
</desktop> <!-- DESKTOP END -->
</application> <!-- APPLICATION END -->
</menu-item>
<!-- ************************* New Entity (menubar) ******************************* -->
-<menu-item label-id="Nouvelle entité" item-id="30" pos-id="3">
- <submenu label-id="Construction basique" item-id="301" pos-id="1">
- <popup-item item-id="3011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3012" pos-id="" label-id="Ligne" icon-id="line.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3013" pos-id="" label-id="Cercle" icon-id="circle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+<menu-item label-id="Nouvelle entité" item-id="40" pos-id="3">
+ <submenu label-id="Construction basique" item-id="401" pos-id="1">
+ <popup-item item-id="4011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4012" pos-id="" label-id="Ligne" icon-id="line.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4013" pos-id="" label-id="Cercle" icon-id="circle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id="6"/>
- <popup-item item-id="3016" pos-id="" label-id="Vecteur" icon-id="vector.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3017" pos-id="" label-id="Plan" icon-id="plane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3018" pos-id="" label-id="Plan de travail" icon-id="planeWorking.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4016" pos-id="" label-id="Vecteur" icon-id="vector.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4017" pos-id="" label-id="Plan" icon-id="plane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4018" pos-id="" label-id="Plan de travail" icon-id="planeWorking.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
- <submenu label-id="Primitives" item-id="302" pos-id="2">
- <popup-item item-id="3021" pos-id="" label-id="Boite" icon-id="box.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3022" pos-id="" label-id="Cylindre" icon-id="cylinder.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3023" pos-id="" label-id="Sphère" icon-id="sphere.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="3024" pos-id="" label-id="Tore" icon-id="torus.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-
+ <submenu label-id="Primitives" item-id="402" pos-id="2">
+ <popup-item item-id="4021" pos-id="" label-id="Boite" icon-id="box.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4022" pos-id="" label-id="Cylindre" icon-id="cylinder.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4023" pos-id="" label-id="Sphère" icon-id="sphere.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4024" pos-id="" label-id="Tore" icon-id="torus.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4025" pos-id="" label-id="Cone" icon-id="cone.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ </submenu>
+ <endsubmenu />
+ <submenu label-id="Generation" item-id="403" pos-id="3">
+ <popup-item item-id="4031" pos-id="" label-id="Extrusion" icon-id="prism.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4032" pos-id="" label-id="Revolution" icon-id="revol.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4033" pos-id="" label-id="Filling" icon-id="filling.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4034" pos-id="" label-id="Pipe" icon-id="pipe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
- <popup-item item-id="303" pos-id="" label-id="Eclater" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="309" pos-id="" label-id="Supprime des faces" icon-id="supressface.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="314" pos-id="" label-id="Supprime un trou" icon-id="supresshole.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <endsubmenu />
<separator pos-id=""/>
- <popup-item item-id="304" pos-id="" label-id="Arête" icon-id="build_edge.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="305" pos-id="" label-id="Wire" icon-id="build_wire.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="306" pos-id="" label-id="Face" icon-id="build_face.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="308" pos-id="" label-id="Compound" icon-id="build_compound.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="404" pos-id="" label-id="Sketch" icon-id="sketch.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id=""/>
+ <popup-item item-id="407" pos-id="" label-id="Eclater" icon-id="subshape.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <submenu label-id="Construction" item-id="408" pos-id="">
+ <popup-item item-id="4081" pos-id="" label-id="Arête" icon-id="build_edge.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4082" pos-id="" label-id="Wire" icon-id="build_wire.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4083" pos-id="" label-id="Face" icon-id="build_face.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4084" pos-id="" label-id="Shell" icon-id="build_shell.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4085" pos-id="" label-id="Solid" icon-id="build_solid.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="4086" pos-id="" label-id="Compound" icon-id="build_compound.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ </submenu>
+ <endsubmenu />
</menu-item>
<!-- ************************ Operations (menubar) *********************************** -->
-<menu-item label-id="Opérations" item-id="40" pos-id="4">
- <submenu label-id="Booléennes" item-id="401" pos-id="1">
- <popup-item item-id="4011" pos-id="" label-id="Union" icon-id="fuse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4012" pos-id="" label-id="Commun" icon-id="common.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4013" pos-id="" label-id="Couper" icon-id="cut.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4014" pos-id="" label-id="Section" icon-id="section.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+<menu-item label-id="Opérations" item-id="50" pos-id="4">
+ <submenu label-id="Booléennes" item-id="501" pos-id="1">
+ <popup-item item-id="5011" pos-id="" label-id="Union" icon-id="fuse.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5012" pos-id="" label-id="Commun" icon-id="common.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5013" pos-id="" label-id="Couper" icon-id="cut.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5014" pos-id="" label-id="Section" icon-id="section.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
- <submenu label-id="Transformation" item-id="402" pos-id="2">
- <popup-item item-id="4021" pos-id="" label-id="Translation" icon-id="translation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4022" pos-id="" label-id="Rotation" icon-id="rotate.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4023" pos-id="" label-id="Symétrie par un plan" icon-id="mirrorPlane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4024" pos-id="" label-id="Facteur d'échelle" icon-id="scale.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>\r
- <popup-item item-id="4030" pos-id="" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>\r
- <popup-item item-id="4040" pos-id="" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>\r
- </submenu>
- <endsubmenu />
- <submenu label-id="Construction" item-id="403" pos-id="3">
- <popup-item item-id="4031" pos-id="" label-id="Extrusion" icon-id="prism.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4032" pos-id="" label-id="Révolution" icon-id="revol.png"tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4033" pos-id="" label-id="Filling" icon-id="filling.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4034" pos-id="" label-id="Pipe création ?" icon-id="pipe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <submenu label-id="Transformation" item-id="502" pos-id="2">
+ <popup-item item-id="5021" pos-id="" label-id="Translation" icon-id="translation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5022" pos-id="" label-id="Rotation" icon-id="rotate.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5023" pos-id="" label-id="Symétrie par un plan" icon-id="mirrorPlane.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5024" pos-id="" label-id="Facteur d'échelle" icon-id="scale.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id=""/>
+ <popup-item item-id="5025" pos-id="" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5026" pos-id="" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
- <popup-item item-id="4025" pos-id="" label-id="Partition" icon-id="partition.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4026" pos-id="" label-id="Archimede" icon-id="archimede.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4027" pos-id="" label-id="Congé" icon-id="fillet.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4028" pos-id="" label-id="Chanfrein" icon-id="chamfer.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="503" pos-id="" label-id="Partition" icon-id="partition.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="504" pos-id="" label-id="Archimede" icon-id="archimede.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id=""/>
+ <popup-item item-id="505" pos-id="" label-id="Congé" icon-id="fillet.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="506" pos-id="" label-id="Chanfrein" icon-id="chamfer.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Advanced (menubar) ************************************** -->
-<menu-item label-id="Avancé" item-id="50" pos-id="5">
- <popup-item item-id="501" pos-id="" label-id="Couture" icon-id="sewing.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="502" pos-id="" label-id="Orientation" icon-id="orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+<menu-item label-id="Avancé" item-id="60" pos-id="5">
+ <popup-item item-id="601" pos-id="" label-id="Couture" icon-id="sewing.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="602" pos-id="" label-id="Orientation" icon-id="orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="603" pos-id="" label-id="Suppression de faces" icon-id="supressface.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="604" pos-id="" label-id="Suppression de trou" icon-id="supresshole.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Mesures (menubar) ************************************ -->
-<menu-item label-id="Mesures" item-id="60" pos-id="6">
- <popup-item item-id="601" pos-id="" label-id="Fondamentales" icon-id="linear.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id="4"/>
- <popup-item item-id="604" pos-id="" label-id="Centre de gravité" icon-id="centergravity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="605" pos-id="" label-id="Axes d'inertie" icon-id="axisinertia.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id="7"/>
- <submenu label-id="Dimensions" item-id="606" pos-id="8">
- <popup-item item-id="6060" pos-id="" label-id="Boite englobante" icon-id="bounding.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="6061" pos-id="" label-id="Distance minimale" icon-id="mindist.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
+<menu-item label-id="Mesures" item-id="70" pos-id="6">
+ <popup-item item-id="701" pos-id="" label-id="Fondamentales" icon-id="linear.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id="4"/>
+ <popup-item item-id="702" pos-id="" label-id="Centre de gravité" icon-id="centergravity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="703" pos-id="" label-id="Axes d'inertie" icon-id="axisinertia.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id="7"/>
+ <submenu label-id="Dimensions" item-id="704" pos-id="8">
+ <popup-item item-id="7041" pos-id="" label-id="Boite englobante" icon-id="bounding.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="7042" pos-id="" label-id="Distance minimale" icon-id="mindist.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ </submenu>
<endsubmenu />
<separator pos-id="9"/>
- <popup-item item-id="607" pos-id="" label-id="Tolérance" icon-id="tolerance.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="705" pos-id="" label-id="Tolérance" icon-id="tolerance.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
- <popup-item item-id="608" pos-id="" label-id="Whatis" icon-id="whatis.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="609" pos-id="" label-id="Check" icon-id="check.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="706" pos-id="" label-id="Whatis" icon-id="whatis.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="707" pos-id="" label-id="Check" icon-id="check.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ********************************* Tools (menubar) ************************************ -->
<menu-item label-id="Outils" item-id="5" pos-id="">
<separator pos-id=""/>
- <popup-item item-id="5001" pos-id="" label-id="Check Géométrie" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5103" pos-id="" label-id="Check Géométrie" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="5104" pos-id="" label-id="Charger Script" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ********************************* Settings (menubar) ********************************* -->
-<menu-item label-id="Préférences" item-id="4" pos-id="">
- <submenu label-id="Géométry" item-id="40" pos-id="-1">
- <popup-item item-id="701" pos-id="" label-id="Avec copie" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="702" pos-id="" label-id="Nommer/Ranger automatiquement" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="703" pos-id="" label-id="Couleur" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="704" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="705" pos-id="" label-id="Valeur d'increment" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+<menu-item label-id="Préférences" item-id="4" pos-id="">
+ <submenu label-id="Géométry" item-id="41" pos-id="-1">
+ <popup-item item-id="411" pos-id="" label-id="Nommer/Ranger automatiquement" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <separator pos-id=""/>
+ <popup-item item-id="412" pos-id="" label-id="Couleur" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="413" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="414" pos-id="" label-id="Valeur d'increment" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id="-1"/>
<!-- ***************************** View (menubar) ************************************ -->
<menu-item label-id="Affichage" item-id="2" pos-id="">
- <submenu label-id="Mode d'affichage" item-id="21" pos-id="6">
- <popup-item item-id="6021" pos-id="" label-id="Ombré" icon-id="shading.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <submenu label-id="Mode d'affichage" item-id="21" pos-id="5">
+ <popup-item item-id="211" pos-id="" label-id="Ombré" icon-id="shading.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
- <popup-item item-id="6022" pos-id="" label-id="Afficher tout" icon-id="displayall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="6023" pos-id="" label-id="Afficher seulement" icon-id="display.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="6024" pos-id="" label-id="Effacer tout" icon-id="eraseall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="6025" pos-id="" label-id="Effacer seulement" icon-id="erase.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="212" pos-id="" label-id="Afficher tout" icon-id="displayall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="213" pos-id="" label-id="Afficher seulement" icon-id="display.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="214" pos-id="" label-id="Effacer tout" icon-id="eraseall.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="215" pos-id="" label-id="Effacer seulement" icon-id="erase.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
- <separator pos-id="7"/>
</menu-item>
</menubar> <!-- MENUBAR END -->
<!-- ///////////////////////////////////// TOOLBARS ////////////////////////////////////// -->
<toolbar label-id="Construction basique">
- <toolbutton-item item-id="3011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="Point" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3012" pos-id="" label-id="Ligne" icon-id="line.png" tooltip-id="Ligne" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3013" pos-id="" label-id="Cercle" icon-id="circle.png" tooltip-id="Cercle" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="Ellipse" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="Arc" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3016" pos-id="" label-id="Vecteur" icon-id="vector.png" tooltip-id="Vecteur" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3017" pos-id="" label-id="Plan" icon-id="plane.png" tooltip-id="Plan" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3018" pos-id="" label-id="Plan de travail" icon-id="planeWorking.png" tooltip-id="Plan de travail" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4011" pos-id="" label-id="Point" icon-id="point2.png" tooltip-id="Point" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4012" pos-id="" label-id="Ligne" icon-id="line.png" tooltip-id="Ligne" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4013" pos-id="" label-id="Cercle" icon-id="circle.png" tooltip-id="Cercle" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4014" pos-id="" label-id="Ellipse" icon-id="ellipse.png" tooltip-id="Ellipse" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4015" pos-id="" label-id="Arc" icon-id="arc.png" tooltip-id="Arc" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4016" pos-id="" label-id="Vecteur" icon-id="vector.png" tooltip-id="Vecteur" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4017" pos-id="" label-id="Plan" icon-id="plane.png" tooltip-id="Plan" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4018" pos-id="" label-id="Plan de travail" icon-id="planeWorking.png" tooltip-id="Plan de travail" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Primitives">
- <toolbutton-item item-id="3021" label-id="Boite" icon-id="box.png" tooltip-id="Construction d'une boite" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3022" label-id="Cylindre" icon-id="cylinder.png" tooltip-id="Construction d'un cylindre" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3023" label-id="Sphère" icon-id="sphere.png" tooltip-id="Construction d'une sphère" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="3024" label-id="Tore" icon-id="torus.png" tooltip-id="Construction d'un tore" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4021" label-id="Boite" icon-id="box.png" tooltip-id="Construction d'une boite" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4022" label-id="Cylindre" icon-id="cylinder.png" tooltip-id="Construction d'un cylindre" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4023" label-id="Sphère" icon-id="sphere.png" tooltip-id="Construction d'une sphère" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4024" label-id="Tore" icon-id="torus.png" tooltip-id="Construction d'un tore" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4025" label-id="Cone" icon-id="cone.png" tooltip-id="Cone" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
-<toolbar label-id="Opé. Booléennes">
- <toolbutton-item item-id="4011" label-id="Union" icon-id="fuse.png" tooltip-id="Union de deux shapes" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4012" label-id="Commun" icon-id="common.png" tooltip-id="Partie commune entre deux shapes" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4013" label-id="Couper" icon-id="cut.png" tooltip-id="Coupe la première shape par la seconde" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4014" label-id="Section" icon-id="section.png" tooltip-id="Section entre deux shapes" accel-id="" toggle-id="" execute-action=""/>
+<toolbar label-id="Opé. Booléennes">
+ <toolbutton-item item-id="5011" label-id="Union" icon-id="fuse.png" tooltip-id="Union de deux shapes" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5012" label-id="Commun" icon-id="common.png" tooltip-id="Partie commune entre deux shapes" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5013" label-id="Couper" icon-id="cut.png" tooltip-id="Coupe la première shape par la seconde" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5014" label-id="Section" icon-id="section.png" tooltip-id="Section entre deux shapes" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Construction">
<toolbutton-item item-id="4031" label-id="Extrusion" icon-id="prism.png" tooltip-id="Shape construite par extrusion" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4032" label-id="Révolution" icon-id="revol.png" tooltip-id="Shape construite par révolution" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4033" pos-id="" label-id="'Filling'" icon-id="filling.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="4034" pos-id="" label-id="'Pipe' création" icon-id="pipe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4032" label-id="Révolution" icon-id="revol.png" tooltip-id="Shape construite par révolution" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4033" label-id="Filling" icon-id="filling.png" tooltip-id="Generation by filling" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="4034" label-id="Pipe" icon-id="pipe.png" tooltip-id="Pipe mode generation" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Transformation">
- <toolbutton-item item-id="4021" label-id="Translation" icon-id="translation.png" tooltip-id="Translation d'une shape"accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4022" label-id="Rotation" icon-id="rotate.png" tooltip-id="Rotation d'une shape" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4023" label-id="Symétrie" icon-id="mirrorPlane.png" tooltip-id="Symétrie" accel-id="" toggle-id="" execute-action=""/>
- <toolbutton-item item-id="4024" label-id="Facteur d'échelle" icon-id="scale.png" tooltip-id="Facteur d'échelle" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5021" label-id="Translation" icon-id="translation.png" tooltip-id="Translation d'une shape"accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5022" label-id="Rotation" icon-id="rotate.png" tooltip-id="Rotation d'une shape" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5023" label-id="Symétrie" icon-id="mirrorPlane.png" tooltip-id="Symétrie" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5024" label-id="Facteur d'échelle" icon-id="scale.png" tooltip-id="Facteur d'échelle" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
- <toolbutton-item item-id="4030" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="Multi-translation d'une shape" accel-id="" toggle-id="" execute-action=""/>\r
- <toolbutton-item item-id="4040" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="Multi-rotation d'une shape" accel-id="" toggle-id="" execute-action=""/>\r
+ <toolbutton-item item-id="5025" label-id="Multi-Translation" icon-id="multitranslation.png" tooltip-id="Multi-translation d'une shape" accel-id="" toggle-id="" execute-action=""/>
+ <toolbutton-item item-id="5026" label-id="Multi-Rotation" icon-id="multirotation.png" tooltip-id="Multi-rotation d'une shape" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<!-- ################################# POPUP MENU ################################# -->
<popupmenu label-id="Menu contextuel du Viewer" context-id="" parent-id="Viewer" object-id="">
- <submenu label-id="Propriétés" item-id="803" pos-id="6">
- <popup-item item-id="8021" pos-id="" label-id="Filaire/Ombré" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <submenu label-id="Propriétés" item-id="803" pos-id="6">
+ <popup-item item-id="8031" pos-id="" label-id="Filaire/Ombré" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
- <popup-item item-id="8031" pos-id="" label-id="Couleur" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="8032" pos-id="" label-id="Transparence" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="8033" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="8032" pos-id="" label-id="Couleur" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="8033" pos-id="" label-id="Transparence" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="8034" pos-id="" label-id="Isos" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
- <popup-item item-id="801" pos-id="" label-id="Ajouter dans l'étude" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="804" pos-id="" label-id="Ajouter dans l'étude" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Menu contextuel" context-id="" parent-id="ObjectBrowser" object-id="">
<popup-item item-id="9024" pos-id="" label-id="Ouverture" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
- <popup-item item-id="901" pos-id="2" label-id="Renommer" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-</popupmenu>
-
-<popupmenu label-id="Sketch" context-id="Sketch" parent-id="Viewer" object-id="">
- <popup-item item-id="10000" pos-id="" label-id="Segment" icon-id="" tooltip-id="" accel-id="" toggle-id="true" execute-action=""/>
- <popup-item item-id="10001" pos-id="" label-id="Arc" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="10002" pos-id="" label-id="Set Angle" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="10003" pos-id="" label-id="Set X" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="10004" pos-id="" label-id="Set Y" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="10006" pos-id="" label-id="Undo" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <separator pos-id=""/>
- <popup-item item-id="10007" pos-id="" label-id="End" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- <popup-item item-id="10008" pos-id="" label-id="Close" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+ <popup-item item-id="901" pos-id="" label-id="Renommer" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
</desktop> <!-- DESKTOP END -->
min = Zmin;
max = Zmax;
}
+
gp_Pln PlaneOfTheView = gp_Pln(AtPoint,EyeDir);
Standard_Real X, Y, Z;
- aView->Convert(x, y, X, Y, Z);
+ aView->Convert(int(x), int(y), X, Y, Z);
gp_Pnt ConvertedPoint(X, Y, Z);
gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project(PlaneOfTheView, ConvertedPoint);
// Module : GEOM
// $Header$
-using namespace std;
#include "BasicGUI_ArcDlg.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BasicGUI_ArcDlg()
// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
//=================================================================================
void BasicGUI_ArcDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "BasicGUI_CircleDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BasicGUI_CircleDlg()
// purpose : Constructs a BasicGUI_CircleDlg which is a child of 'parent', with the
//=================================================================================
void BasicGUI_CircleDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "BasicGUI_EllipseDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BasicGUI_EllipseDlg()
// purpose : Constructs a BasicGUI_EllipseDlg which is a child of 'parent', with the
//=================================================================================
void BasicGUI_EllipseDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "BasicGUI_LineDlg.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRep_Builder.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BasicGUI_LineDlg()
// purpose : Constructs a BasicGUI_LineDlg which is a child of 'parent', with the
//=================================================================================
void BasicGUI_LineDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "BasicGUI_PlaneDlg.h"
#include <BRepBuilderAPI_MakeFace.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BasicGUI_PlaneDlg()
// purpose : Constructs a BasicGUI_PlaneDlg which is a child of 'parent', with the
//=================================================================================
void BasicGUI_PlaneDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_PointDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_VectorDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void BasicGUI_WorkingPlaneDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkPlane)
myBasicGUI->MakeWorkingPlane(myLoc, myDir);
GroupCut = new DlgRef_2Sel_QTD(this, "GroupCut");
GroupCut->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
- GroupCut->TextLabel1->setText(tr("GEOM_OBJECT_I").arg("1"));
- GroupCut->TextLabel2->setText(tr("GEOM_OBJECT_I").arg("2"));
+ GroupCut->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
+ GroupCut->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupCut->PushButton1->setPixmap(image1);
GroupCut->PushButton2->setPixmap(image1);
// Module : GEOM
// $Header$
-using namespace std;
#include "BuildGUI_EdgeDlg.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BuildGUI_EdgeDlg()
// purpose : Constructs a BuildGUI_EdgeDlg which is a child of 'parent', with the
GroupPoints = new DlgRef_1Sel1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_FACE_FFW"));
- GroupPoints->TextLabel1->setText(tr("GEOM_WIRE"));
+ GroupPoints->TextLabel1->setText(tr("GEOM_WIRES"));
GroupPoints->CheckButton1->setText(tr("GEOM_FACE_OPT"));
GroupPoints->PushButton1->setPixmap(image1);
myEditCurrentArgument = GroupShell->LineEdit1;
myOkListShapes = false;
- myFaceFilter = new GEOM_FaceFilter(StdSelect_Plane, myGeom);
+ myFaceFilter = new GEOM_ShapeTypeFilter(TopAbs_FACE, myGeom);
/* Filter for the next selection */
mySelection->AddFilter(myFaceFilter) ;
//=================================================================================
void BuildGUI_ShellDlg::SetEditCurrentArgument()
{
- QPushButton* send = (QPushButton*)sender();
- mySelection->ClearFilters() ;
+ mySelection->ClearFilters();
GroupShell->LineEdit1->setFocus();
- myEditCurrentArgument = GroupShell->LineEdit1;
mySelection->AddFilter(myFaceFilter);
this->SelectionIntoArgument();
return;
#include "BuildGUI.h"
-#include "GEOM_FaceFilter.hxx"
+#include "GEOM_ShapeTypeFilter.hxx"
//=================================================================================
// class : BuildGUI_ShellDlg
BuildGUI* myBuildGUI;
- Handle(GEOM_FaceFilter) myFaceFilter; /* Filters selection */
+ Handle(GEOM_ShapeTypeFilter) myFaceFilter; /* Filters selection */
GEOM::GEOM_Gen::ListOfIOR myListShapes;
bool myOkListShapes; /* to check when arguments is defined */
void ClickOnOk();
void ClickOnApply();
void SetEditCurrentArgument();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void ActivateThisDialog();
// Module : GEOM
// $Header:
-using namespace std;
#include "DisplayGUI.h"
#include "QAD_RightFrame.h"
#include <AIS_ListIteratorOfListOfInteractive.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : DisplayGUI()
// purpose : Constructor
if(theIO.IsNull())
MESSAGE("BuildPresentation(): null SALOME_InteractiveObject passed")
+ Standard_Boolean testResult;
+ GEOM::GEOM_Shape_var myGeomShape = myDisplayGUI->myGeomBase->ConvertIOinGEOMShape(theIO, testResult);
+ if(!testResult)
+ return;
+
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
// VTK
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
- LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
-
- Layout1->addWidget( LineEdit2, 1, 2 );
-
- PushButton4 = new QPushButton( GroupBox1, "PushButton4" );
- PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
- PushButton4->setText( trUtf8( "" ) );
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
- Layout1->addWidget( PushButton4, 4, 1 );
+ Layout1->addWidget( TextLabel1, 0, 0 );
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
PushButton1->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
- LineEdit4 = new QLineEdit( GroupBox1, "LineEdit4" );
-
- Layout1->addWidget( LineEdit4, 4, 2 );
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
- PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
- PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
- PushButton3->setText( trUtf8( "" ) );
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
- Layout1->addWidget( PushButton3, 3, 1 );
+ Layout1->addWidget( TextLabel2, 1, 0 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
PushButton2->setText( trUtf8( "" ) );
Layout1->addWidget( PushButton2, 1, 1 );
+
+ LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
- TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
- TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
- TextLabel1->setText( trUtf8( "TL1" ) );
+ Layout1->addWidget( LineEdit2, 1, 2 );
- Layout1->addWidget( TextLabel1, 0, 0 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+
+ ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
+ ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
- TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ Layout1->addWidget( ComboBox1, 2, 2 );
+
+
+ GroupBox1Layout->addLayout( Layout1, 0, 0 );
+
+ DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+
+ GroupBox2 = new QGroupBox( this, "GroupBox2" );
+ GroupBox2->setTitle( trUtf8( "" ) );
+ GroupBox2->setColumnLayout(0, Qt::Vertical );
+ GroupBox2->layout()->setSpacing( 6 );
+ GroupBox2->layout()->setMargin( 11 );
+ GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
+ GroupBox2Layout->setAlignment( Qt::AlignTop );
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ TextLabel4 = new QLabel( GroupBox2, "TextLabel4" );
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
TextLabel4->setText( trUtf8( "TL4" ) );
-
- Layout1->addWidget( TextLabel4, 3, 0 );
+
+ Layout2->addWidget( TextLabel4, 0, 0 );
QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
Layout1->addItem( spacer, 5, 2 );
- LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
-
- Layout1->addWidget( LineEdit1, 0, 2 );
+ PushButton3 = new QPushButton( GroupBox2, "PushButton3" );
+ PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
+ PushButton3->setText( trUtf8( "" ) );
- TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
- TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
- TextLabel5->setText( trUtf8( "TL5" ) );
+ Layout2->addWidget( PushButton3, 0, 1 );
- Layout1->addWidget( TextLabel5, 4, 0 );
+ LineEdit3 = new QLineEdit( GroupBox2, "LineEdit3" );
- LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
+ Layout2->addWidget( LineEdit3, 0, 2 );
- Layout1->addWidget( LineEdit3, 3, 2 );
- TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
- TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
- TextLabel2->setText( trUtf8( "TL2" ) );
-
- Layout1->addWidget( TextLabel2, 1, 0 );
+ TextLabel5 = new QLabel( GroupBox2, "TextLabel5" );
+ TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
+ TextLabel5->setText( trUtf8( "TL5" ) );
- ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
- ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
+ Layout2->addWidget( TextLabel5, 1, 0 );
- Layout1->addWidget( ComboBox1, 2, 2 );
+ PushButton4 = new QPushButton( GroupBox2, "PushButton4" );
+ PushButton4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton4->sizePolicy().hasHeightForWidth() ) );
+ PushButton4->setText( trUtf8( "" ) );
- TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
- TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
- TextLabel3->setText( trUtf8( "TL3" ) );
+ Layout2->addWidget( PushButton4, 1, 1 );
- Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+ LineEdit4 = new QLineEdit( GroupBox2, "LineEdit4" );
- GroupBox1Layout->addLayout( Layout1, 0, 0 );
+ Layout2->addWidget( LineEdit4, 1, 2 );
- DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox1, 0, 0 );
+ GroupBox2Layout->addLayout( Layout2, 0, 0 );
+
+ DlgRef_4Sel1List_QTDLayout->addWidget( GroupBox2, 1, 0 );
}
/*
~DlgRef_4Sel1List_QTD();
QGroupBox* GroupBox1;
+ QGroupBox* GroupBox2;
QLineEdit* LineEdit2;
QPushButton* PushButton4;
QPushButton* PushButton1;
protected:
QGridLayout* DlgRef_4Sel1List_QTDLayout;
QGridLayout* GroupBox1Layout;
+ QGridLayout* GroupBox2Layout;
QGridLayout* Layout1;
+ QGridLayout* Layout2;
};
#endif // DLGREF_4SEL1LIST_QTD_H
/****************************************************************************
** Form implementation generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
-** Created: mar sep 23 15:06:58 2003
+** Created: Fri Apr 16 12:57:26 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
#include <qvariant.h>
#include <qbuttongroup.h>
#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qlayout.h>
{
if ( !name )
setName( "DlgRef_Skeleton_QTD" );
- resize( 307, 147 );
+ resize( 321, 295 );
setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
setCaption( trUtf8( "DlgRef_Skeleton_QTD" ) );
setSizeGripEnabled( TRUE );
Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+ GroupMedium = new QGroupBox( this, "GroupMedium" );
+ GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
+ GroupMedium->setTitle( trUtf8( "" ) );
+
+ Layout1->addWidget( GroupMedium, 2, 0 );
+
GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
GroupButtons->setTitle( trUtf8( "" ) );
Layout3->addWidget( buttonCancel );
GroupButtonsLayout->addLayout( Layout3 );
- Layout1->addWidget( GroupButtons, 2, 0 );
+ Layout1->addWidget( GroupButtons, 3, 0 );
GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
Layout1->addWidget( GroupConstructors, 0, 0 );
- GroupMedium = new QGroupBox( this, "GroupMedium" );
- GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
- GroupMedium->setTitle( trUtf8( "" ) );
+ GroupBoxName = new QGroupBox( this, "GroupBoxName" );
+ GroupBoxName->setTitle( trUtf8( "Result name" ) );
+ GroupBoxName->setColumnLayout(0, Qt::Vertical );
+ GroupBoxName->layout()->setSpacing( 6 );
+ GroupBoxName->layout()->setMargin( 11 );
+ GroupBoxNameLayout = new QGridLayout( GroupBoxName->layout() );
+ GroupBoxNameLayout->setAlignment( Qt::AlignTop );
+
+ Layout66 = new QGridLayout( 0, 1, 1, 0, 6, "Layout66");
+
+ ResultName = new QLineEdit( GroupBoxName, "ResultName" );
+
+ Layout66->addWidget( ResultName, 0, 1 );
+
+ NameLabel = new QLabel( GroupBoxName, "NameLabel" );
+ NameLabel->setText( trUtf8( "Name" ) );
+
+ Layout66->addWidget( NameLabel, 0, 0 );
+
+ GroupBoxNameLayout->addLayout( Layout66, 0, 0 );
- Layout1->addWidget( GroupMedium, 1, 0 );
+ Layout1->addWidget( GroupBoxName, 1, 0 );
DlgRef_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
}
/****************************************************************************
** Form interface generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
-** Created: mar sep 23 15:06:57 2003
+** Created: Fri Apr 16 12:57:26 2004
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
class QGridLayout;
class QButtonGroup;
class QGroupBox;
+class QLabel;
+class QLineEdit;
class QPushButton;
class QRadioButton;
DlgRef_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~DlgRef_Skeleton_QTD();
+ QGroupBox* GroupMedium;
QGroupBox* GroupButtons;
QPushButton* buttonOk;
QPushButton* buttonApply;
QRadioButton* RadioButton1;
QRadioButton* RadioButton2;
QRadioButton* RadioButton3;
- QGroupBox* GroupMedium;
+ QGroupBox* GroupBoxName;
+ QLineEdit* ResultName;
+ QLabel* NameLabel;
protected:
QHBoxLayout* Layout3;
QGridLayout* GroupConstructorsLayout;
QHBoxLayout* Layout2;
+ QGridLayout* GroupBoxNameLayout;
+ QGridLayout* Layout66;
};
#endif // DLGREF_SKELETON_QTD_H
<rect>
<x>0</x>
<y>0</y>
- <width>307</width>
- <height>147</height>
+ <width>321</width>
+ <height>295</height>
</rect>
</property>
<property name="sizePolicy">
<number>6</number>
</property>
<widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>GroupMedium</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0">
<property name="name">
<cstring>GroupButtons</cstring>
</property>
</widget>
<widget class="QGroupBox" row="1" column="0">
<property name="name">
- <cstring>GroupMedium</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <cstring>GroupBoxName</cstring>
</property>
<property name="title">
- <string></string>
+ <string>Result name</string>
</property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout66</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>ResultName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>NameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
</widget>
</grid>
</widget>
// Module : GEOM
// $Header:
-using namespace std;
#include "EntityGUI.h"
#include "QAD_RightFrame.h"
#include "SALOMEGUI_ImportOperation.h"
#include "SALOMEGUI_QtCatchCorbaException.hxx"
-#include <BRepTools_WireExplorer.hxx>
-#include <TopoDS_Wire.hxx>
#include <TopoDS_Compound.hxx>
-#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
-#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
-#include <Geom_Circle.hxx>
-#include <Precision.hxx>
#include "DisplayGUI.h"
-#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+
+#include "EntityGUI_SketcherDlg.h" // Sketcher
+#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+
+#include "utilities.h"
+
+using namespace std;
//=======================================================================
// function : EntityGUI()
myGeomBase = new GEOMBase();
myGeomGUI = GEOMContext::GetGeomGUI();
myGeom = myGeomGUI->myComponentGeom;
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
}
myEntityGUI->myGeomGUI->EmitSignalDeactivateDialog();
SALOME_Selection* Sel = SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveStudy()->getSelection());
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
-
switch (theCommandID)
{
case 404: // SKETCHER
{
((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->onViewTop(); // DCQ : 28/02/2002
-
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
-
- myEntityGUI->myGeomGUI->GetSketcher() = Sketch(v3d->getViewer3d());
- myEntityGUI->myGeomGUI->myState = 2;
-
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
-
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(LENGTH_PARAMETER, Mb->isItemChecked(4061));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(ANGLE_PARAMETER, Mb->isItemChecked(4062));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(RADIUS_PARAMETER, Mb->isItemChecked(4063));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(XVALUE_PARAMETER, Mb->isItemChecked(4064));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(YVALUE_PARAMETER, Mb->isItemChecked(4065));
-
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- break;
- }
- case 4041: // SKETCH Segment
- {
- myEntityGUI->myGeomGUI->GetSketcher().ChangeMode(SEGMENT);
- break;
- }
- case 4042: // SKETCH Arc
- {
- myEntityGUI->myGeomGUI->GetSketcher().ChangeMode(ARC_CHORD);
- break;
- }
- case 4043: // SKETCH Set Angle
- {
- myEntityGUI->OnSketchSetAngle();
- break;
- }
- case 4044: // SKETCH Set X
- {
- myEntityGUI->OnSketchSetx();
- break;
- }
- case 4045: // SKETCH Set Y
- {
- myEntityGUI->OnSketchSety();
- break;
- }
- case 4046: // SKETCH Delete
- {
- myEntityGUI->OnSketchDelete();
- break;
- }
- case 4047: // SKETCH End
- {
- myEntityGUI->OnSketchEnd();
- break;
- }
- case 4048: // SKETCH Close
- {
- myEntityGUI->OnSketchClose();
- break;
- }
- case 4051: // sketcher Set Plane
- {
- //TO DO
- break;
- }
- case 4052: // sketcher TANGENT
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- if(Mb->isItemChecked(theCommandID) == true)
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(TANGENT);
- else
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
-
- Mb->setItemChecked(4053, false);
- break;
- }
- case 4053: // sketcher PERPENDICULAR
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- if(Mb->isItemChecked(theCommandID) == true)
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(PERPENDICULAR);
- else
- myEntityGUI->myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
-
- Mb->setItemChecked(4052, false);
- break;
- }
- case 4061: // SKETCH OptionsOnofflengthdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(LENGTH_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4062: // SKETCH OptionsOnoffangledimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(ANGLE_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4063: // SKETCH OptionsOnoffradiusdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(RADIUS_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4064: // SKETCH OptionsOnoffxdimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(XVALUE_PARAMETER, Mb->isItemChecked(theCommandID));
- break;
- }
- case 4065: // SKETCH OptionsOnoffydimension
- {
- Mb->setItemChecked(theCommandID, !Mb->isItemChecked(theCommandID));
- myEntityGUI->myGeomGUI->GetSketcher().SetParameterVisibility(YVALUE_PARAMETER, Mb->isItemChecked(theCommandID));
+ EntityGUI_SketcherDlg* aDlg = new EntityGUI_SketcherDlg(parent, "", myEntityGUI, Sel);
break;
}
case 407: // EXPLODE : use ic
//=======================================================================
-// function : OnSketchSetAngle()
+// function : OnSketchEnd()
// purpose :
//=======================================================================
-void EntityGUI::OnSketchSetAngle()
+void EntityGUI::OnSketchEnd(const char *Cmd)
{
- Standard_Real anAngle = myGeomGUI->GetSketcher().GetSegmentAngle()/PI180;
- Sketch::fitInResol(anAngle);
- Standard_Boolean res = false;
- QString Value = QString("%1").arg(anAngle);
- anAngle = myGeomBase->Parameter(res, Value, tr("GEOM_MEN_ANGLE"), tr("GEOM_MEN_ENTER_ANGLE"),
- -180.0, +180.0, 6) * PI180;
-
- if(res) {
- myGeomGUI->GetSketcher().SetSegmentAngle(anAngle);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
+ try {
+ GEOM::GEOM_Shape_var result = myGeom->MakeSketcher(Cmd);
+ if(result->_is_nil()) {
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE"));
+ return;
+ }
+ result->NameType(tr("GEOM_WIRE"));
+ if(myGeomBase->Display(result))
+ QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
}
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchSetx()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchSetx()
-{
- Standard_Boolean res = false;
- double X = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_X"), tr("GEOM_MEN_SKETCHER_X"),
- 2.0 * Precision::Confusion(), 1E6, 6);
- if(res)
- myGeomGUI->GetSketcher().SetXDimension(X);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchSety()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchSety()
-{
- Standard_Boolean res = false;
- double Y = myGeomBase->Parameter(res, "0.", tr("GEOM_MEN_Y"), tr("GEOM_MEN_SKETCHER_Y"), 2.0 * Precision::Confusion(), 1E6, 6);
- if(res)
- myGeomGUI->GetSketcher().SetYDimension(Y);
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemChecked(4052, false);
- Mb->setItemChecked(4053, false);
- return;
-}
-
-
-//=======================================================================
-// function : OnSketchDelete()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchDelete()
-{
- if(myGeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
+ catch(const SALOME::SALOME_Exception& S_ex) {
+ QtCatchCorbaException(S_ex);
}
-
- if(myGeomGUI->GetSketcher().Delete())
- myGeomGUI->myState = -1;
return;
}
-//=======================================================================
-// function : OnSketchClose()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchClose()
+//=====================================================================================
+// function : DisplaySimulationShape()
+// purpose : Displays 'this->mySimulationShape' a pure graphical shape from a TopoDS_Shape
+//=====================================================================================
+void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2)
{
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle(AIS_InteractiveContext) myContext = v3d->getAISContext();
-
- TopoDS_Wire W = myGeomGUI->GetSketcher().Close();
- if(!W.IsNull()) {
- GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
- listShapes->length(0);
- unsigned int i = 0;
-
- BRepTools_WireExplorer Ex(W);
- while(Ex.More()) {
- TopoDS_Edge E = Ex.Current();
- gp_Pnt pt1, pt2;
-
- pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
- pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
-
- gp_Pnt CenterPoint;
- Handle(Geom_Curve) Curve;
- Handle(Geom_Circle) Circle;
- gp_Circ Circ;
- Standard_Real First,Last;
-
- Curve = BRep_Tool::Curve(E,First,Last);
- if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
- Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
- Circ = Circle->Circ(); // gp_Circ
+ //NRI DEBUG : 14/02/2002
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
+ return;
- Curve->D0((First + Last) / 2., CenterPoint);
-
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
-
- GEOM::GEOM_Shape_var arc;
-
- try {
- arc = myGeom->MakeArc(pI, pC, pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ try {
+ if(!S1.IsNull()) {
+ /* erase any previous */
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
+
+ mySimulationShape1 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape1->Set(S1);
+ mySimulationShape1->SetColor(Quantity_NOC_RED);
+
+ ic->Deactivate(mySimulationShape1);
+ ic->Display(mySimulationShape1, Standard_False);
+ mySimulationShape1->UnsetColor();
+ }
+ if(!S2.IsNull()) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
- listShapes->length(i+1);
- listShapes[i] = strdup(arc->Name());
- i++;
- }
- else {
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
- GEOM::GEOM_Shape_var segment;
-
- try {
- segment = myGeom->MakeEdge(pI,pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
+ mySimulationShape2 = new AIS_Shape(TopoDS_Shape());
+ mySimulationShape2->Set(S2);
+ mySimulationShape2->SetColor(Quantity_NOC_VIOLET);
- listShapes->length(i+1);
- listShapes[i] = strdup(segment->Name());
- i++;
- }
- Ex.Next();
+ ic->Deactivate(mySimulationShape2);
+ ic->Display(mySimulationShape2, Standard_False);
+ mySimulationShape2->UnsetColor();
}
- GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
- Standard_CString type;
- myGeomBase->GetShapeTypeString(S,type);
- Wire->NameType(type);
-
- if(myGeomBase->Display(Wire))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ ic->UpdateCurrentViewer();
}
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in EntityGUI::DisplaySimulationShape ");
+ }
return;
}
-//=======================================================================
-// function : OnSketchEnd()
-// purpose :
-//=======================================================================
-void EntityGUI::OnSketchEnd()
+//==================================================================================
+// function : EraseSimulationShape()
+// purpose : Clears the display of 'mySimulationShape' a pure graphical shape
+//==================================================================================
+void EntityGUI::EraseSimulationShape(int Sh)
{
- OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
- Handle (AIS_InteractiveContext) myContext = v3d->getAISContext();
-
- TopoDS_Wire W = myGeomGUI->GetSketcher().End();
- if(!W.IsNull()) {
- GEOM::GEOM_Gen::ListOfIOR_var listShapes = new GEOM::GEOM_Gen::ListOfIOR;
- listShapes->length(0);
- unsigned int i = 0;
-
- BRepTools_WireExplorer Ex(W);
- while(Ex.More()) {
- TopoDS_Edge E = TopoDS::Edge(Ex.Current());
-
- gp_Pnt pt1, pt2;
- pt1 = BRep_Tool::Pnt(TopExp::FirstVertex(E));
- pt2 = BRep_Tool::Pnt(TopExp::LastVertex(E));
-
- gp_Pnt CenterPoint;
- Handle(Geom_Curve) Curve;
- Handle(Geom_Circle) Circle;
- gp_Circ Circ;
- Standard_Real First,Last;
-
- Curve = BRep_Tool::Curve(E,First,Last);
- if(Curve->IsKind(STANDARD_TYPE(Geom_Circle))) {
- Circle = Handle(Geom_Circle)::DownCast(Curve); // pointer on geom_circ
- Circ = Circle->Circ(); // gp_Circ
-
- Curve->D0((First + Last) / 2., CenterPoint);
-
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pC = myGeom->MakePointStruct(CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
-
- GEOM::GEOM_Shape_var arc;
-
- try {
- arc = myGeom->MakeArc(pI, pC, pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(arc->Name());
- i++;
- } else {
- GEOM::PointStruct pI = myGeom->MakePointStruct(pt1.X(), pt1.Y(), pt1.Z());
- GEOM::PointStruct pE = myGeom->MakePointStruct(pt2.X(), pt2.Y(), pt2.Z());
- GEOM::GEOM_Shape_var segment;
-
- try {
- segment = myGeom->MakeEdge(pI,pE);
- }
- catch (const SALOME::SALOME_Exception& S_ex) {
- QtCatchCorbaException(S_ex);
- }
-
- listShapes->length(i+1);
- listShapes[i] = strdup(segment->Name());
- i++;
+ int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount();
+ for(int i = 0; i < count; i++) {
+ if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) {
+ OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer();
+ Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
+ if(Sh < 1) {
+ ic->Erase(mySimulationShape1, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape1);
}
- Ex.Next();
- }
-
- GEOM::GEOM_Shape_var Wire = myGeom->MakeWire(listShapes);
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, Wire);
- Standard_CString type;
- myGeomBase->GetShapeTypeString(S,type);
- Wire->NameType(type);
-
- if(myGeomBase->Display(Wire))
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
+ if(Sh <= 1) {
+ ic->Erase(mySimulationShape2, Standard_True, Standard_False);
+ ic->ClearPrs(mySimulationShape2);
+ }
+ ic->UpdateCurrentViewer();
+ }
}
- myGeomGUI->myState = -1;
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, false); // SKETCH CONTRAINTS
- myGeomGUI->GetSketcher().SetTransitionStatus(NOCONSTRAINT);
- return;
}
}
else {
aResult->NameType(tr("GEOM_SHAPE"));
- sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ sprintf(nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
SALOMEDS::SObject_var SO = aStudy->FindObjectIOR(aResult->Name());
}
else {
aResult->NameType(tr("GEOM_SHAPE"));
- sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
result = new GEOM_AISShape(Exp.Current(), nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
else {
if ( myGeomBase->GetShapeTypeString(compound,Type)) {
aResult->NameType(Type);
- sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
+ sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
} else {
aResult->NameType(tr("GEOM_SHAPE"));
- sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
result = new GEOM_AISShape(compound, nameG);
IO = new GEOM_InteractiveObject(aResult->Name(), myGeomGUI->GetFatherior(), "GEOM");
static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
- /* Sketcher management */
- void OnSketchSetAngle();
- void OnSketchSetx();
- void OnSketchSety();
-
- void OnSketchDelete();
- void OnSketchClose();
- void OnSketchEnd();
+ void OnSketchEnd(const char *Cmd);
+
+ void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+ void EraseSimulationShape(int Sh = 0);
/* Methods for sub shapes explode */
bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR);
bool OnSubShapeGetSelected(const TopoDS_Shape& ShapeTopo, const char* ShapeTopoIOR, const int SubShapeType,
Standard_Integer& aLocalContextId, bool& myUseLocalContext);
+ /* AIS shape used only during topo/geom simulations */
+ Handle(AIS_Shape) mySimulationShape1;
+ Handle(AIS_Shape) mySimulationShape2;
+
GEOMBase* myGeomBase;
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: Fri Apr 30 11:23:36 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Sel_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_1Sel_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Sel_QTD::EntityGUI_1Sel_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Sel_QTD" );
+ resize( 245, 110 );
+ setCaption( trUtf8( "EntityGUI_1Sel_QTD" ) );
+ EntityGUI_1Sel_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Sel_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 180, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 1, 2 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+ LineEdit1->setFocusPolicy( QLineEdit::NoFocus );
+
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Sel_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Sel_QTD::~EntityGUI_1Sel_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Sel_QTD.ui'
+**
+** Created: Fri Apr 30 11:23:32 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SEL_QTD_H
+#define ENTITYGUI_1SEL_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+
+class EntityGUI_1Sel_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Sel_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Sel_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QPushButton* PushButton1;
+ QLineEdit* LineEdit1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Sel_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SEL_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_1Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_1Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_1Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_1Spin::EntityGUI_1Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_1Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin::~EntityGUI_1Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_1Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_1SPIN_H
+#define ENTITYGUI_1SPIN_H
+
+#include "EntityGUI_1Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_1Spin : public EntityGUI_1Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_1Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+
+};
+
+#endif // ENTITYGUI_1SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_1Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_1Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_1Spin_QTD::EntityGUI_1Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_1Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_1Spin_QTD" ) );
+ EntityGUI_1Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_1Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_1Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_1Spin_QTD::~EntityGUI_1Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_1Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_1SPIN_QTD_H
+#define ENTITYGUI_1SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_1Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_1Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_1Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+
+
+protected:
+ QGridLayout* EntityGUI_1Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_1SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_2Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_2Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_2Spin::EntityGUI_2Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_2Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin::~EntityGUI_2Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_2Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_2SPIN_H
+#define ENTITYGUI_2SPIN_H
+
+#include "EntityGUI_2Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_2Spin : public EntityGUI_2Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ ~EntityGUI_2Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+
+};
+
+#endif // ENTITYGUI_2SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_2Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_2Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_2Spin_QTD::EntityGUI_2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_2Spin_QTD" );
+ resize( 154, 96 );
+ setCaption( trUtf8( "EntityGUI_2Spin_QTD" ) );
+ EntityGUI_2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_2Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_2Spin_QTD::~EntityGUI_2Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_2Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_2SPIN_QTD_H
+#define ENTITYGUI_2SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_2Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_2Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+
+
+protected:
+ QGridLayout* EntityGUI_2Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_2SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_3Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_3Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_3Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_3Spin::EntityGUI_3Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_3Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+ SpinBox3->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+ SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin::~EntityGUI_3Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_3Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_3SPIN_H
+#define ENTITYGUI_3SPIN_H
+
+#include "EntityGUI_3Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_3Spin : public EntityGUI_3Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+
+};
+
+#endif // ENTITYGUI_3SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_3Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_3Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_3Spin_QTD::EntityGUI_3Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_3Spin_QTD" );
+ resize( 154, 120 );
+ setCaption( trUtf8( "EntityGUI_3Spin_QTD" ) );
+ EntityGUI_3Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_3Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addWidget( TextLabel3, 2, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 82, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 3, 1 );
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_3Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_3Spin_QTD::~EntityGUI_3Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_3Spin_QTD.ui'
+**
+** Created: ven déc 12 11:17:11 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_3SPIN_QTD_H
+#define ENTITYGUI_3SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_3Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_3Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_3Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QLabel* TextLabel2;
+ QLabel* TextLabel1;
+ QSpinBox* SpinBox1;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox3;
+
+
+protected:
+ QGridLayout* EntityGUI_3Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_3SPIN_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include "EntityGUI_4Spin.h"
+
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+
+/*
+ * Constructs a EntityGUI_4Spin which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+EntityGUI_4Spin::EntityGUI_4Spin(QWidget* parent, const char* name, WFlags fl)
+ :EntityGUI_4Spin_QTD(parent, name, fl)
+{
+ SpinBox1->close(TRUE);
+ SpinBox2->close(TRUE);
+ SpinBox3->close(TRUE);
+ SpinBox4->close(TRUE);
+
+ SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
+ Layout1->addWidget(SpinBox_DX, 0, 1);
+
+ SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
+ Layout1->addWidget(SpinBox_DY, 1, 1);
+
+ SpinBox_DZ = new DlgRef_SpinBox(GroupBox1, "SpinBox_DZ");
+ Layout1->addWidget(SpinBox_DZ, 2, 1);
+
+ SpinBox_DS = new DlgRef_SpinBox(GroupBox1, "SpinBox_DS");
+ Layout1->addWidget(SpinBox_DS, 3, 1);
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_4Spin::~EntityGUI_4Spin()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_4Spin.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_4SPIN_H
+#define ENTITYGUI_4SPIN_H
+
+#include "EntityGUI_4Spin_QTD.h"
+#include "DlgRef_SpinBox.h"
+
+class EntityGUI_4Spin : public EntityGUI_4Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin();
+
+ DlgRef_SpinBox* SpinBox_DX;
+ DlgRef_SpinBox* SpinBox_DY;
+ DlgRef_SpinBox* SpinBox_DZ;
+ DlgRef_SpinBox* SpinBox_DS;
+
+};
+
+#endif // ENTITYGUI_4SPIN_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** Created: Fri Apr 30 10:56:21 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_4Spin_QTD.h"
+
+#include <qvariant.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_4Spin_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_4Spin_QTD::EntityGUI_4Spin_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_4Spin_QTD" );
+ resize( 176, 154 );
+ setCaption( trUtf8( "EntityGUI_4Spin_QTD" ) );
+ EntityGUI_4Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_4Spin_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "Values" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QGridLayout( 0, 1, 1, 0, 6, "Layout3");
+
+ Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
+
+ buttonUndo = new QPushButton( GroupBox1, "buttonUndo" );
+ buttonUndo->setText( trUtf8( "Undo" ) );
+
+ Layout2->addWidget( buttonUndo, 1, 0 );
+
+ buttonApply = new QPushButton( GroupBox1, "buttonApply" );
+ buttonApply->setText( trUtf8( "Create" ) );
+
+ Layout2->addWidget( buttonApply, 0, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout2->addItem( spacer, 2, 0 );
+
+ Layout3->addLayout( Layout2, 0, 1 );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ SpinBox3 = new QSpinBox( GroupBox1, "SpinBox3" );
+ SpinBox3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox3->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox3, 2, 1 );
+
+ SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
+ SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox2, 1, 1 );
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+ QSpacerItem* spacer_2 = new QSpacerItem( 0, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer_2, 4, 1 );
+
+ SpinBox4 = new QSpinBox( GroupBox1, "SpinBox4" );
+ SpinBox4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox4->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox4, 3, 1 );
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addWidget( TextLabel3, 2, 0 );
+
+ SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
+ SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( SpinBox1, 0, 1 );
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
+ TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
+ TextLabel4->setText( trUtf8( "TL4" ) );
+
+ Layout1->addWidget( TextLabel4, 3, 0 );
+
+ Layout3->addLayout( Layout1, 0, 0 );
+
+ GroupBox1Layout->addLayout( Layout3, 0, 0 );
+
+ EntityGUI_4Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+ // tab order
+ setTabOrder( buttonUndo, buttonApply );
+ setTabOrder( buttonApply, SpinBox1 );
+ setTabOrder( SpinBox1, SpinBox2 );
+ setTabOrder( SpinBox2, SpinBox3 );
+ setTabOrder( SpinBox3, SpinBox4 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_4Spin_QTD::~EntityGUI_4Spin_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_4Spin_QTD.ui'
+**
+** Created: Fri Apr 30 10:56:17 2004
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_4SPIN_QTD_H
+#define ENTITYGUI_4SPIN_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QGroupBox;
+class QLabel;
+class QPushButton;
+class QSpinBox;
+
+class EntityGUI_4Spin_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_4Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_4Spin_QTD();
+
+ QGroupBox* GroupBox1;
+ QPushButton* buttonUndo;
+ QPushButton* buttonApply;
+ QSpinBox* SpinBox3;
+ QSpinBox* SpinBox2;
+ QLabel* TextLabel2;
+ QSpinBox* SpinBox4;
+ QLabel* TextLabel3;
+ QSpinBox* SpinBox1;
+ QLabel* TextLabel1;
+ QLabel* TextLabel4;
+
+
+protected:
+ QGridLayout* EntityGUI_4Spin_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout3;
+ QGridLayout* Layout2;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_4SPIN_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir1_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Dir1_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir1_QTD::EntityGUI_Dir1_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir1_QTD" );
+ resize( 131, 123 );
+ setCaption( trUtf8( "EntityGUI_Dir1_QTD" ) );
+ EntityGUI_Dir1_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir1_QTDLayout");
+
+ GroupDir1 = new QButtonGroup( this, "GroupDir1" );
+ GroupDir1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDir1->sizePolicy().hasHeightForWidth() ) );
+ GroupDir1->setTitle( trUtf8( "Direction" ) );
+ GroupDir1->setColumnLayout(0, Qt::Vertical );
+ GroupDir1->layout()->setSpacing( 6 );
+ GroupDir1->layout()->setMargin( 11 );
+ GroupDir1Layout = new QGridLayout( GroupDir1->layout() );
+ GroupDir1Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir12 = new QRadioButton( GroupDir1, "RB_Dir12" );
+ RB_Dir12->setText( trUtf8( "Perpendicular" ) );
+
+ Layout1->addWidget( RB_Dir12, 1, 0 );
+
+ RB_Dir13 = new QRadioButton( GroupDir1, "RB_Dir13" );
+ RB_Dir13->setText( trUtf8( "Tangent" ) );
+
+ Layout1->addWidget( RB_Dir13, 2, 0 );
+
+ RB_Dir11 = new QRadioButton( GroupDir1, "RB_Dir11" );
+ RB_Dir11->setText( trUtf8( "Angle" ) );
+
+ Layout1->addWidget( RB_Dir11, 0, 0 );
+
+ RB_Dir14 = new QRadioButton( GroupDir1, "RB_Dir14" );
+ RB_Dir14->setText( trUtf8( "VX-VY" ) );
+
+ Layout1->addWidget( RB_Dir14, 3, 0 );
+
+ GroupDir1Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir1_QTDLayout->addWidget( GroupDir1, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir11, RB_Dir12 );
+ setTabOrder( RB_Dir12, RB_Dir13 );
+ setTabOrder( RB_Dir13, RB_Dir14 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir1_QTD::~EntityGUI_Dir1_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir1_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR1_QTD_H
+#define ENTITYGUI_DIR1_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir1_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir1_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir1_QTD();
+
+ QButtonGroup* GroupDir1;
+ QRadioButton* RB_Dir12;
+ QRadioButton* RB_Dir13;
+ QRadioButton* RB_Dir11;
+ QRadioButton* RB_Dir14;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir1_QTDLayout;
+ QGridLayout* GroupDir1Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR1_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:10 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Dir2_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Dir2_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Dir2_QTD::EntityGUI_Dir2_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Dir2_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Dir2_QTD" ) );
+ EntityGUI_Dir2_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Dir2_QTDLayout");
+
+ GroupDir2 = new QButtonGroup( this, "GroupDir2" );
+ GroupDir2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDir2->sizePolicy().hasHeightForWidth() ) );
+ GroupDir2->setTitle( trUtf8( "Direction" ) );
+ GroupDir2->setColumnLayout(0, Qt::Vertical );
+ GroupDir2->layout()->setSpacing( 6 );
+ GroupDir2->layout()->setMargin( 11 );
+ GroupDir2Layout = new QGridLayout( GroupDir2->layout() );
+ GroupDir2Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Dir22 = new QRadioButton( GroupDir2, "RB_Dir22" );
+ RB_Dir22->setText( trUtf8( "X" ) );
+
+ Layout1->addWidget( RB_Dir22, 1, 0 );
+
+ RB_Dir23 = new QRadioButton( GroupDir2, "RB_Dir23" );
+ RB_Dir23->setText( trUtf8( "Y" ) );
+
+ Layout1->addWidget( RB_Dir23, 2, 0 );
+ QSpacerItem* spacer = new QSpacerItem( 0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer, 3, 0 );
+
+ RB_Dir21 = new QRadioButton( GroupDir2, "RB_Dir21" );
+ RB_Dir21->setText( trUtf8( "Length" ) );
+
+ Layout1->addWidget( RB_Dir21, 0, 0 );
+
+ GroupDir2Layout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Dir2_QTDLayout->addWidget( GroupDir2, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Dir21, RB_Dir22 );
+ setTabOrder( RB_Dir22, RB_Dir23 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Dir2_QTD::~EntityGUI_Dir2_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Dir2_QTD.ui'
+**
+** Created: ven déc 12 11:17:09 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_DIR2_QTD_H
+#define ENTITYGUI_DIR2_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Dir2_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Dir2_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Dir2_QTD();
+
+ QButtonGroup* GroupDir2;
+ QRadioButton* RB_Dir22;
+ QRadioButton* RB_Dir23;
+ QRadioButton* RB_Dir21;
+
+
+protected:
+ QGridLayout* EntityGUI_Dir2_QTDLayout;
+ QGridLayout* GroupDir2Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_DIR2_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Point_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Point_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+EntityGUI_Point_QTD::EntityGUI_Point_QTD( QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Point_QTD" );
+ resize( 124, 106 );
+ setCaption( trUtf8( "EntityGUI_Point_QTD" ) );
+ EntityGUI_Point_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "EntityGUI_Point_QTDLayout");
+
+ GroupPoint = new QButtonGroup( this, "GroupPoint" );
+ GroupPoint->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupPoint->sizePolicy().hasHeightForWidth() ) );
+ GroupPoint->setTitle( trUtf8( "Point" ) );
+ GroupPoint->setColumnLayout(0, Qt::Vertical );
+ GroupPoint->layout()->setSpacing( 6 );
+ GroupPoint->layout()->setMargin( 11 );
+ GroupPointLayout = new QGridLayout( GroupPoint->layout() );
+ GroupPointLayout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ RB_Point2 = new QRadioButton( GroupPoint, "RB_Point2" );
+ RB_Point2->setText( trUtf8( "Relative" ) );
+
+ Layout1->addWidget( RB_Point2, 1, 0 );
+
+ RB_Point1 = new QRadioButton( GroupPoint, "RB_Point1" );
+ RB_Point1->setText( trUtf8( "Absolute" ) );
+
+ Layout1->addWidget( RB_Point1, 0, 0 );
+
+ RB_Point3 = new QRadioButton( GroupPoint, "RB_Point3" );
+ RB_Point3->setText( trUtf8( "Selection" ) );
+
+ Layout1->addWidget( RB_Point3, 2, 0 );
+
+ GroupPointLayout->addLayout( Layout1, 0, 0 );
+
+ EntityGUI_Point_QTDLayout->addWidget( GroupPoint, 0, 0 );
+
+ // tab order
+ setTabOrder( RB_Point1, RB_Point2 );
+ setTabOrder( RB_Point2, RB_Point3 );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Point_QTD::~EntityGUI_Point_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Point_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_POINT_QTD_H
+#define ENTITYGUI_POINT_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QRadioButton;
+
+class EntityGUI_Point_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Point_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~EntityGUI_Point_QTD();
+
+ QButtonGroup* GroupPoint;
+ QRadioButton* RB_Point2;
+ QRadioButton* RB_Point1;
+ QRadioButton* RB_Point3;
+
+
+protected:
+ QGridLayout* EntityGUI_Point_QTDLayout;
+ QGridLayout* GroupPointLayout;
+ QGridLayout* Layout1;
+};
+
+#endif // ENTITYGUI_POINT_QTD_H
--- /dev/null
+/****************************************************************************
+** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:08 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "EntityGUI_Skeleton_QTD.h"
+
+#include <qvariant.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/*
+ * Constructs a EntityGUI_Skeleton_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+EntityGUI_Skeleton_QTD::EntityGUI_Skeleton_QTD( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+{
+ if ( !name )
+ setName( "EntityGUI_Skeleton_QTD" );
+ resize( 317, 276 );
+ setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
+ setCaption( trUtf8( "EntityGUI_Skeleton_QTD" ) );
+ EntityGUI_Skeleton_QTDLayout = new QGridLayout( this, 1, 1, 11, 6, "EntityGUI_Skeleton_QTDLayout");
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ GroupVal = new QGroupBox( this, "GroupVal" );
+ GroupVal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupVal->sizePolicy().hasHeightForWidth() ) );
+ GroupVal->setTitle( trUtf8( "" ) );
+
+ Layout1->addWidget( GroupVal, 2, 0 );
+
+ GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
+ GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
+ GroupConstructors->setTitle( trUtf8( "Element Type" ) );
+ GroupConstructors->setColumnLayout(0, Qt::Vertical );
+ GroupConstructors->layout()->setSpacing( 6 );
+ GroupConstructors->layout()->setMargin( 11 );
+ GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
+ GroupConstructorsLayout->setAlignment( Qt::AlignTop );
+
+ Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
+
+ RadioButton1 = new QRadioButton( GroupConstructors, "RadioButton1" );
+ RadioButton1->setText( trUtf8( "Segment" ) );
+ Layout2->addWidget( RadioButton1 );
+
+ RadioButton2 = new QRadioButton( GroupConstructors, "RadioButton2" );
+ RadioButton2->setText( trUtf8( "Arc" ) );
+ Layout2->addWidget( RadioButton2 );
+
+ GroupConstructorsLayout->addLayout( Layout2, 0, 0 );
+
+ Layout1->addWidget( GroupConstructors, 0, 0 );
+
+ GroupDest = new QGroupBox( this, "GroupDest" );
+ GroupDest->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest->sizePolicy().hasHeightForWidth() ) );
+ GroupDest->setTitle( trUtf8( "Destination" ) );
+ GroupDest->setColumnLayout(0, Qt::Vertical );
+ GroupDest->layout()->setSpacing( 6 );
+ GroupDest->layout()->setMargin( 11 );
+ GroupDestLayout = new QGridLayout( GroupDest->layout() );
+ GroupDestLayout->setAlignment( Qt::AlignTop );
+
+ Layout5 = new QGridLayout( 0, 1, 1, 0, 6, "Layout5");
+
+ GroupDest1 = new QButtonGroup( GroupDest, "GroupDest1" );
+ GroupDest1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupDest1->sizePolicy().hasHeightForWidth() ) );
+ GroupDest1->setTitle( trUtf8( "Type" ) );
+ GroupDest1->setColumnLayout(0, Qt::Vertical );
+ GroupDest1->layout()->setSpacing( 6 );
+ GroupDest1->layout()->setMargin( 11 );
+ GroupDest1Layout = new QGridLayout( GroupDest1->layout() );
+ GroupDest1Layout->setAlignment( Qt::AlignTop );
+
+ Layout4 = new QGridLayout( 0, 1, 1, 0, 6, "Layout4");
+
+ RB_Dest2 = new QRadioButton( GroupDest1, "RB_Dest2" );
+ RB_Dest2->setText( trUtf8( "Direction" ) );
+
+ Layout4->addWidget( RB_Dest2, 0, 1 );
+
+ RB_Dest1 = new QRadioButton( GroupDest1, "RB_Dest1" );
+ RB_Dest1->setText( trUtf8( "Point" ) );
+
+ Layout4->addWidget( RB_Dest1, 0, 0 );
+
+ GroupDest1Layout->addLayout( Layout4, 0, 0 );
+
+ Layout5->addMultiCellWidget( GroupDest1, 0, 0, 0, 1 );
+
+ GroupDest2 = new QButtonGroup( GroupDest, "GroupDest2" );
+ GroupDest2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest2->sizePolicy().hasHeightForWidth() ) );
+ GroupDest2->setTitle( trUtf8( "" ) );
+ GroupDest2->setColumnLayout(0, Qt::Vertical );
+ GroupDest2->layout()->setSpacing( 6 );
+ GroupDest2->layout()->setMargin( 11 );
+ GroupDest2Layout = new QGridLayout( GroupDest2->layout() );
+ GroupDest2Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest2, 1, 0 );
+
+ GroupDest3 = new QButtonGroup( GroupDest, "GroupDest3" );
+ GroupDest3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupDest3->sizePolicy().hasHeightForWidth() ) );
+ GroupDest3->setTitle( trUtf8( "" ) );
+ GroupDest3->setColumnLayout(0, Qt::Vertical );
+ GroupDest3->layout()->setSpacing( 6 );
+ GroupDest3->layout()->setMargin( 11 );
+ GroupDest3Layout = new QGridLayout( GroupDest3->layout() );
+ GroupDest3Layout->setAlignment( Qt::AlignTop );
+
+ Layout5->addWidget( GroupDest3, 1, 1 );
+
+ GroupDestLayout->addLayout( Layout5, 0, 0 );
+
+ Layout1->addWidget( GroupDest, 1, 0 );
+
+ GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
+ GroupButtons->setTitle( trUtf8( "" ) );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 6 );
+ GroupButtons->layout()->setMargin( 11 );
+ GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+
+ Layout3 = new QHBoxLayout( 0, 0, 6, "Layout3");
+
+ buttonEnd = new QPushButton( GroupButtons, "buttonEnd" );
+ buttonEnd->setText( trUtf8( "End Sketch" ) );
+ Layout3->addWidget( buttonEnd );
+
+ buttonClose = new QPushButton( GroupButtons, "buttonClose" );
+ buttonClose->setText( trUtf8( "Close Sketch" ) );
+ Layout3->addWidget( buttonClose );
+ QSpacerItem* spacer = new QSpacerItem( 91, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout3->addItem( spacer );
+
+ buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+ buttonCancel->setText( trUtf8( "&Cancel" ) );
+ Layout3->addWidget( buttonCancel );
+ GroupButtonsLayout->addLayout( Layout3 );
+
+ Layout1->addWidget( GroupButtons, 3, 0 );
+
+ EntityGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
+
+ // tab order
+ setTabOrder( RadioButton1, RadioButton2 );
+ setTabOrder( RadioButton2, RB_Dest1 );
+ setTabOrder( RB_Dest1, RB_Dest2 );
+ setTabOrder( RB_Dest2, buttonEnd );
+ setTabOrder( buttonEnd, buttonClose );
+ setTabOrder( buttonClose, buttonCancel );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+EntityGUI_Skeleton_QTD::~EntityGUI_Skeleton_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+/****************************************************************************
+** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
+**
+** Created: ven déc 12 11:17:07 2003
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ENTITYGUI_SKELETON_QTD_H
+#define ENTITYGUI_SKELETON_QTD_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QButtonGroup;
+class QGroupBox;
+class QPushButton;
+class QRadioButton;
+
+class EntityGUI_Skeleton_QTD : public QDialog
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_Skeleton_QTD( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~EntityGUI_Skeleton_QTD();
+
+ QGroupBox* GroupVal;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupDest;
+ QButtonGroup* GroupDest1;
+ QRadioButton* RB_Dest2;
+ QRadioButton* RB_Dest1;
+ QButtonGroup* GroupDest2;
+ QButtonGroup* GroupDest3;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonEnd;
+ QPushButton* buttonClose;
+ QPushButton* buttonCancel;
+
+
+protected:
+ QGridLayout* EntityGUI_Skeleton_QTDLayout;
+ QGridLayout* Layout1;
+ QGridLayout* GroupConstructorsLayout;
+ QHBoxLayout* Layout2;
+ QGridLayout* GroupDestLayout;
+ QGridLayout* Layout5;
+ QGridLayout* GroupDest1Layout;
+ QGridLayout* Layout4;
+ QGridLayout* GroupDest2Layout;
+ QGridLayout* GroupDest3Layout;
+ QHBoxLayout* GroupButtonsLayout;
+ QHBoxLayout* Layout3;
+};
+
+#endif // ENTITYGUI_SKELETON_QTD_H
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "EntityGUI_SketcherDlg.h"
+#include "Sketcher_Profile.hxx"
+#include "utilities.h"
+
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopoDS_Vertex.hxx>
+
+#include <qpushbutton.h>
+
+//=================================================================================
+// class : EntityGUI_SketcherDlg()
+// purpose : Constructs a EntityGUI_SketcherDlg which is a child of 'parent', with the
+// name 'name' and widget flags set to 'f'.
+// The dialog will by default be modeless, unless you set 'modal' to
+// TRUE to construct a modal dialog.
+//=================================================================================
+EntityGUI_SketcherDlg::EntityGUI_SketcherDlg(QWidget* parent, const char* name, EntityGUI* theEntityGUI, SALOME_Selection* Sel, bool modal, WFlags fl)
+ :EntityGUI_Skeleton_QTD(parent, name, modal, fl)
+{
+ if (!name)
+ setName("EntityGUI_SketcherDlg");
+
+ buttonCancel->setText(tr("GEOM_BUT_CANCEL"));
+ buttonEnd->setText(tr("GEOM_BUT_END_SKETCH"));
+ buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
+ GroupVal->close(TRUE);
+ GroupDest2->close(TRUE);
+ GroupDest3->close(TRUE);
+ resize(0, 0);
+
+ QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+
+ setCaption(tr("GEOM_SKETCHER_TITLE"));
+
+ GroupConstructors->setTitle(tr("GEOM_SKETCHER_EL"));
+ RadioButton1->setText(tr("GEOM_SKETCHER_SEGMENT"));
+ RadioButton2->setText(tr("GEOM_SKETCHER_ARC"));
+ GroupDest->setTitle(tr("GEOM_SKETCHER_DEST"));
+ GroupDest1->setTitle(tr("GEOM_SKETCHER_TYPE"));
+ RB_Dest1->setText(tr("GEOM_SKETCHER_POINT"));
+ RB_Dest2->setText(tr("GEOM_SKETCHER_DIR"));
+
+ /***************************************************************/
+ GroupPt = new EntityGUI_Point_QTD(GroupDest, "GroupPt");
+ GroupPt->GroupPoint->setTitle(tr("GEOM_SKETCHER_POINT"));
+ GroupPt->RB_Point1->setText(tr("GEOM_SKETCHER_ABS"));
+ GroupPt->RB_Point2->setText(tr("GEOM_SKETCHER_REL"));
+ GroupPt->RB_Point3->setText(tr("GEOM_SKETCHER_SEL"));
+
+ GroupD1 = new EntityGUI_Dir1_QTD(GroupDest, "GroupD1");
+ GroupD1->GroupDir1->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD1->RB_Dir11->setText(tr("GEOM_SKETCHER_ANGLE"));
+ GroupD1->RB_Dir12->setText(tr("GEOM_SKETCHER_PER"));
+ GroupD1->RB_Dir13->setText(tr("GEOM_SKETCHER_TAN"));
+ GroupD1->RB_Dir14->setText(tr("GEOM_SKETCHER_VXVY"));
+
+ GroupD2 = new EntityGUI_Dir2_QTD(GroupDest, "GroupD2");
+ GroupD2->GroupDir2->setTitle(tr("GEOM_SKETCHER_DIR"));
+ GroupD2->RB_Dir21->setText(tr("GEOM_SKETCHER_LENGTH"));
+ GroupD2->RB_Dir22->setText(tr("GEOM_SKETCHER_X"));
+ GroupD2->RB_Dir23->setText(tr("GEOM_SKETCHER_Y"));
+
+ Group1Sel = new EntityGUI_1Sel_QTD(this, "Group1Sel");
+ Group1Sel->TextLabel1->setText(tr("GEOM_SKETCHER_POINT2"));
+ Group1Sel->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Sel->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Sel->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+ Group1Sel->PushButton1->setPixmap(image0);
+
+ Group1Spin = new EntityGUI_1Spin(this, "Group1Spin");
+ Group1Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group1Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group1Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group2Spin = new EntityGUI_2Spin(this, "Group2Spin");
+ Group2Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group2Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group2Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group3Spin = new EntityGUI_3Spin(this, "Group3Spin");
+ Group3Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group3Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group3Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Group4Spin = new EntityGUI_4Spin(this, "Group4Spin");
+ Group4Spin->GroupBox1->setTitle(tr("GEOM_SKETCHER_VALUES"));
+ Group4Spin->buttonUndo->setText(tr("GEOM_SKETCHER_UNDO"));
+ Group4Spin->buttonApply->setText(tr("GEOM_SKETCHER_APPLY"));
+
+ Layout5->addMultiCellWidget(GroupPt, 1, 1, 0, 1);
+ Layout5->addWidget(GroupD1, 1, 0);
+ Layout5->addWidget(GroupD2, 1, 1);
+
+ Layout1->addWidget(Group1Sel, 2, 0);
+ Layout1->addWidget(Group1Spin, 2, 0);
+ Layout1->addWidget(Group2Spin, 2, 0);
+ Layout1->addWidget(Group3Spin, 2, 0);
+ Layout1->addWidget(Group4Spin, 2, 0);
+ /***************************************************************/
+
+ mySelection = Sel;
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+ myEntityGUI = theEntityGUI;
+
+ /* Get setting of step value from file configuration */
+ QString St = QAD_CONFIG->getSetting("Geometry:SettingsGeomStep");
+ step = St.toDouble();
+
+ myGeomBase = new GEOMBase();
+ myGeomGUI = GEOMContext::GetGeomGUI();
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ myGeom = myGeomGUI->myComponentGeom;
+
+ myVertexFilter = new GEOM_ShapeTypeFilter(TopAbs_VERTEX, myGeom);
+ mySelection->AddFilter(myVertexFilter);
+
+ /* signals and slots connections */
+ connect(buttonEnd, SIGNAL(clicked()), this, SLOT(ClickOnEnd()));
+ connect(buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+
+ connect(Group1Sel->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Sel->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group1Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group1Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group2Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group2Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group3Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group3Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+ connect(Group4Spin->buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(Group4Spin->buttonUndo, SIGNAL(clicked()), this, SLOT(ClickOnUndo()));
+
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(TypeClicked(int)));
+ connect(GroupDest1, SIGNAL(clicked(int)), this, SLOT(DestClicked(int)));
+ connect(GroupPt->GroupPoint, SIGNAL(clicked(int)), this, SLOT(PointClicked(int)));
+ connect(GroupD1->GroupDir1, SIGNAL(clicked(int)), this, SLOT(Dir1Clicked(int)));
+ connect(GroupD2->GroupDir2, SIGNAL(clicked(int)), this, SLOT(Dir2Clicked(int)));
+
+ connect(Group1Sel->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(Group1Sel->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+ connect(Group1Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group2Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group3Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+ connect(Group4Spin->SpinBox_DS, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DZ, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group4Spin->SpinBox_DS, SLOT(SetStep(double)));
+
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+
+ /* Move widget on the botton right corner of main widget */
+// int x, y;
+// myGeomBase->DefineDlgPosition( this, x, y );
+
+ myEntityGUI = theEntityGUI;
+ this->Init();
+ this->show();
+}
+
+
+//=================================================================================
+// function : ~EntityGUI_SketcherDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+EntityGUI_SketcherDlg::~EntityGUI_SketcherDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+ this->destroy(TRUE, TRUE);
+}
+
+
+//=================================================================================
+// function : Init()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::Init()
+{
+ /* init variables */
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+
+ /* min, max, step and decimals for spin boxes */
+ Group1Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group4Spin->SpinBox_DS->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+
+ Group1Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DX->SetValue(0.0);
+ Group2Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DX->SetValue(0.0);
+ Group3Spin->SpinBox_DY->SetValue(0.0);
+ Group3Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DX->SetValue(0.0);
+ Group4Spin->SpinBox_DY->SetValue(0.0);
+ Group4Spin->SpinBox_DZ->SetValue(0.0);
+ Group4Spin->SpinBox_DS->SetValue(0.0);
+
+ /* displays Dialog */
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ RadioButton1->setChecked(true);
+
+ myLastOp = 0;
+ myLastX1 = 0.0;
+ myLastY1 = 0.0;
+ myLastX2 = 0.0;
+ myLastY2 = 0.0;
+
+ mySketchState = FIRST_POINT;
+ this->TypeClicked(0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : InitClick()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::InitClick()
+{
+ disconnect(mySelection, 0, this, 0);
+
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
+
+ Group1Sel->hide();
+ Group1Spin->hide();
+ Group2Spin->hide();
+ Group3Spin->hide();
+ Group4Spin->hide();
+
+ resize(0, 0);
+
+ return;
+}
+
+
+//=================================================================================
+// function : TypeClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::TypeClicked(int constructorId)
+{
+ myConstructorId = constructorId;
+ if(myConstructorId == 0) { // SEGMENT
+ GroupD2->setEnabled(true);
+ RB_Dest1->setEnabled(true);
+ RB_Dest1->setChecked(true);
+ this->DestClicked(1);
+ }
+ else if(myConstructorId == 1) { // ARC
+ GroupD2->setEnabled(false);
+ RB_Dest1->setEnabled(false);
+ RB_Dest2->setChecked(true);
+ this->DestClicked(0);
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : DestClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::DestClicked(int constructorId)
+{
+ GroupPt->hide();
+ GroupD1->hide();
+ GroupD2->hide();
+
+ if(constructorId == 1) { // Point
+ GroupPt->RB_Point1->setChecked(true);
+ GroupPt->show();
+ this->PointClicked(1); // XY
+ }
+ else if(constructorId == 0) { // Direction
+ GroupD1->RB_Dir11->setChecked(true);
+ GroupD1->show();
+ GroupD2->show();
+ this->Dir1Clicked(2); // Angle
+ }
+ return;
+}
+
+
+//=================================================================================
+// function : PointClicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::PointClicked(int constructorId)
+{
+ this->InitClick();
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(constructorId == 1) { // XY
+ mySketchType = PT_ABS;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
+ myX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myX);
+ myY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 0) { // DXDY
+ mySketchType = PT_RELATIVE;
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
+ myDX = 0.0;
+ Group2Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group2Spin->SpinBox_DY->SetValue(myDY);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+ else if(constructorId == 2) { // Selection
+ mySketchType = PT_SEL;
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ Group1Sel->show();
+ Group1Sel->buttonApply->setFocus();
+ this->SelectionIntoArgument();
+ }
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : Dir1Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir1Clicked(int constructorId)
+{
+ myConstructorDirId = constructorId;
+ GroupD2->RB_Dir21->setChecked(true);
+ this->Dir2Clicked(2);
+ return;
+}
+
+
+//=================================================================================
+// function : Dir2Clicked()
+// purpose : Radio button management
+//=================================================================================
+void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId)
+{
+ this->InitClick();
+ myAngle = 0.0;
+
+ if(myConstructorId == 0) { // SEGMENT
+ myX = 0.0;
+ myY = 0.0;
+ myLength = 100.0;
+ if(myConstructorDirId == 2) { // Angle
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group2Spin->SpinBox_DX->SetValue(myAngle);
+ Group2Spin->buttonApply->setFocus();
+ Group2Spin->show();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_ANGLE_X;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_X3"));
+ Group2Spin->SpinBox_DY->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_ANGLE_Y;
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y3"));
+ Group2Spin->SpinBox_DY->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ Group1Spin->show();
+ Group1Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_PER_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_PER_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ Group1Spin->show();
+ Group1Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group1Spin->SpinBox_DX->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_TAN_X;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X3"));
+ Group1Spin->SpinBox_DX->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_TAN_Y;
+ Group1Spin->TextLabel1->setText(tr("GEOM_SKETCHER_Y3"));
+ Group1Spin->SpinBox_DX->SetValue(myY);
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 0.1, 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ myDX = 0.0;
+ Group3Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group3Spin->SpinBox_DY->SetValue(myDY);
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
+
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_LENGTH2"));
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ }
+ else if(constructorId == 0) { // X
+ mySketchType = DIR_DXDY_X;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_X3"));
+ Group3Spin->SpinBox_DZ->SetValue(myX);
+ }
+ else if(constructorId == 1) { // Y
+ mySketchType = DIR_DXDY_Y;
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_Y3"));
+ Group3Spin->SpinBox_DZ->SetValue(myY);
+ }
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(myConstructorDirId == 2) { // Angle
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ Group3Spin->SpinBox_DX->SetValue(myAngle);
+ myRadius = 100.0;
+ Group3Spin->SpinBox_DY->SetValue(myRadius);
+ myLength = 30.0;
+ Group3Spin->SpinBox_DZ->SetValue(myLength);
+ Group3Spin->show();
+ Group3Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 0) { // Perpendicular
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_PER_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 1) { // Tangent
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_TAN_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, 5., 3);
+ Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myRadius = 100.0;
+ Group2Spin->SpinBox_DX->SetValue(myRadius);
+ myLength = 30.0;
+ Group2Spin->SpinBox_DY->SetValue(myLength);
+ Group2Spin->show();
+ Group2Spin->buttonApply->setFocus();
+ }
+ }
+ else if(myConstructorDirId == 3) { // DXDY
+ if(constructorId == 2) { // Length
+ mySketchType = DIR_DXDY_LENGTH;
+ Group4Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
+ Group4Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
+ Group4Spin->TextLabel3->setText(tr("GEOM_SKETCHER_RADIUS2"));
+ Group4Spin->TextLabel4->setText(tr("GEOM_SKETCHER_ANGLE2"));
+ myDX = 0.0;
+ Group4Spin->SpinBox_DX->SetValue(myDX);
+ myDY = 0.0;
+ Group4Spin->SpinBox_DY->SetValue(myDY);
+ myRadius = 100.0;
+ Group4Spin->SpinBox_DZ->SetValue(myRadius);
+ myLength = 30.0;
+ Group4Spin->SpinBox_DS->SetValue(myLength);
+ Group4Spin->show();
+ Group4Spin->buttonApply->setFocus();
+ }
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnCancel()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnCancel()
+{
+ QAD_Application::getDesktop()->putInfo(tr(""));
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+
+ reject();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnEnd()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnEnd()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT)
+ myEntityGUI->OnSketchEnd(myCommand.ascii());
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnClose()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnClose()
+{
+ if(mySketchState != FIRST_POINT && mySketchState != SECOND_POINT) {
+ myCommand = myCommand + ":WW";
+ myEntityGUI->OnSketchEnd(myCommand.ascii());
+ }
+
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnApply()
+{
+ if(mySketchState == FIRST_POINT) {
+ mySketchState = SECOND_POINT;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ }
+ else {
+ if(mySketchState != SECOND_POINT) {
+ Group1Sel->buttonUndo->setEnabled(true);
+ Group1Spin->buttonUndo->setEnabled(true);
+ Group2Spin->buttonUndo->setEnabled(true);
+ Group3Spin->buttonUndo->setEnabled(true);
+ Group4Spin->buttonUndo->setEnabled(true);
+ }
+
+ QString myNewCommand = this->GetNewCommand();
+ QString myCommandTemp = myCommand + myNewCommand;
+
+ Sketcher_Profile aProfile (myCommandTemp.ascii());
+
+ if(aProfile.IsDone()) {
+ myLastCommand = myCommand;
+ myCommand = myCommandTemp;
+ myLastX2 = myLastX1;
+ myLastY2 = myLastY1;
+ mySketchState = NEXT_POINT;
+ }
+ }
+
+ myLastOp = myConstructorId;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : ClickOnUndo()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ClickOnUndo()
+{
+ Group1Sel->buttonUndo->setEnabled(false);
+ Group1Spin->buttonUndo->setEnabled(false);
+ Group2Spin->buttonUndo->setEnabled(false);
+ Group3Spin->buttonUndo->setEnabled(false);
+ Group4Spin->buttonUndo->setEnabled(false);
+
+ myCommand = myLastCommand;
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose : Called when selection as changed
+//=================================================================================
+void EntityGUI_SketcherDlg::SelectionIntoArgument()
+{
+ myEntityGUI->EraseSimulationShape(1); //Juste Shape2!!
+
+ Group1Sel->buttonApply->setEnabled(false);
+ Group1Sel->buttonApply->setFocus();
+
+ myEditCurrentArgument->setText("");
+ QString aString = "";
+
+ myX = 0.0;
+ myY = 0.0;
+
+ int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
+ if(nbSel != 1)
+ return;
+
+ /* nbSel == 1 */
+ TopoDS_Shape S;
+ gp_Pnt myPoint1;
+ Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
+
+ if(!myGeomBase->GetTopoFromSelection(mySelection, S))
+ return;
+
+ if(myEditCurrentArgument == Group1Sel->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) {
+ myX = myPoint1.X();
+ myY = myPoint1.Y();
+ Group1Sel->LineEdit1->setText(aString);
+
+ Group1Sel->buttonApply->setEnabled(true);
+ Group1Sel->buttonApply->setFocus();
+ this->MakeSimulationAndDisplay();
+ }
+
+ return;
+}
+
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::SetEditCurrentArgument()
+{
+ QPushButton* send = (QPushButton*)sender();
+
+ mySelection->ClearFilters();
+ if(send == Group1Sel->PushButton1) {
+ //Group1Sel->LineEdit1->setFocus();
+ myEditCurrentArgument = Group1Sel->LineEdit1;
+ }
+ mySelection->AddFilter(myVertexFilter);
+ this->SelectionIntoArgument();
+ return;
+}
+
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::LineEditReturnPressed()
+{
+ /* User name of object input management */
+ /* If successfull the selection is changed and signal emitted... */
+ /* so SelectionIntoArgument() is automatically called. */
+ const QString objectUserName = myEditCurrentArgument->text();
+ QWidget* thisWidget = (QWidget*)this;
+ if(myGeomBase->SelectionByNameInDialogs(thisWidget, objectUserName, mySelection))
+ myEditCurrentArgument->setText(objectUserName);
+
+ return;
+}
+
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::DeactivateActiveDialog()
+{
+ this->setEnabled(false);
+ mySelection->ClearFilters();
+ disconnect(mySelection, 0, this, 0);
+ myEntityGUI->EraseSimulationShape();
+ myGeomGUI->SetActiveDialogBox(0);
+ return;
+}
+
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ActivateThisDialog()
+{
+ /* Emit a signal to deactivate the active dialog */
+ myGeomGUI->EmitSignalDeactivateDialog();
+ this->setEnabled(true);
+ myGeomGUI->SetActiveDialogBox((QDialog*)this);
+ connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ mySelection->AddFilter(myVertexFilter);
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+
+ return;
+}
+
+
+//=================================================================================
+// function : enterEvent [REDEFINED]
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::enterEvent(QEvent* e)
+{
+ if(GroupConstructors->isEnabled())
+ return;
+ this->ActivateThisDialog();
+ return;
+}
+
+
+//=================================================================================
+// function : closeEvent()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::closeEvent(QCloseEvent* e)
+{
+ /* same than click on cancel button */
+ this->ClickOnCancel();
+ return;
+}
+
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::ValueChangedInSpinBox(double newValue)
+{
+ QObject* send = (QObject*)sender();
+ Standard_Real vx, vy, vz, vs;
+ vx = vy = vz = vs = 0.0;
+
+ if(send == Group1Spin->SpinBox_DX) {
+ vx = newValue;
+ Group1Spin->buttonApply->setFocus();
+ }
+ else if(send == Group2Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group2Spin->SpinBox_DY->GetValue();
+ Group2Spin->buttonApply->setFocus();
+ }
+ else if(send == Group2Spin->SpinBox_DY) {
+ vx = Group2Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ Group2Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DY) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group3Spin->SpinBox_DZ) {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ Group3Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DX) {
+ vx = newValue;
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DY) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DZ) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ Group4Spin->buttonApply->setFocus();
+ }
+ else if(send == Group4Spin->SpinBox_DS) {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = newValue;
+ Group4Spin->buttonApply->setFocus();
+ }
+
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS) {
+ myX = vx;
+ myY = vy;
+ }
+ else if(mySketchType == PT_RELATIVE) {
+ myDX = vx;
+ myDY = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_X) {
+ myAngle = vx;
+ myX = vy;
+ }
+ else if(mySketchType == DIR_ANGLE_Y) {
+ myAngle = vx;
+ myY = vy;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_PER_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_PER_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myLength = vx;
+ }
+ else if(mySketchType == DIR_TAN_X) {
+ myX = vx;
+ }
+ else if(mySketchType == DIR_TAN_Y) {
+ myY = vx;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_DXDY_X) {
+ myDX = vx;
+ myDY = vy;
+ myX = vz;
+ }
+ else if(mySketchType == DIR_DXDY_Y) {
+ myDX = vx;
+ myDY = vy;
+ myY = vz;
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myAngle = vx;
+ myRadius = vy;
+ myLength = vz;
+ }
+ else if(mySketchType == DIR_PER_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_TAN_LENGTH) {
+ myRadius = vx;
+ myLength = vy;
+ }
+ else if(mySketchType == DIR_DXDY_LENGTH) {
+ myDX = vx;
+ myDY = vy;
+ myRadius = vz;
+ myLength = vs;
+ }
+ }
+
+ this->MakeSimulationAndDisplay();
+ return;
+}
+
+
+//=================================================================================
+// function : GetNewCommand()
+// purpose :
+//=================================================================================
+QString EntityGUI_SketcherDlg::GetNewCommand()
+{
+ QString myNewCommand = "";
+ if(mySketchState == FIRST_POINT)
+ return myNewCommand;
+
+ myNewCommand = ":";
+ if(myConstructorId == 0) { // SEGMENT
+ if(mySketchType == PT_ABS || mySketchType == PT_SEL)
+ myNewCommand = myNewCommand + "TT " + QString::number(myX) + " " + QString::number(myY);
+ if(mySketchType == PT_RELATIVE)
+ myNewCommand = myNewCommand + "T " + QString::number(myDX) + " " + QString::number(myDY);
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_ANGLE_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_ANGLE_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_X) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_PER_Y) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ if(mySketchType == DIR_TAN_LENGTH)
+ myNewCommand = myNewCommand + "L " + QString::number(myLength);
+ if(mySketchType == DIR_TAN_X)
+ myNewCommand = myNewCommand + "IX " + QString::number(myX);
+ if(mySketchType == DIR_TAN_Y)
+ myNewCommand = myNewCommand + "IY " + QString::number(myY);
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "L " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_X) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IX " + QString::number(myX);
+ }
+ if(mySketchType == DIR_DXDY_Y) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "IY " + QString::number(myY);
+ }
+ }
+ else if(myConstructorId == 1) { // ARC
+ if(mySketchType == DIR_ANGLE_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(myAngle);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_PER_LENGTH) {
+ myNewCommand = myNewCommand + "R " + QString::number(90.0);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_TAN_LENGTH) {
+ myNewCommand = myNewCommand + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ if(mySketchType == DIR_DXDY_LENGTH) {
+ myNewCommand = myNewCommand + "D " + QString::number(myDX) + " " + QString::number(myDY);
+ myNewCommand = myNewCommand + ":" + "C " + QString::number(myRadius) + " " + QString::number(myLength);
+ }
+ }
+ return myNewCommand;
+}
+
+
+//=================================================================================
+// function : MakeSimulationAndDisplay()
+// purpose :
+//=================================================================================
+void EntityGUI_SketcherDlg::MakeSimulationAndDisplay()
+{
+ myEntityGUI->EraseSimulationShape();
+ mySimulationTopoDs1.Nullify();
+ mySimulationTopoDs2.Nullify();
+
+ try {
+ if(mySketchState == FIRST_POINT) {
+ myCommand = "Sketch ";
+ myCommand = myCommand + ":" + "F " + QString::number(myX) + " " + QString::number(myY);
+
+ myLastX1 = myX;
+ myLastY1 = myY;
+
+ }
+
+ Sketcher_Profile aProfile1 (myCommand.ascii());
+
+ if(aProfile1.IsDone()) {
+ myShape = aProfile1.GetShape();
+ mySimulationTopoDs1 = myShape;
+ }
+
+ if(mySketchState != FIRST_POINT) {
+ if(mySketchState == SECOND_POINT) {
+ gp_Pnt pt = BRep_Tool::Pnt(TopoDS::Vertex(myShape));
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ }
+ else {
+ TopoDS_Vertex V1, V2;
+ TopExp::Vertices(TopoDS::Wire(myShape), V1, V2);
+ gp_Pnt pt = BRep_Tool::Pnt(V2);
+ myLastX1 = pt.X();
+ myLastY1 = pt.Y();
+ if(myLastOp == 1) { // ARC
+ myLastDir = aProfile1.GetLastDir();
+ myLastX2 = myLastX1 - myLastDir.X();
+ myLastY2 = myLastY1 - myLastDir.Y();
+ }
+ }
+ QString myNewCommand = "Sketch ";
+ myNewCommand = myNewCommand + ":" + "F " + QString::number(myLastX1) + " " + QString::number(myLastY1);
+ if(mySketchState != SECOND_POINT && !((myLastX1 - myLastX2) == 0 && (myLastY1 - myLastY2) == 0))
+ myNewCommand = myNewCommand + ":" + "D " + QString::number(myLastX1 - myLastX2) + " " + QString::number(myLastY1 - myLastY2);
+ myNewCommand = myNewCommand + this->GetNewCommand();
+ Sketcher_Profile aProfile2 (myNewCommand.ascii());
+ if(aProfile2.IsDone())
+ mySimulationTopoDs2 = aProfile2.GetShape();
+
+ if ( mySimulationTopoDs2.IsNull() ) {
+ if ( Group1Sel->isVisible() ) {
+ Group1Sel->buttonApply->setEnabled(false);
+ Group1Sel->buttonApply->setFocus();
+ }
+ if ( Group1Spin->isVisible() ) {
+ Group1Spin->buttonApply->setEnabled(false);
+ Group1Spin->buttonApply->setFocus();
+ }
+ if ( Group2Spin->isVisible() ) {
+ Group2Spin->buttonApply->setEnabled(false);
+ Group2Spin->buttonApply->setFocus();
+ }
+ if ( Group3Spin->isVisible() ) {
+ Group3Spin->buttonApply->setEnabled(false);
+ Group3Spin->buttonApply->setFocus();
+ }
+ if ( Group4Spin->isVisible() ) {
+ Group4Spin->buttonApply->setEnabled(false);
+ Group4Spin->buttonApply->setFocus();
+ }
+ } else {
+ if ( Group1Sel->isVisible() ) {
+ Group1Sel->buttonApply->setEnabled(true);
+ Group1Sel->buttonApply->setFocus();
+ }
+ if ( Group1Spin->isVisible() ) {
+ Group1Spin->buttonApply->setEnabled(true);
+ Group1Spin->buttonApply->setFocus();
+ }
+ if ( Group2Spin->isVisible() ) {
+ Group2Spin->buttonApply->setEnabled(true);
+ Group2Spin->buttonApply->setFocus();
+ }
+ if ( Group3Spin->isVisible() ) {
+ Group3Spin->buttonApply->setEnabled(true);
+ Group3Spin->buttonApply->setFocus();
+ }
+ if ( Group4Spin->isVisible() ) {
+ Group4Spin->buttonApply->setEnabled(true);
+ Group4Spin->buttonApply->setFocus();
+ }
+ }
+ }
+
+ myEntityGUI->DisplaySimulationShape(mySimulationTopoDs1, mySimulationTopoDs2);
+ }
+ catch(Standard_Failure) {
+ MESSAGE("Exception catched in MakeSimulationAndDisplay");
+ return;
+ }
+ return;
+}
--- /dev/null
+// GEOM GEOMGUI : GUI for Geometry component
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : EntityGUI_SketcherDlg.h
+// Author : Damine COQUERET
+// Module : GEOM
+// $Header:
+
+#ifndef ENTITYGUI_SKETCHERDLG_H
+#define ENTITYGUI_SKETCHERDLG_H
+
+#include "EntityGUI_Skeleton_QTD.h"
+#include "EntityGUI_Point_QTD.h"
+#include "EntityGUI_Dir1_QTD.h"
+#include "EntityGUI_Dir2_QTD.h"
+
+#include "EntityGUI_1Sel_QTD.h"
+#include "EntityGUI_1Spin.h"
+#include "EntityGUI_2Spin.h"
+#include "EntityGUI_3Spin.h"
+#include "EntityGUI_4Spin.h"
+
+#include "EntityGUI.h"
+
+#include "GEOM_ShapeTypeFilter.hxx"
+
+#include <gp_Dir.hxx>
+
+#include <qwidget.h>
+#include <qgroupbox.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+
+//=================================================================================
+// class : EntityGUI_Dlg
+// purpose :
+//=================================================================================
+class EntityGUI_SketcherDlg : public EntityGUI_Skeleton_QTD
+{
+ Q_OBJECT
+
+public:
+ EntityGUI_SketcherDlg(QWidget* parent = 0, const char* name = 0, EntityGUI* theEntityGUI = 0, SALOME_Selection* Sel = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EntityGUI_SketcherDlg();
+
+private :
+ void Init();
+ void enterEvent(QEvent* e);
+ void closeEvent(QCloseEvent* e);
+ void InitClick();
+ void MakeSimulationAndDisplay();
+ QString GetNewCommand();
+
+ EntityGUI* myEntityGUI;
+
+ double step;
+ int myConstructorId;
+ int myConstructorDirId;
+ int mySketchType;
+ int mySketchState;
+ Handle(GEOM_ShapeTypeFilter) myVertexFilter;
+
+ TopoDS_Shape mySimulationTopoDs1; /* Shape used for simulation display */
+ TopoDS_Shape mySimulationTopoDs2; /* Shape used for simulation display */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ SALOME_Selection* mySelection; /* User shape selection */
+ GEOM::GEOM_Gen_var myGeom; /* Current GeomI object */
+ GEOMBase* myGeomBase;
+ GEOMContext* myGeomGUI; /* Current GeomGUI object */
+
+ int myLastOp;
+ QString myCommand;
+ QString myLastCommand;
+ TopoDS_Shape myShape;
+ gp_Dir myLastDir;
+
+ Standard_Real myX;
+ Standard_Real myY;
+ Standard_Real myDX;
+ Standard_Real myDY;
+ Standard_Real myLastX1;
+ Standard_Real myLastY1;
+ Standard_Real myLastX2;
+ Standard_Real myLastY2;
+ Standard_Real myLength;
+ Standard_Real myAngle;
+ Standard_Real myRadius;
+
+ EntityGUI_Point_QTD* GroupPt;
+ EntityGUI_Dir1_QTD* GroupD1;
+ EntityGUI_Dir2_QTD* GroupD2;
+
+ EntityGUI_1Sel_QTD* Group1Sel;
+ EntityGUI_1Spin* Group1Spin;
+ EntityGUI_2Spin* Group2Spin;
+ EntityGUI_3Spin* Group3Spin;
+ EntityGUI_4Spin* Group4Spin;
+
+ enum SketchState {FIRST_POINT, SECOND_POINT, NEXT_POINT};
+
+ enum SketchType {PT_ABS, PT_RELATIVE, PT_SEL,
+ DIR_ANGLE_LENGTH, DIR_ANGLE_X, DIR_ANGLE_Y,
+ DIR_PER_LENGTH, DIR_PER_X, DIR_PER_Y,
+ DIR_TAN_LENGTH, DIR_TAN_X, DIR_TAN_Y,
+ DIR_DXDY_LENGTH, DIR_DXDY_X, DIR_DXDY_Y};
+
+private slots:
+ void ClickOnEnd();
+ void ClickOnClose();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnUndo();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void TypeClicked(int constructorId);
+ void DestClicked(int constructorId);
+ void PointClicked(int constructorId);
+ void Dir1Clicked(int constructorId);
+ void Dir2Clicked(int constructorId);
+ void ValueChangedInSpinBox(double newValue);
+
+};
+
+#endif // ENTITYGUI_SKETCHERDLG_H
EXPORT_HEADERS=
LIB_SRC = EntityGUI.cxx \
+ EntityGUI_Skeleton_QTD.cxx \
+ EntityGUI_Point_QTD.cxx \
+ EntityGUI_Dir1_QTD.cxx \
+ EntityGUI_Dir2_QTD.cxx \
+ EntityGUI_1Sel_QTD.cxx \
+ EntityGUI_1Spin_QTD.cxx \
+ EntityGUI_2Spin_QTD.cxx \
+ EntityGUI_3Spin_QTD.cxx \
+ EntityGUI_4Spin_QTD.cxx \
+ EntityGUI_1Spin.cxx \
+ EntityGUI_2Spin.cxx \
+ EntityGUI_3Spin.cxx \
+ EntityGUI_4Spin.cxx \
+ EntityGUI_SketcherDlg.cxx \
EntityGUI_SubShapeDlg.cxx
LIB_MOC = \
EntityGUI.h \
+ EntityGUI_Skeleton_QTD.h \
+ EntityGUI_Point_QTD.h \
+ EntityGUI_Dir1_QTD.h \
+ EntityGUI_Dir2_QTD.h \
+ EntityGUI_1Sel_QTD.h \
+ EntityGUI_1Spin_QTD.h \
+ EntityGUI_2Spin_QTD.h \
+ EntityGUI_3Spin_QTD.h \
+ EntityGUI_4Spin_QTD.h \
+ EntityGUI_1Spin.h \
+ EntityGUI_2Spin.h \
+ EntityGUI_3Spin.h \
+ EntityGUI_4Spin.h \
+ EntityGUI_SketcherDlg.h \
EntityGUI_SubShapeDlg.h
LIB_CLIENT_IDL =
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI
+LDFLAGS += -lGEOMFiltersSelection -lDisplayGUI -lGEOMSketcher
@CONCLUDE@
#include "Partition_Spliter.hxx"
#include "Archimede_VolumeSection.hxx"
+#include "Sketcher_Profile.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include "Utils_ExceptHandlers.hxx"
+
Standard_EXPORT static Standard_Boolean IsValid(const TopoDS_Shape& S) {
#if OCC_VERSION_MAJOR >= 5
return BRepAlgo::IsValid(S);
{
GEOM::GEOM_Shape_var aShape = GEOM::GEOM_Shape::_narrow(_orb->string_to_object(IORString));
if (!CORBA::is_nil(aShape)) {
- return strdup(aShape->ShapeId());
+ return CORBA::string_dup(aShape->ShapeId());
}
return 0;
}
TCollection_ExtendedString MainIOR;
TDF_Label Lab;
TDF_Tool::Label(aDoc->GetData(), aPersRefString, Lab );
+
+ if (Lab.IsNull()) {
+ MESSAGE("Can not find label "<<aPersRefString<<" for study "<<myStudy->StudyId());
+ THROW_SALOME_CORBA_EXCEPTION("Incorrect GEOM data loaded",SALOME::BAD_PARAM);
+ //return ""; empty IORs raise new problem: "display" in popup crashes
+ }
Handle(TNaming_NamedShape) NS;
Lab.FindAttribute( TNaming_NamedShape::GetID(), NS );
TCollection_AsciiString entry;
TDF_Tool::Entry(mainLabel,entry);
- CORBA::String_var ent = strdup(entry.ToCString());
+ CORBA::String_var ent = CORBA::string_dup(entry.ToCString());
/* Create the main object recursively */
MainIOR = LocalPersistentIDToIOR(theSObject, ent, isMultiFile, isASCII) ;
CORBA::Object_ptr theObject,
const char* theName) throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
SALOMEDS::SObject_var aResultSO;
if(CORBA::is_nil(theObject)) return aResultSO;
aShapeName = "Vertex_";
}
if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag());
- else aShapeName = TCollection_AsciiString(strdup(theName));
+ else aShapeName = TCollection_AsciiString((char*)theName);
//Set a name of the added shape
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
SALOMEDS::Study_var Study = theComponent->GetStudy();
- TCollection_AsciiString name( strdup(Study->Name()) );
+ TCollection_AsciiString name( Study->Name() );
int StudyID = Study->StudyId();
myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
// void GEOM_Gen_i::Save(const char *IORSComponent, const char *aUrlOfFile)
// {
-// TCollection_ExtendedString path(strdup(aUrlOfFile));
+// TCollection_ExtendedString path((char*)aUrlOfFile);
// TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->SaveAs(myCurrentOCAFDoc,pathWithExt);
// }
// void GEOM_Gen_i::Load(const char *IORSComponent, const char *aUrlOfFile)
// {
-// TCollection_ExtendedString path(strdup(aUrlOfFile));
+// TCollection_ExtendedString path((char*)aUrlOfFile);
// TCollection_ExtendedString pathWithExt = path + TCollection_ExtendedString(".sgd");
// myOCAFApp->Open(pathWithExt,myCurrentOCAFDoc);
// SALOMEDS::SComponent_var SC = SALOMEDS::SComponent::_narrow(_orb->string_to_object(IORSComponent));
// SALOMEDS::Study_var Study = SC->GetStudy();
-// TCollection_AsciiString name( strdup(Study->Name()) );
+// TCollection_AsciiString name( Study->Name() );
// int StudyID = Study->StudyId();
// myStudyIDToDoc.Bind( StudyID, myCurrentOCAFDoc );
//============================================================================
SALOMEDS::TMPFile* GEOM_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
// Declare a sequence of the byte to store the copied object
- SALOMEDS::TMPFile_var aStreamFile;
+ SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
// Try to get GEOM_Shape object by given SObject
SALOMEDS::GenericAttribute_var anAttr;
//============================================================================
char* GEOM_Gen_i::ComponentDataType()
{
- return strdup("GEOM");
+ return CORBA::string_dup("GEOM");
}
//============================================================================
void GEOM_Gen_i::register_name(char * name)
{
GEOM::GEOM_Gen_ptr g = GEOM::GEOM_Gen::_narrow(POA_GEOM::GEOM_Gen::_this());
- name_service->Register(g, strdup(name));
+ name_service->Register(g, name);
}
TDF_Label lab ;
Handle(TDF_Data) D = myCurrentOCAFDoc->GetData() ;
- TDF_Tool::Label( D, strdup(shape_ptr->ShapeId()), lab, true ) ;
+ TDF_Tool::Label( D, shape_ptr->ShapeId(), lab, true ) ;
Handle(TNaming_NamedShape) NamedShape ;
bool res = lab.FindAttribute(TNaming_NamedShape::GetID(), NamedShape) ;
{
GEOMDS_Commands GC(OCAFDoc->Main());
/* add attributs S and mystr in a new label */
- TDF_Label Lab = GC.AddShape (S, strdup(mystr));
+ TDF_Label Lab = GC.AddShape (S, (char*)mystr);
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab,entry);
TDF_Tool::Label(OCAFDoc->GetData(), mainshape_ptr->ShapeId(), mainRefLab);
/* add attributs : S, nameIor and ref to main */
- TDF_Label Lab = GC.AddDependentShape(S, strdup(nameIor), mainRefLab);
+ TDF_Label Lab = GC.AddDependentShape(S, (char*)nameIor, mainRefLab);
TCollection_AsciiString entry;
TDF_Tool::Entry(Lab, entry);
//=================================================================================
CORBA::Short GEOM_Gen_i::NbLabels()
{
- return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() );
+ TDF_ChildIterator ChildIterator(myCurrentOCAFDoc->Main());
+ unsigned int i = 1;
+
+ while (ChildIterator.More()) {
+ i++;
+ ChildIterator.Next();
+ }
+ return i;
+ // return TDF_Tool::NbLabels( myCurrentOCAFDoc->Main() );
}
TopoDS_Shape& aCompoundOfShells )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRepTools_Quilt Glue;
aCompoundOfShells.Nullify() ;
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
ListOfID->length(0) ;
if( subShell.IsNull() || subShell.ShapeType() != TopAbs_SHELL ) {
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen::ListOfGeomShapes_var listOfGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
listOfGeomShapes->length(0) ;
TopTools_MapOfShape& MSwireEndEdges )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopTools_MapOfShape MS ;
TopTools_SequenceOfShape SU ;
FreeEdgesFromMapOfFace(MSfaces, MS) ; /* MS = free edges of MSfaces */
const GEOM::GEOM_Shape::ListOfSubShapeID& ListIdWires )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
if( ListIdWires.length() < 1 )
const GEOM::GEOM_Shape::ListOfSubShapeID& ListIdEndFace )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Face aFace ;
TopoDS_Wire aWire ;
TopoDS_Shape& resultTds )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRep_Builder B;
TopExp_Explorer exp ;
TopoDS_Face newFace ;
TopoDS_Shape& resultTds )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
BRep_Builder B;
TopExp_Explorer exp ;
TopoDS_Face newFace ;
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesOne(shape, (TopAbs_ShapeEnum) ShapeType, ListOfID);
}
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesOne(shape, (TopAbs_ShapeEnum) ShapeType, ListOfID, Standard_True);
}
const Standard_Boolean Sort)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape mainShape;
TopoDS_Shape mainTopo = GetTopoShape(shape);
CORBA::Short ShapeType)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesAll(shape, (TopAbs_ShapeEnum) ShapeType);
}
CORBA::Short ShapeType)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
return SubShapesAll(shape, (TopAbs_ShapeEnum) ShapeType, Standard_True);
}
throw (SALOME::SALOME_Exception)
{
/* List of sub shapes returned */
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Gen::ListOfGeomShapes_var listOfGeomShapes = new GEOM::GEOM_Gen::ListOfGeomShapes;
listOfGeomShapes->length(0) ;
return listOfGeomShapes._retn() ;
}
-
//=================================================================================
// function : MakeBoolean()
// purpose : Boolean operation according to the type 'operation'
//=================================================================================
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeBoolean(GEOM::GEOM_Shape_ptr shape1,
- GEOM::GEOM_Shape_ptr shape2,
- CORBA::Long operation)
+ GEOM::GEOM_Shape_ptr shape2,
+ CORBA::Long operation)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape shape ;
TopoDS_Shape aShape1 ;
TopoDS_Shape aShape2 ;
-
+
try {
aShape1 = GetTopoShape(shape1) ;
aShape2 = GetTopoShape(shape2) ;
GEOM::GEOM_Shape_ptr shape2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape aShape1 = GetTopoShape(shape1) ;
TopoDS_Shape aShape2 = GetTopoShape(shape2) ;
GEOM::DirStruct GEOM_Gen_i::MakeDirection(const GEOM::PointStruct& p)
{
GEOM::DirStruct d ;
- d.PS.x = p.x ; d.PS.y = p.y ; d.PS.z = p.z ;
- return d ;
- }
+ d.PS.x = p.x ; d.PS.y = p.y ; d.PS.z = p.z ;
+ return d ;
+}
//=================================================================================
// function : MakeBox()
CORBA::Double z2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
gp_Pnt P1(x1,y1,z1);
gp_Pnt P2(x2,y2,z2);
GEOM::GEOM_Shape_var result ;
CORBA::Double height)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
CORBA::Double radius)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
try {
CORBA::Double minor_radius )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
CORBA::Double height)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
gp_Pnt p(pstruct.x, pstruct.y, pstruct.z) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportIGES(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
//VRV: OCC 4.0 migration
IGESControl_Reader aReader;
THROW_SALOME_CORBA_EXCEPTION("Error in reading import file", SALOME::BAD_PARAM); }
MESSAGE("ImportIGES : all Geometry Transfer" << endl ) ;
- aReader.Clear();
- aReader.TransferRoots(false);
+ //OCC 5.1.2 porting
+// aReader.Clear();
+// aReader.TransferRoots(false);
+ aReader.ClearShapes();
+ aReader.TransferRoots();
MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes() << endl );
TopoDS_Shape shape = aReader.OneShape();
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportSTEP(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
//VRV: OCC 4.0 migration
STEPControl_Reader aReader;
const CORBA::Short Limit)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var aResult;
TopoDS_Shape tds ;
//MESSAGE ("In Partition");
GEOM::GEOM_Shape_var aShape = GetIORFromString( ListTools[ind] );
TopoDS_Shape Shape = GetTopoShape(aShape);
if(Shape.IsNull() ) {
- //MESSAGE ( "In Partition a tool shape is null" );
THROW_SALOME_CORBA_EXCEPTION("In Partition a shape is null", SALOME::BAD_PARAM);
}
if ( !ShapesMap.Contains( Shape ) && ToolsMap.Add( Shape ))
PS.AddShape(Shape);
}
+ //MESSAGE ( "Partition::Compute() " );
PS.Compute ((TopAbs_ShapeEnum) Limit);
+ //MESSAGE ( "Partition::Compute() - END" );
// suppress result outside of shapes in KInsideMap
for (ind = 0; ind < ListKeepInside.length(); ind++) {
CORBA::Short nbiter)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Face tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
THROW_SALOME_CORBA_EXCEPTION("Initial shape doesn't contain only edges !", SALOME::BAD_PARAM);
}
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+ if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ;
i++ ;
// appliquer BRepTools_SameParameter au compshell
// (rendre parametres 2D des edges identiques aux parametres 3D)
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double precision )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
BRepOffsetAPI_Sewing aMethod ;
CORBA::Double precision )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds, S ;
BRepOffsetAPI_Sewing aMethod ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::OrientationChange(GEOM::GEOM_Shape_ptr aShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRep_Builder aBuilder;
Handle(TDataStd_Name) Att;
L.FindAttribute(TDataStd_Name::GetID(),Att);
TCollection_AsciiString nameIOR (Att->Get()) ;
- aList[i] = strdup( nameIOR.ToCString() );
+ aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++;
}
if (!Att->Get().IsEqual(TCollection_ExtendedString("Arguments")) ) {
TCollection_AsciiString nameIOR (Att->Get());
- aList[i] = strdup( nameIOR.ToCString() );
+ aList[i] = CORBA::string_dup( nameIOR.ToCString() );
i++;
}
ChildIterator1.Next();
GEOM::GEOM_Shape_ptr GEOM_Gen_i::ImportBREP(const char* filename)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopoDS_Shape tds ;
GEOM::GEOM_Shape_var result ;
try {
- BRep_Builder aBuilder;
- BRepTools::Read(tds, strdup(filename), aBuilder) ;
+ BRep_Builder aBuilder;
+ char* aCopyfilename = strdup(filename);
+ BRepTools::Read(tds, aCopyfilename, aBuilder) ;
+ free(aCopyfilename);
if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Import BRep aborted", SALOME::BAD_PARAM);
}
CORBA::Double trimsize)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double z)
throw (SALOME::SALOME_Exception)
{
-
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
gp_Pnt P(x,y,z);
TopoDS_Shape tds = BRepBuilderAPI_MakeVertex(P).Shape();
if (tds.IsNull()) {
THROW_SALOME_CORBA_EXCEPTION("Make Vertex/Point aborted", SALOME::BAD_PARAM);
}
+ tds.Infinite(true);
result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry);
CORBA::Boolean wantplanarface )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape aShape;
TopoDS_Shape tds;
FR.Perform();
if(FR.IsDone()) {
- for(; FR.More(); FR.Next())
- aBuilder.Add(C, FR.Current().Oriented(OriF));
- result = CreateObject(C);
- InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
+ int k = 0;
+ TopoDS_Shape aFace;
+ for(; FR.More(); FR.Next()) {
+ aFace = FR.Current().Oriented(OriF);
+ aBuilder.Add(C, aFace);
+ k++;
+ }
+ if(k == 1) {
+ result = CreateObject(aFace);
+ InsertInLabelMoreArguments(aFace, result, ListShapes, myCurrentOCAFDoc);
+ }
+ else {
+ result = CreateObject(C);
+ InsertInLabelMoreArguments(C, result, ListShapes, myCurrentOCAFDoc);
+ }
}
}
}
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeShell( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRepTools_Quilt Glue;
TopoDS_Shape C;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSolid( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
Standard_Integer ish = 0;
TopoDS_Compound Res;
const GEOM::DirStruct& dstruct)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
gp_Pnt P1(pstruct.x, pstruct.y, pstruct.z);
gp_Pnt P2(dstruct.PS.x, dstruct.PS.y, dstruct.PS.z) ;
THROW_SALOME_CORBA_EXCEPTION("Make Line aborted : null shape", SALOME::BAD_PARAM);
}
else {
+ tds.Infinite(true);
result = CreateObject(tds) ;
const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
result->ShapeId(entry);
const GEOM::PointStruct& pstruct2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double radius)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
CORBA::Double radius_minor )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
const GEOM::PointStruct& pEnd)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
try {
gp_Pnt pI(pInit.x, pInit.y, pInit.z) ;
return result ;
}
-
+//=================================================================================
+ // function : MakeSketcher()
+ // purpose : Make a wire from a list containing many points
+ //=================================================================================
+ GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeSketcher( const char *Cmd )
+ throw (SALOME::SALOME_Exception)
+ {
+ GEOM::GEOM_Shape_var result ;
+ TopoDS_Shape tds ;
+ try {
+ Sketcher_Profile aProfile (Cmd);
+ if(aProfile.IsDone())
+ tds = aProfile.GetShape();
+ }
+ catch(Standard_Failure) {
+ THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::MakeSketcher", SALOME::BAD_PARAM);
+ }
+
+ if (tds.IsNull()) {
+ THROW_SALOME_CORBA_EXCEPTION("MakeSketcher aborted : null shape", SALOME::BAD_PARAM);
+ }
+ else {
+ result = CreateObject(tds);
+ const char *entry = InsertInLabel(tds, result->Name(), myCurrentOCAFDoc) ;
+ result->ShapeId(entry) ;
+ }
+ return result;
+ }
//=================================================================================
// function : MakeTranslation()
CORBA::Double z)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
if( aShape.IsNull() ) {
CORBA::Short nbtimes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Short nbtimes2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Short nbtimes)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Short nbtimes2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCopy( GEOM::GEOM_Shape_ptr Shape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(Shape) ;
GEOM::GEOM_Shape_ptr shapePlane)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double angle)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
CORBA::Double factor)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCompound( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Compound C;
BRep_Builder aBuilder;
const GEOM::PointStruct& pstruct2)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeWire( const GEOM::GEOM_Gen::ListOfIOR& ListShapes )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
BRepBuilderAPI_MakeWire MW ;
TopoDS_Shape tds, Shape ;
double angle)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr baseShape )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Wire aWire ;
const GEOM::PointStruct& P2 )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(myShape) ;
GEOM::GEOM_Shape_ptr GEOM_Gen_i::MakeCDG(GEOM::GEOM_Shape_ptr aShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape shape = GetTopoShape(aShape) ;
CORBA::Double aMeshingDeflection)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
double cste = -1;
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
fill.Add(E);
}
for (int i = 1;i<=fill.NbContours();i++) {
- fill.SetRadius(radius,i);
+ fill.SetRadius(radius,i,i);
}
tds = fill.Shape();
}
}
for (int i = 1;i<=fill.NbContours();i++) {
- fill.SetRadius(radius,i);
+ fill.SetRadius(radius,i,i);
}
tds = fill.Shape();
}
const GEOM::GEOM_Shape::ListOfSubShapeID& ListOfID )
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result;
TopoDS_Shape tds ;
CORBA::Boolean GEOM_Gen_i::CheckShape(GEOM::GEOM_Shape_ptr shape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
TopoDS_Shape S = GetTopoShape(shape) ;
if( S.IsNull() ) {
THROW_SALOME_CORBA_EXCEPTION("Shape is null", SALOME::BAD_PARAM);
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
CORBA::Double delta)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Shape_var result ;
TopoDS_Shape tds ;
TopoDS_Shape aShape = GetTopoShape(shape) ;
GEOM::GEOM_Gen::ListOfIOR_var aList = new GEOM::GEOM_Gen::ListOfIOR;
aList->length(4);
- aList[0]=strdup(Edge1->Name());
- aList[1]=strdup(Edge2->Name());
- aList[2]=strdup(Edge3->Name());
- aList[3]=strdup(Edge4->Name());
+ aList[0]=CORBA::string_dup(Edge1->Name());
+ aList[1]=CORBA::string_dup(Edge2->Name());
+ aList[2]=CORBA::string_dup(Edge3->Name());
+ aList[3]=CORBA::string_dup(Edge4->Name());
GEOM::GEOM_Shape_ptr aWire = MakeWire( aList );
GEOM::GEOM_Shape_ptr aFace = MakeFace( aWire, true ) ;
void GEOM_Gen_i::ExportIGES(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export IGES aborted", SALOME::BAD_PARAM);
void GEOM_Gen_i::ExportBREP(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export BRep aborted", SALOME::BAD_PARAM);
void GEOM_Gen_i::ExportSTEP(const char* filename,GEOM::GEOM_Shape_ptr theShape)
throw (SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
if (theShape->_is_nil())
{
THROW_SALOME_CORBA_EXCEPTION("Export STEP aborted", SALOME::BAD_PARAM);
GEOM::GEOM_Shape_ptr MakePlacedBox(CORBA::Double x1, CORBA::Double y1, CORBA::Double z1,
CORBA::Double delta1, CORBA::Double delta2, CORBA::Double delta3)
throw (SALOME::SALOME_Exception) ;
+
GEOM::GEOM_Shape_ptr MakePanel(GEOM::GEOM_Shape_ptr shape,
CORBA::Short directiontype,
CORBA::Double delta)
const GEOM::PointStruct& pEnd)
throw (SALOME::SALOME_Exception) ;
+ //-------------------------------------------------------------------//
+ // Specific method Sketcher //
+ //-------------------------------------------------------------------//
+ GEOM::GEOM_Shape_ptr MakeSketcher (const char* Cmd)
+ throw (SALOME::SALOME_Exception) ;
+
+ //-------------------------------------------------------------------//
+
GEOM::GEOM_Shape_ptr MakeCompound (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
throw (SALOME::SALOME_Exception) ;
GEOM::GEOM_Shape_ptr MakeWire (const GEOM::GEOM_Gen::ListOfIOR& ListShapes)
// Module : GEOM
// $Header$
-using namespace std;
+#include <fstream.h>
+#include <strstream>
+
#include <BRepTools_ShapeSet.hxx>
+#include <BRepTools.hxx>
+
#include "GEOM_Shape_i.hh"
#include "SALOME_NamingService.hxx"
-#include <fstream.h>
-#include <BRepTools.hxx>
+using namespace std;
//=================================================================================
// : WARNING : Register to naming service actually removed !
//=================================================================================
void GEOM_Shape_i::Name(const char* name) {
- _name = strdup(name);
+ _name = CORBA::string_dup(name);
GEOM::GEOM_Shape_ptr g = GEOM::GEOM_Shape::_narrow(_this());
// Removed declaration of shapes to naming service
// function : Name (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
-char* GEOM_Shape_i::Name() { return strdup(_name); }
+char* GEOM_Shape_i::Name() { return CORBA::string_dup(_name); }
//=================================================================================
// function : MainName (set method)
// purpose : to set the attribute 'name' of this mainshape.
//=================================================================================
void GEOM_Shape_i::MainName(const char* name) {
- _mainname = strdup(name);
+ _mainname = CORBA::string_dup(name);
}
// function : MainName (get method)
// purpose : to get the attribute 'name' of this shape
//=================================================================================
-char* GEOM_Shape_i::MainName() { return strdup(_mainname); }
+char* GEOM_Shape_i::MainName() { return CORBA::string_dup(_mainname); }
//=================================================================================
// function : IsMainShape (get method)
// function : ShapeId
// purpose : to get the id of this shape from GEOM (OCAF entry)
//=================================================================================
-char* GEOM_Shape_i::ShapeId() { return strdup(_shapeid) ; }
+char* GEOM_Shape_i::ShapeId() { return CORBA::string_dup(_shapeid) ; }
//=================================================================================
// function : ShapeId (set method)
// purpose : to set the id of this shape in GEOM/OCAF doc
//=================================================================================
-void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = strdup(shapeid) ; }
+void GEOM_Shape_i::ShapeId(const char * shapeid) { _shapeid = CORBA::string_dup(shapeid) ; }
// function : StudyShapeId (get method)
// purpose : to get the id of this shape from the study document (OCAF entry)
//=================================================================================
-char* GEOM_Shape_i::StudyShapeId() { return strdup(_studyshapeid) ; }
+char* GEOM_Shape_i::StudyShapeId() { return CORBA::string_dup(_studyshapeid) ; }
//=================================================================================
// purpose : to set the id of this shape in the Study document (OCAF entry)
//=================================================================================
void GEOM_Shape_i::StudyShapeId(const char * studyshapeid)
-{ _studyshapeid = strdup(studyshapeid) ; }
+{ _studyshapeid = CORBA::string_dup(studyshapeid) ; }
// function : NameType (get method)
// purpose : to get the attribute 'nametype' of this shape
//=================================================================================
-char* GEOM_Shape_i::NameType() { return strdup(_nametype); }
+char* GEOM_Shape_i::NameType() { return CORBA::string_dup(_nametype); }
//=================================================================================
// function : GetShapeStream
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS += -lGEOMDS -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMPartition -lGEOMArchimede $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -lGEOMSketcher -L${KERNEL_ROOT_DIR}/lib/salome
# additional file to be cleaned
MOSTLYCLEAN =
needDisplay = true;
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
if(!obj->_is_nil()) {
+ if (strcmp(obj->GetFatherComponent()->GetName(), "GEOM")) continue;
GEOM::GEOM_Shape_var aShape;
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
SALOMEDS::SObject_var obj = ActiveStudy->getStudyDocument()->FindObjectID(anIObject->getEntry());
if(!obj->_is_nil()) {
+ if (strcmp(obj->GetFatherComponent()->GetName(), "GEOM")) continue;
GEOM::GEOM_Shape_var aShape;
if(obj->FindAttribute(aTmpAttr, "AttributeIOR")) {
char *str = SALOMEDS::AttributeIOR::_narrow(aTmpAttr)->Value();
Standard_CString type;
GetShapeTypeString(shape,type);
aShape->NameType(type);
- nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
+ nameG += TCollection_AsciiString(type) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
}
else
- nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->GetNbGeom()++) + TCollection_AsciiString("\0");
- }
+ nameG += TCollection_AsciiString(aShape->NameType()) + TCollection_AsciiString("_") + TCollection_AsciiString(myGeomGUI->myNbGeom++) + TCollection_AsciiString("\0");
+ }
else
nameG = TCollection_AsciiString(name);
QString Name = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), anIO->getName());
if(!Name.isEmpty()) {
// VTK
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK)
- GActor->setName(strdup(Name.latin1()));
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ char* aCopy = CORBA::string_dup(Name.latin1());
+ GActor->setName(aCopy);
+ delete(aCopy);
+ }
// OCC
- else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
- GAISShape->setName(strdup(Name.latin1()));
+ else if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
+ char* aCopy = CORBA::string_dup(Name.latin1());
+ GAISShape->setName(aCopy);
+ delete(aCopy);
+ }
}
else
return false;
{
case TopAbs_COMPOUND:
{
- aTypeString = strdup(tr("GEOM_COMPOUND"));
+ aTypeString = CORBA::string_dup(tr("GEOM_COMPOUND"));
return true;
}
case TopAbs_COMPSOLID:
{
- aTypeString = strdup(tr("GEOM_COMPOUNDSOLID")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_COMPOUNDSOLID")) ;
return true ;
}
case TopAbs_SOLID:
{
- aTypeString = strdup(tr("GEOM_SOLID")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_SOLID")) ;
return true ;
}
case TopAbs_SHELL:
{
- aTypeString = strdup(tr("GEOM_SHELL")) ;
+ aTypeString = CORBA::string_dup(tr("GEOM_SHELL")) ;
return true ;
}
case TopAbs_FACE:
{
BRepAdaptor_Surface surf(TopoDS::Face(aShape));
if(surf.GetType() == GeomAbs_Plane) {
- aTypeString = strdup(tr("GEOM_PLANE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_PLANE"));
return true;
}
else if(surf.GetType() == GeomAbs_Cylinder) {
- aTypeString = strdup(tr("GEOM_SURFCYLINDER"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFCYLINDER"));
return true;
}
else if(surf.GetType() == GeomAbs_Sphere) {
- aTypeString = strdup(tr("GEOM_SURFSPHERE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFSPHERE"));
return true ;
}
else if(surf.GetType() == GeomAbs_Torus) {
- aTypeString = strdup(tr("GEOM_SURFTORUS"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFTORUS"));
return true ;
}
else if(surf.GetType() == GeomAbs_Cone) {
- aTypeString = strdup(tr("GEOM_SURFCONE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SURFCONE"));
return true ;
}
else {
- aTypeString = strdup(tr("GEOM_FACE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_FACE"));
return true;
}
}
case TopAbs_WIRE:
{
- aTypeString = strdup(tr("GEOM_WIRE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_WIRE"));
return true;
}
case TopAbs_EDGE:
BRepAdaptor_Curve curv(TopoDS::Edge(aShape));
if(curv.GetType() == GeomAbs_Line) {
if((Abs(curv.FirstParameter()) >= 1E6) || (Abs(curv.LastParameter()) >= 1E6))
- aTypeString = strdup(tr("GEOM_LINE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_LINE"));
else
- aTypeString = strdup(tr("GEOM_EDGE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true;
}
else if(curv.GetType() == GeomAbs_Circle) {
if(curv.IsClosed())
- aTypeString = strdup(tr("GEOM_CIRCLE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_CIRCLE"));
else
- aTypeString = strdup(tr("GEOM_ARC"));
+ aTypeString = CORBA::string_dup(tr("GEOM_ARC"));
return true;
}
else {
- aTypeString = strdup(tr("GEOM_EDGE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_EDGE"));
return true;
}
}
case TopAbs_VERTEX:
{
- aTypeString = strdup(tr("GEOM_VERTEX"));
+ aTypeString = CORBA::string_dup(tr("GEOM_VERTEX"));
return true;
}
case TopAbs_SHAPE:
{
- aTypeString = strdup(tr("GEOM_SHAPE"));
+ aTypeString = CORBA::string_dup(tr("GEOM_SHAPE"));
return true;
}
}
CORBA::String_var theValue = anIOR->Value();
CORBA::Object_var theObj = _orb->string_to_object(theValue);
if(theObj->_is_a("IDL:GEOM/GEOM_Shape:1.0")) {
- listIOR[j] = strdup(theValue);
+ listIOR[j] = CORBA::string_dup(theValue);
j++;
}
}
else if(IObject->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IObject);
Standard_CString ior = GIObject->getIOR();
- listIOR[j] = strdup(ior);
+ listIOR[j] = CORBA::string_dup(ior);
j++;
}
}
SALOMEDS::SObject_var theObj = listSO[0];
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
Standard_CString anEntry = theObj->GetID();
- Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(anEntry, "GEOM", strdup(objectUserName));
+ char* aCopyobjectUserName = CORBA::string_dup(objectUserName);
+ Handle(SALOME_InteractiveObject) SI = new SALOME_InteractiveObject(anEntry, "GEOM", aCopyobjectUserName);
+ delete(aCopyobjectUserName);
/* Add as a selected object */
/* Clear any previous selection : */
return true;
}
+QString GEOMBase::GetDefaultName(const QString& theOperation)
+{
+ SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
+ int aNumber = 0;
+ QString aName;
+ SALOMEDS::SObject_var obj;
+
+ do
+ {
+ aName = theOperation+"_"+QString::number(++aNumber);
+ obj = aStudy->FindObject(aName);
+ }
+ while (!obj->_is_nil());
+
+ return aName;
+}
+
//=====================================================================================
// EXPORTED METHODS
bool SelectionByNameInDialogs(QWidget* aWidget, const QString& userObjectName, SALOME_Selection *Sel);
bool DefineDlgPosition(QWidget* aDlg, int& x, int& y);
+ /* This method generates default names for results of geometrical operations */
+ static QString GetDefaultName(const QString& theOperation);
+
GEOMContext* myGeomGUI;
GEOM::GEOM_Gen_var myGeom; /* Current Geom Component */
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
+#include <qpushbutton.h>
class GEOMBase_Skeleton : public DlgRef_Skeleton_QTD
{
TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Shape_ptr aShape )
{
-
+
TopoDS_Shape S;
TCollection_AsciiString IOR(aShape->Name());
Standard_Integer anIndex = Find(IOR, S);
/* GetCurrentStudy */
int studyId = desktop->getActiveStudy()->getStudyId();
GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
}
+ /* GetCurrentStudy */
+ int studyId = desktop->getActiveStudy()->getStudyId();
+ GeomGUI->myComponentGeom->GetCurrentStudy(studyId);
+
+ GeomGUI->myNbGeom = GeomGUI->myComponentGeom->NbLabels();
+
return GeomGUI;
}
#include "QAD_Desktop.h"
#include "GEOM_Client.hxx"
-#include "GEOM_Sketcher.h"
#include <OSD_SharedLibrary.hxx>
#include <qapplication.h>
private :
QDialog* myActiveDialogBox; /* Unique active dialog box */
- int myNbGeom; /* Unique name for a geom entity */
GEOM_Client myShapeReader;
Standard_CString myFatherior;
- Sketch mySketcher;
public :
+ int myNbGeom; /* Unique name for a geom entity */
+
static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
static GEOMContext* GetGeomGUI();
int& GetNbGeom(){return myNbGeom;};
GEOM_Client& GetShapeReader(){return myShapeReader;};
Standard_CString& GetFatherior(){return myFatherior;};
- Sketch& GetSketcher(){return mySketcher;};
bool LoadLibrary(QString GUILibrary);
msgid "GEOM_WIRE"
msgstr "Wire"
+#Wire(s)
+msgid "GEOM_WIRES"
+msgstr "Wire(s)"
+
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Parameter :"
msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change Orientation"
+#: GeometryGUI_PartitionDlg.cxx:45
+msgid "SUPPRESS_RESULT"
+msgstr "Suppress Result"
+
#: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE"
msgstr "Pipe Construction"
msgstr "Element Type"
msgid "GEOM_BUT_CLOSE_SKETCH"
-msgstr "Close Sketcher"
+msgstr "Close Sketch"
msgid "GEOM_BUT_END_SKETCH"
-msgstr "End Sketcher"
+msgstr "End Sketch"
msgid "GEOM_SKETCHER_TITLE"
-msgstr "Spline Construction"
+msgstr "Sketch Construction"
msgid "GEOM_SKETCHER_POINT"
msgstr "Point"
msgid "GEOM_SKETCHER_TYPE"
msgstr "Type"
+
+msgid "GEOM_FILLET_ABORT"
+msgstr "Fillet can't be computed with radius %1"
+
+msgid "GEOM_CHAMFER_ABORT"
+msgstr "Chamfer can't be computed with %1 and %2"
+
msgid "GEOM_BUT_YES"
msgstr "&Oui"
+#Button No
+msgid "GEOM_BUT_NO"
+msgstr "&Non"
+
#Button Help
msgid "GEOM_BUT_HELP"
msgstr "&Aide"
#: GeometryGUI.cxx:563
msgid "GEOM_INF_LOADED"
-msgstr "Le fichier %1 est chargé."
+msgstr "Le fichier %1 est chargé."
#
#==============================================================================
#: GeometryGUI.cxx:3069
msgid "GEOM_PRP_COMMAND"
-msgstr "Pas de commande associée à l'id = %1."
+msgstr "Pas de commande associée à l'id = %1."
#: GeometryGUI.cxx:4977
msgid "GEOM_PRP_ABORT"
-msgstr "L'opération a echoué"
+msgstr "L'opération a echoué"
#: GeometryGUI.cxx:5058
msgid "GEOM_PRP_DONE"
-msgstr "Opération effectuée"
+msgstr "Opération effectuée"
#: GeometryGUI.cxx:3717
msgid "GEOM_PRP_LOADING"
#: GeometryGUI.cxx:1412
msgid "GEOM_PRP_NULLSHAPE"
-msgstr "Erreur, objet inconsistant ou inapproprié !"
+msgstr "Erreur, objet inconsistant ou inapproprié !"
#: GeometryGUI.cxx:5072
msgid "GEOM_PRP_READY"
-msgstr "Prêt..."
+msgstr "Prêt..."
#: GeometryGUI.cxx:1690
msgid "GEOM_PRP_SELECT_SUBSHAPES"
#: GeometryGUI.cxx:3941
msgid "GEOM_MEN_COMPONENT"
-msgstr "Géometrie"
+msgstr "Géometrie"
#: GeometryGUI.cxx:4389
msgid "GEOM_MEN_ENTER_ANGLE"
-msgstr "Saisir un angle en degrés"
+msgstr "Saisir un angle en degrés"
#: GeometryGUI.cxx:3758
msgid "GEOM_MEN_EXPORT"
msgid "GEOM_MEN_IMPORT_STEP"
msgstr "Fichiers STEP ( *.step *.stp )"
+#: GeometryGUI.cxx:3763
+msgid "GEOM_MEN_LOAD_SCRIPT"
+msgstr "Fichiers PYTHON ( *.py )"
+
#: GeometryGUI.cxx:2931
msgid "GEOM_MEN_ISOS"
msgstr "Choisir un nombre d'isos"
msgid "GEOM_WRN_WARNING"
msgstr "Avertissement"
+#: GeometryGUI.cxx:3854
+msgid "GEOM_REALLY_DELETE"
+msgstr "Voulez-vous supprimer l'object(s) ?"
+
#
#==============================================================================
#
#Object and result
msgid "GEOM_OBJECT_RESULT"
-msgstr "Objet Et Résultat"
+msgstr "Objet Et Résultat"
#Point
msgid "GEOM_POINT"
msgstr "Point Centre"
#Diagonal Points
-msgid "GEOM__DIAGONAL_POINTS"
+msgid "GEOM_DIAGONAL_POINTS"
msgstr "Points Diagonaux"
#Central Point
#Coordinates
msgid "GEOM_COORDINATES"
-msgstr "Coordonnées"
+msgstr "Coordonnées"
#Coor.
msgid "GEOM_COOR"
#Water Density
msgid "GEOM_WATER_DENSITY"
-msgstr "Densité de l'eau :"
+msgstr "Densité de l'eau :"
#Meshing Deflection
msgid "GEOM_MESHING_DEFLECTION"
-msgstr "Déflection Du Maillage :"
+msgstr "Déflection Du Maillage :"
#Dimensions
msgid "GEOM_DIMENSIONS"
#Precision
msgid "GEOM_PRECISION"
-msgstr "Précision :"
+msgstr "Précision :"
#Selection
msgid "GEOM_SELECTION"
-msgstr "Sélection"
+msgstr "Sélection"
#Nb. Times
msgid "GEOM_NB_TIMES"
#Tolerance
msgid "GEOM_TOLERANCE"
-msgstr "Tolérance"
+msgstr "Tolérance"
#Orientation
msgid "GEOM_ORIENTATION"
#Revolution
msgid "GEOM_REVOLUTION"
-msgstr "Révolution"
+msgstr "Révolution"
#Rotation
msgid "GEOM_ROTATION"
#Archimede
msgid "GEOM_ARCHIMEDE"
-msgstr "Archimède"
+msgstr "Archimède"
#Common
msgid "GEOM_COMMON"
msgid "GEOM_CIRCLE"
msgstr "Cercle"
+#Ellipse
+msgid "GEOM_ELLIPSE"
+msgstr "Ellipse"
+
+msgid "GEOM_ELLIPSE_TITLE"
+msgstr "Construction d'Ellipses"
+
+#Radius major
+msgid "GEOM_RADIUS_MAJOR"
+msgstr "Rayon max. :"
+
+#Radius minor
+msgid "GEOM_RADIUS_MINOR"
+msgstr "Rayon min. :"
+
#Compound
msgid "GEOM_COMPOUND"
msgstr "Compound"
#Sphere
msgid "GEOM_SPHERE"
-msgstr "Sphère"
+msgstr "Sphère"
#Conical Face
msgid "GEOM_SURFCONE"
#Spherical Face
msgid "GEOM_SURFSPHERE"
-msgstr "Face Sphèrique"
+msgstr "Face Sphèrique"
#Toroidal Face
msgid "GEOM_SURFTORUS"
#Wire
msgid "GEOM_WIRE"
msgstr "Wire"
+
+#Wire(s)
+msgid "GEOM_WIRES"
+msgstr "Wire(s)"
#Parameter
msgid "GEOM_PARAMETER"
-msgstr "Paramètre :"
+msgstr "Paramètre :"
#
#: GeometryGUI.cxx
msgid "GEOM_STEP_TITLE"
-msgstr "Increment par défaut lors des constructions"
+msgstr "Increment par défaut lors des constructions"
#: GeometryGUI_ArcDlg.cxx:45
msgid "GEOM_ARC_TITLE"
#: GeometryGUI_ArchimedeDlg.cxx:55
msgid "GEOM_ARCHIMEDE_TITLE"
-msgstr "Construction d'Archimède"
+msgstr "Construction d'Archimède"
#: GeometryGUI_BndBoxDlg.cxx:59
msgid "GEOM_BNDBOX_TITLE"
#: GeometryGUI_CenterMassDlg.cxx:77
msgid "GEOM_CMASS_TITLE"
-msgstr "Centre De Gravité"
+msgstr "Centre De Gravité"
msgid "GEOM_PLANE_SIZE"
msgstr "Taille du plan :"
#: GeometryGUI_CompoundDlg.cxx:44
msgid "GEOM_COMPOUND_TITLE"
-msgstr "Création d'un Compound"
+msgstr "Création d'un Compound"
#: GeometryGUI_ConeDlg.cxx:49
msgid "GEOM_CONE_TITLE"
#: GeometryGUI_EdgeDlg.cxx:47
msgid "GEOM_EDGE_TITLE"
-msgstr "Création d'un Edge"
+msgstr "Création d'un Edge"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_TITLE"
-msgstr "Construction d'un Congé"
+msgstr "Construction d'un Congé"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_ALL"
-msgstr "Congé sur toute la Shape"
+msgstr "Congé sur toute la Shape"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_EDGES"
-msgstr "Congé sur Edges de la Shape"
+msgstr "Congé sur Edges de la Shape"
#: GeometryGUI_FilletDlg.cxx:58
msgid "GEOM_FILLET_FACES"
-msgstr "Congé sur Faces de la Shape"
+msgstr "Congé sur Faces de la Shape"
#: GeometryGUI_FaceDlg.cxx:49
msgid "GEOM_FACE_TITLE"
-msgstr "Création d'une Face"
+msgstr "Création d'une Face"
#: GeometryGUI_FaceDlg.cxx:78
msgid "GEOM_FACE_FFW"
#: GeometryGUI_FaceDlg.cxx:103
msgid "GEOM_FACE_OPT"
-msgstr "Création d'une Face plane"
+msgstr "Création d'une Face plane"
#: GeometryGUI_FillingDlg.cxx:53
msgid "GEOM_FILLING_TITLE"
msgid "GEOM_PARTITION_ORIENTATION"
msgstr "Change l'orientation"
+#: GeometryGUI_PartitionDlg.cxx:45
+msgid "SUPPRESS_RESULT"
+msgstr "Suppress Result"
+
#: GeometryGUI_PipeDlg.cxx:47
msgid "GEOM_PIPE_TITLE"
msgstr "Construction d'une Pipe"
msgid "GEOM_SHELL_TITLE"
msgstr "Construction d'une Shell"
-#: GeometryGUI_ShellDlg.cxx:74
-msgid "GEOM_SHELL_LIST"
-msgstr "List de Faces Connectees"
+#: GeometryGUI_SolidDlg.cxx:74
+msgid "GEOM_SOLID_TITLE"
+msgstr "Construction d'un Solid"
#: GeometryGUI_SphereDlg.cxx:50
msgid "GEOM_SPHERE_TITLE"
msgstr "Creation d'un Wire a partir de wires/edges connectes"
#: GeometryGUI_WorkingPlaneDlg.cxx:50
-msgid "GEOM_WPALNE_TITLE"
+msgid "GEOM_WPLANE_TITLE"
msgstr "plan de travail"
#: GeometryGUI_WorkingPlaneDlg.cxx:107
-msgid "GEOM_WPALNE_FACE"
+msgid "GEOM_WPLANE_FACE"
msgstr "Plan Ou Face plane"
#: GeometryGUI_multiTranslationDlg.cxx:107
msgstr "Multi Rotation Double"
msgid "GEOM_PARAM_POINT"
-msgstr "Point paramétrique"
+msgstr "Point paramétrique"
#
#==============================================================================
#: GeometryGUI.cxx:4613
msgid "GEOM_MEN_SHADING"
-msgstr "Ombré"
+msgstr "Ombré"
+
+msgid "GEOM_RECONSTRUCTION_LIMIT"
+msgstr "Limite de Reconstruction"
+
+msgid "GEOM_SUPPRESS_RESULT"
+msgstr "Supprimer le Resultat"
+
+msgid "GEOM_SUPPRESS_RESULT_INSIDE"
+msgstr "Intérieur"
+
+msgid "GEOM_SUPPRESS_RESULT_OUTSIDE"
+msgstr "Extérieur"
+
+msgid "GEOM_RECONSTRUCTION_LIMIT_SHAPE"
+msgstr "Shape"
+msgid "GEOM_RECONSTRUCTION_LIMIT_SOLID"
+msgstr "Solid"
+msgid "GEOM_RECONSTRUCTION_LIMIT_SHELL"
+msgstr "Shell"
+msgid "GEOM_RECONSTRUCTION_LIMIT_FACE"
+msgstr "Face"
+msgid "GEOM_RECONSTRUCTION_LIMIT_WIRE"
+msgstr "Wire"
+msgid "GEOM_RECONSTRUCTION_LIMIT_EDGE"
+msgstr "Edge"
+msgid "GEOM_RECONSTRUCTION_LIMIT_VERTEX"
+msgstr "Vertex"
+
+msgid "GEOM_SPLINE_TITLE"
+msgstr "Construction de Splines"
+msgid "GEOM_SPLINE"
+msgstr "Spline"
+msgid "GEOM_BEZIER"
+msgstr "Bezier"
+msgid "GEOM_INTERPOL"
+msgstr "Interpolation"
+
+#
+#==============================================================================
+#
+
+msgid "GEOM_SKETCHER_EL"
+msgstr "Type d'Element"
+
+msgid "GEOM_BUT_CLOSE_SKETCH"
+msgstr "Fermer Sketch"
+
+msgid "GEOM_BUT_END_SKETCH"
+msgstr "Terminer Sketch"
+
+msgid "GEOM_SKETCHER_TITLE"
+msgstr "Construction de Sketch"
+
+msgid "GEOM_SKETCHER_POINT"
+msgstr "Point"
+
+msgid "GEOM_SKETCHER_SEGMENT"
+msgstr "Sègment"
+
+msgid "GEOM_SKETCHER_ARC"
+msgstr "Arc"
+
+msgid "GEOM_SKETCHER_DIR"
+msgstr "Direction"
+
+msgid "GEOM_SKETCHER_POINT2"
+msgstr "Point :"
+
+msgid "GEOM_SKETCHER_DEST"
+msgstr "Destination"
+
+msgid "GEOM_SKETCHER_ABS"
+msgstr "Absolu"
+
+msgid "GEOM_SKETCHER_REL"
+msgstr "Relative"
+
+msgid "GEOM_SKETCHER_SEL"
+msgstr "Sélection"
+
+msgid "GEOM_SKETCHER_ANGLE"
+msgstr "Angle"
+
+msgid "GEOM_SKETCHER_PER"
+msgstr "Perpendiculaire"
+
+msgid "GEOM_SKETCHER_TAN"
+msgstr "Tangent"
+
+msgid "GEOM_SKETCHER_VXVY"
+msgstr "VX-VY"
+
+msgid "GEOM_SKETCHER_LENGTH"
+msgstr "Longueur"
+
+msgid "GEOM_SKETCHER_X"
+msgstr "X"
+
+msgid "GEOM_SKETCHER_Y"
+msgstr "Y"
+
+msgid "GEOM_SKETCHER_X2"
+msgstr "X :"
+
+msgid "GEOM_SKETCHER_Y2"
+msgstr "Y :"
+
+msgid "GEOM_SKETCHER_X3"
+msgstr "Abs. X :"
+
+msgid "GEOM_SKETCHER_Y3"
+msgstr "Abs. Y :"
+
+msgid "GEOM_SKETCHER_DX2"
+msgstr "DX :"
+
+msgid "GEOM_SKETCHER_DY2"
+msgstr "DY :"
+
+msgid "GEOM_SKETCHER_VX2"
+msgstr "VX :"
+
+msgid "GEOM_SKETCHER_VY2"
+msgstr "VY :"
+
+msgid "GEOM_SKETCHER_LENGTH2"
+msgstr "Longueur :"
+
+msgid "GEOM_SKETCHER_ANGLE2"
+msgstr "Angle :"
+
+msgid "GEOM_SKETCHER_RADIUS2"
+msgstr "Radius :"
+
+msgid "GEOM_SKETCHER_UNDO"
+msgstr "Undo"
+
+msgid "GEOM_SKETCHER_APPLY"
+msgstr "Appliquer"
+
+msgid "GEOM_SKETCHER_VALUES"
+msgstr "Valeurs"
+
+msgid "GEOM_SKETCHER_TYPE"
+msgstr "Type"
+
+msgid "GEOM_FILLET_ABORT"
+msgstr "Le congé ne peut-être realisé avec un rayon de %1 "
+
+msgid "GEOM_CHAMFER_ABORT"
+msgstr "Le chanfrein ne peut-être realisé avec %1 et %2 "
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -lGEOMSketcher -L${KERNEL_ROOT_DIR}/lib/salome
+LDFLAGS += -lOCCViewer -lVTKViewer -lSalomeObject -lSalomeGUI -lGEOMClient -lGEOMObject -L${KERNEL_ROOT_DIR}/lib/salome
@CONCLUDE@
TDF_Label L = it.Value() ;
if( L.FindAttribute(TDataStd_Name::GetID(), anAttName) ) {
notTested = L.ForgetAttribute(TDataStd_Name::GetID()) ;
+ if(notTested)
+ MESSAGE("in GEOMDS_Commands::ClearAllIOR : IOR CLEARED" )
+ ClearAllIOR(L);
}
- if(notTested)
- MESSAGE("in GEOMDS_Commands::ClearAllIOR : IOR CLEARED" )
}
return true ;
}
#endif
#ifndef _GEOMDS_Commands_HeaderFile
#include "GEOMDS_Commands.hxx"
-#endif
\ No newline at end of file
+#endif
// Module : GEOM
// $Header$
-using namespace std;
#include "GeometryGUI.h"
// Open CASCADE Includes
#include "OCCViewer_Viewer3d.h"
#include "OCCViewer_ViewPort3d.h"
#include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_InteractorStyleSALOME.h"
#include "SALOME_Selection.h"
+using namespace std;
+
/* The object itself created in the static method 'GetOrCreateGEOMBase()' */
static GEOMContext* GeomGUI = 0;
// function : GeometryGUI()
// purpose : Constructor
//=======================================================================
-GeometryGUI::GeometryGUI() :
- QObject()
-{
-}
+GeometryGUI::GeometryGUI( const QString& theName, QObject* theParent ) :
+ SALOMEGUI( theName, theParent )
+{}
//=======================================================================
return false;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
- Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
- if(theCommandID == 4041 || // SKETCHER - POPUP VIEWER - SEGMENT
- theCommandID == 4042 || // SKETCHER - POPUP VIEWER - ARC
- theCommandID == 4043 || // SKETCHER - POPUP VIEWER - SET ANGLE
- theCommandID == 4044 || // SKETCHER - POPUP VIEWER - SET X
- theCommandID == 4045 || // SKETCHER - POPUP VIEWER - SET Y
- theCommandID == 4046 || // SKETCHER - POPUP VIEWER - DELETE
- theCommandID == 4047 || // SKETCHER - POPUP VIEWER - END
- theCommandID == 4048 || // SKETCHER - POPUP VIEWER - CLOSE
- theCommandID == 4051 || // SKETCHER - MENU - SET PLANE
- theCommandID == 4052 || // SKETCHER - MENU - TANGENT
- theCommandID == 4053 || // SKETCHER - MENU - PERPENDICULAR
- theCommandID == 4061 || // SKETCHER - MENU - LENGTH
- theCommandID == 4062 || // SKETCHER - MENU - ANGLE
- theCommandID == 4063 || // SKETCHER - MENU - RADIUS
- theCommandID == 4064 || // SKETCHER - MENU - X
- theCommandID == 4065) { // SKETCHER - MENU - Y
+ if(theCommandID == 111 || // MENU FILE - IMPORT BREP
+ theCommandID == 112 || // MENU FILE - IMPORT IGES
+ theCommandID == 113 || // MENU FILE - IMPORT STEP
+ theCommandID == 121 || // MENU FILE - EXPORT BREP
+ theCommandID == 122 || // MENU FILE - EXPORT IGES
+ theCommandID == 123 || // MENU FILE - EXPORT STEP
+ theCommandID == 31 || // MENU EDIT - COPY
+ theCommandID == 33 || // MENU EDIT - DELETE
+ theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
+ theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
+ theCommandID == 413 || // MENU SETTINGS - ISOS
+ theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
+ theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
+ theCommandID == 5104 || // MENU TOOLS - LOAD SCRIPT
+ theCommandID == 8032 || // POPUP VIEWER - COLOR
+ theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
+ theCommandID == 8034 || // POPUP VIEWER - ISOS
+ theCommandID == 804 || // POPUP VIEWER - ADD IN STUDY
+ theCommandID == 901 || // OBJECT BROWSER - RENAME
+ theCommandID == 9024) { // OBJECT BROWSER - OPEN
+ if(!GeomGUI->LoadLibrary("libGEOMToolsGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 211 || // MENU VIEW - WIREFRAME/SHADING
+ theCommandID == 212 || // MENU VIEW - DISPLAY ALL
+ theCommandID == 213 || // MENU VIEW - DISPLAY ONLY
+ theCommandID == 214 || // MENU VIEW - ERASE ALL
+ theCommandID == 215 || // MENU VIEW - ERASE ONLY
+ theCommandID == 8031) { // POPUP VIEWER - WIREFRAME/SHADING
+ if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4011 || // MENU BASIC - POINT
+ theCommandID == 4012 || // MENU BASIC - LINE
+ theCommandID == 4013 || // MENU BASIC - CIRCLE
+ theCommandID == 4014 || // MENU BASIC - ELLIPSE
+ theCommandID == 4015 || // MENU BASIC - ARC
+ theCommandID == 4016 || // MENU BASIC - VECTOR
+ theCommandID == 4017 || // MENU BASIC - PLANE
+ theCommandID == 4018) { // MENU BASIC - WPLANE
+ if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4021 || // MENU PRIMITIVE - BOX
+ theCommandID == 4022 || // MENU PRIMITIVE - CYLINDER
+ theCommandID == 4023 || // MENU PRIMITIVE - SPHERE
+ theCommandID == 4024 || // MENU PRIMITIVE - TORUS
+ theCommandID == 4025) { // MENU PRIMITIVE - CONE
+ if(!GeomGUI->LoadLibrary("libPrimitiveGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 4031 || // MENU GENERATION - PRISM
+ theCommandID == 4032 || // MENU GENERATION - REVOLUTION
+ theCommandID == 4033 || // MENU GENERATION - FILLING
+ theCommandID == 4034) { // MENU GENERATION - PIPE
+ if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 404 || // MENU ENTITY - SKETCHER
+ theCommandID == 407) { // MENU ENTITY - EXPLODE
if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
return false;
}
- else {
- if(GeomGUI->myState == 2) {
- Mb->setItemEnabled(405, false);//SKETCHER
- GeomGUI->GetSketcher().Clear();
- GeomGUI->myState = -1;
- }
-
- if(theCommandID == 111 || // MENU FILE - IMPORT BREP
- theCommandID == 112 || // MENU FILE - IMPORT IGES
- theCommandID == 113 || // MENU FILE - IMPORT STEP
- theCommandID == 121 || // MENU FILE - EXPORT BREP
- theCommandID == 122 || // MENU FILE - EXPORT IGES
- theCommandID == 123 || // MENU FILE - EXPORT STEP
- theCommandID == 31 || // MENU EDIT - COPY
- theCommandID == 33 || // MENU EDIT - DELETE
- theCommandID == 411 || // MENU SETTINGS - ADD IN STUDY
- theCommandID == 412 || // MENU SETTINGS - SHADING COLOR
- theCommandID == 413 || // MENU SETTINGS - ISOS
- theCommandID == 414 || // MENU SETTINGS - STEP VALUE FOR SPIN BOXES
- theCommandID == 5103 || // MENU TOOLS - CHECK GEOMETRY
- theCommandID == 5104 || // MENU TOOLS - LOAD SCRIPT
- theCommandID == 8032 || // POPUP VIEWER - COLOR
- theCommandID == 8033 || // POPUP VIEWER - TRANSPARENCY
- theCommandID == 8034 || // POPUP VIEWER - ISOS
- theCommandID == 804 || // POPUP VIEWER - ADD IN STUDY
- theCommandID == 901 || // OBJECT BROWSER - RENAME
- theCommandID == 9024) { // OBJECT BROWSER - OPEN
- if(!GeomGUI->LoadLibrary("libGEOMToolsGUI.so"))
- return false;
- }
- else if(theCommandID == 211 || // MENU VIEW - WIREFRAME/SHADING
- theCommandID == 212 || // MENU VIEW - DISPLAY ALL
- theCommandID == 213 || // MENU VIEW - DISPLAY ONLY
- theCommandID == 214 || // MENU VIEW - ERASE ALL
- theCommandID == 215 || // MENU VIEW - ERASE ONLY
- theCommandID == 8031) { // POPUP VIEWER - WIREFRAME/SHADING
- if(!GeomGUI->LoadLibrary("libDisplayGUI.so"))
- return false;
- }
- else if(theCommandID == 4011 || // MENU BASIC - POINT
- theCommandID == 4012 || // MENU BASIC - LINE
- theCommandID == 4013 || // MENU BASIC - CIRCLE
- theCommandID == 4014 || // MENU BASIC - ELLIPSE
- theCommandID == 4015 || // MENU BASIC - ARC
- theCommandID == 4016 || // MENU BASIC - VECTOR
- theCommandID == 4017 || // MENU BASIC - PLANE
- theCommandID == 4018) { // MENU BASIC - WPLANE
- if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
- return false;
- }
- else if(theCommandID == 4021 || // MENU PRIMITIVE - BOX
- theCommandID == 4022 || // MENU PRIMITIVE - CYLINDER
- theCommandID == 4023 || // MENU PRIMITIVE - SPHERE
- theCommandID == 4024 || // MENU PRIMITIVE - TORUS
- theCommandID == 4025) { // MENU PRIMITIVE - CONE
- if(!GeomGUI->LoadLibrary("libPrimitiveGUI.so"))
- return false;
- }
- else if(theCommandID == 4031 || // MENU GENERATION - PRISM
- theCommandID == 4032 || // MENU GENERATION - REVOLUTION
- theCommandID == 4033 || // MENU GENERATION - FILLING
- theCommandID == 4034) { // MENU GENERATION - PIPE
- if(!GeomGUI->LoadLibrary("libGenerationGUI.so"))
- return false;
- }
- else if(theCommandID == 404 || // SKETCHER
- theCommandID == 407) { // MENU ENTITY - EXPLODE
- if(!GeomGUI->LoadLibrary("libEntityGUI.so"))
- return false;
- }
- else if(theCommandID == 4081 || // MENU BUILD - EDGE
- theCommandID == 4082 || // MENU BUILD - WIRE
- theCommandID == 4083 || // MENU BUILD - FACE
- theCommandID == 4084 || // MENU BUILD - SHELL
- theCommandID == 4085 || // MENU BUILD - SOLID
- theCommandID == 4086) { // MENU BUILD - COMPUND
- if(!GeomGUI->LoadLibrary("libBuildGUI.so"))
- return false;
- }
- else if(theCommandID == 5011 || // MENU BOOLEAN - FUSE
- theCommandID == 5012 || // MENU BOOLEAN - COMMON
- theCommandID == 5013 || // MENU BOOLEAN - CUT
- theCommandID == 5014) { // MENU BOOLEAN - SECTION
- if(!GeomGUI->LoadLibrary("libBooleanGUI.so"))
- return false;
- }
- else if(theCommandID == 5021 || // MENU TRANSFORMATION - TRANSLATION
- theCommandID == 5022 || // MENU TRANSFORMATION - ROTATION
- theCommandID == 5023 || // MENU TRANSFORMATION - MIRROR
- theCommandID == 5024 || // MENU TRANSFORMATION - SCALE
- theCommandID == 5025 || // MENU TRANSFORMATION - MULTI-TRANSLATION
- theCommandID == 5026) { // MENU TRANSFORMATION - MULTI-ROTATION
- if(!GeomGUI->LoadLibrary("libTransformationGUI.so"))
- return false;
- }
- else if(theCommandID == 503 || // MENU OPERATION - PARTITION
- theCommandID == 504 || // MENU OPERATION - ARCHIMEDE
- theCommandID == 505 || // MENU OPERATION - FILLET
- theCommandID == 506) { // MENU OPERATION - CHAMFER
- if(!GeomGUI->LoadLibrary("libOperationGUI.so"))
- return false;
- }
- else if(theCommandID == 601 || // MENU REPAIR - SEWING
- theCommandID == 602 || // MENU REPAIR - ORIENTATION
- theCommandID == 603 || // MENU REPAIR - SUPPRESS FACES
- theCommandID == 604) { // MENU REPAIR - SUPPRESS HOLE
- if(!GeomGUI->LoadLibrary("libRepairGUI.so"))
- return false;
- }
- else if(theCommandID == 701 || // MENU MEASURE - PROPERTIES
- theCommandID == 702 || // MENU MEASURE - CDG
- theCommandID == 703 || // MENU MEASURE - INERTIA
- theCommandID == 7041 || // MENU MEASURE - BOUNDING BOX
- theCommandID == 7042 || // MENU MEASURE - MIN DISTANCE
- theCommandID == 705 || // MENU MEASURE - TOLERANCE
- theCommandID == 706 || // MENU MEASURE - WHATIS
- theCommandID == 707) { // MENU MEASURE - CHECK
- if(!GeomGUI->LoadLibrary("libMeasureGUI.so"))
- return false;
- }
- else
+ else if(theCommandID == 4081 || // MENU BUILD - EDGE
+ theCommandID == 4082 || // MENU BUILD - WIRE
+ theCommandID == 4083 || // MENU BUILD - FACE
+ theCommandID == 4084 || // MENU BUILD - SHELL
+ theCommandID == 4085 || // MENU BUILD - SOLID
+ theCommandID == 4086) { // MENU BUILD - COMPUND
+ if(!GeomGUI->LoadLibrary("libBuildGUI.so"))
return false;
}
-
+ else if(theCommandID == 5011 || // MENU BOOLEAN - FUSE
+ theCommandID == 5012 || // MENU BOOLEAN - COMMON
+ theCommandID == 5013 || // MENU BOOLEAN - CUT
+ theCommandID == 5014) { // MENU BOOLEAN - SECTION
+ if(!GeomGUI->LoadLibrary("libBooleanGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 5021 || // MENU TRANSFORMATION - TRANSLATION
+ theCommandID == 5022 || // MENU TRANSFORMATION - ROTATION
+ theCommandID == 5023 || // MENU TRANSFORMATION - MIRROR
+ theCommandID == 5024 || // MENU TRANSFORMATION - SCALE
+ theCommandID == 5025 || // MENU TRANSFORMATION - MULTI-TRANSLATION
+ theCommandID == 5026) { // MENU TRANSFORMATION - MULTI-ROTATION
+ if(!GeomGUI->LoadLibrary("libTransformationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 503 || // MENU OPERATION - PARTITION
+ theCommandID == 504 || // MENU OPERATION - ARCHIMEDE
+ theCommandID == 505 || // MENU OPERATION - FILLET
+ theCommandID == 506) { // MENU OPERATION - CHAMFER
+ if(!GeomGUI->LoadLibrary("libOperationGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 601 || // MENU REPAIR - SEWING
+ theCommandID == 602 || // MENU REPAIR - ORIENTATION
+ theCommandID == 603 || // MENU REPAIR - SUPPRESS FACES
+ theCommandID == 604) { // MENU REPAIR - SUPPRESS HOLE
+ if(!GeomGUI->LoadLibrary("libRepairGUI.so"))
+ return false;
+ }
+ else if(theCommandID == 701 || // MENU MEASURE - PROPERTIES
+ theCommandID == 702 || // MENU MEASURE - CDG
+ theCommandID == 703 || // MENU MEASURE - INERTIA
+ theCommandID == 7041 || // MENU MEASURE - BOUNDING BOX
+ theCommandID == 7042 || // MENU MEASURE - MIN DISTANCE
+ theCommandID == 705 || // MENU MEASURE - TOLERANCE
+ theCommandID == 706 || // MENU MEASURE - WHATIS
+ theCommandID == 707) { // MENU MEASURE - CHECK
+ if(!GeomGUI->LoadLibrary("libMeasureGUI.so"))
+ return false;
+ }
+ else
+ return false;
+
//Load Function OnGUIEvent
OSD_Function osdF = GeomGUI->myGUILibrary.DlSymb("OnGUIEvent");
OGE (*f1) = NULL;
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
-
- if(GeomGUI->myState == 2) {
- OCCViewer_ViewPort* vp = ((OCCViewer_ViewFrame*)studyFrame->getRightFrame()->getViewFrame())->getViewPort();
- GeomGUI->GetSketcher().MakeCurrentEdge(pe->x(), pe->y(), ((OCCViewer_ViewPort3d*)vp)->getView());
- }
-
+ else
return true;
}
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
return false;
- if(GeomGUI->myState == 2) {
- GeomGUI->GetSketcher().ValidateEdge();
- if(GeomGUI->GetSketcher().GetmyEdgesNumber() == 1) {
- QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- Mb->setItemEnabled(405, true); // SKETCH CONTRAINTS
- }
- }
- else if(GeomGUI->myState == 0) {
+ if(GeomGUI->myState == 0) {
if(!GeomGUI->LoadLibrary("libBasicGUI.so"))
return false;
return false;
}
+static void UpdateVtkSelection(QAD_Desktop* parent)
+{
+ if (!parent->getActiveStudy()) return;
+
+ QList<QAD_StudyFrame> aFrameList = parent->getActiveStudy()->getStudyFrames();
+
+ for (QAD_StudyFrame* aStudyFrame = aFrameList.first(); aStudyFrame; aStudyFrame = aFrameList.next()) {
+ if (aStudyFrame->getTypeView() == VIEW_VTK) {
+ QAD_ViewFrame* aViewFrame = aStudyFrame->getRightFrame()->getViewFrame();
+ VTKViewer_ViewFrame* aVtkViewFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
+ if (!aVtkViewFrame) continue;
+ VTKViewer_RenderWindowInteractor* anInteractor = aVtkViewFrame->getRWInteractor();
+ if (anInteractor) {
+ anInteractor->SetSelectionProp();
+ anInteractor->SetSelectionTolerance();
+ VTKViewer_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
+ if (aStyle) {
+ aStyle->setPreselectionProp();
+ }
+ }
+ }
+ }
+}
+
//=================================================================================
// function : SetSettings()
}
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
- Mb->setItemEnabled(405, false);//SKETCHER
- Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
Mb->setItemEnabled(413, ViewOCC);// ShadingColor Settings
Mb->setItemEnabled(414, ViewOCC);// Isos Settings
+ // PAL5356: update VTK selection
+ ::UpdateVtkSelection(parent);
+
return true;
}
theObject = "";
theContext = "";
-
if((theParent.compare("Viewer") == 0)) {
- if(GeomGUI->myState == 2)
- theContext = "Sketch";
- else if(Sel->IObjectCount() == 0)
+ if(Sel->IObjectCount() == 0)
theContext = "NothingSelected";
}
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC) {
- if(theParent.compare("Viewer") == 0) {
- if(theContext.compare("Sketch") == 0) {
- SketchStatus myCS = GeomGUI->GetSketcher().GetCurrentStatus();
- popup->setCheckable(TRUE);
- if(myCS == SEGMENT) {
- popup->setItemChecked(4041, true); //Sketch Segment Menu
- popup->setItemChecked(4042, false); //Sketch Arc Menu
- }
- else if(myCS == ARC_CHORD) {
- popup->setItemChecked(4041, false); //Sketch Segment Menu
- popup->setItemChecked(4042, true); //Sketch Arc Menu
- }
- return true;
- }
- }
- }
-
if(!GeomGUI->LoadLibrary("libGEOMBase.so"))
return false;
// function : activeStudyChanged()
// purpose : static
//=================================================================================
-void GeometryGUI::activeStudyChanged(QAD_Desktop* parent)
+bool GeometryGUI::ActiveStudyChanged(QAD_Desktop* parent)
{
GeometryGUI::GetOrCreateGeometryGUI(parent);
if(GeomGUI != 0) {
QMenuBar* Mb = QAD_Application::getDesktop()->getMainMenuBar();
- if(GeomGUI->myState == 2) {
- Mb->setItemEnabled(405, false);//SKETCHER
- GeomGUI->GetSketcher().Clear();
- GeomGUI->myState = -1;
- }
-
bool ViewOCC = false;
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC)
ViewOCC = true;
Mb->setItemEnabled(404, ViewOCC);//SKETCHER
- Mb->setItemEnabled(406, ViewOCC);//SKETCHER
Mb->setItemEnabled(603, ViewOCC);//SuppressFace
Mb->setItemEnabled(604, ViewOCC);//SuppressHole
GeomGUI->EmitSignalCloseAllDialogs();
GeomGUI = 0;
}
- return;
+
+ // PAL5356: update VTK selection
+ ::UpdateVtkSelection(parent);
+
+ return true;
}
}
-//=================================================================================
-// EXPORTED METHODS
-//=================================================================================
-extern "C"
+void GeometryGUI::SupportedViewType(int* buffer, int bufferSize)
{
- bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
- {return GeometryGUI::OnGUIEvent(theCommandID, parent);}
-
- bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnKeyPress(pe, parent, studyFrame);}
-
- bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnMousePress(pe, parent, studyFrame);}
-
- bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
- {return GeometryGUI::OnMouseMove(pe, parent, studyFrame);}
-
- bool SetSettings(QAD_Desktop* parent)
- {return GeometryGUI::SetSettings(parent);}
-
- bool customPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext,
- const QString & theParent, const QString & theObject)
- {return GeometryGUI::CustomPopup(parent, popup, theContext, theParent, theObject);}
-
- void definePopup(QString & theContext, QString & parent, QString & theObject)
- {GeometryGUI::DefinePopup(theContext, parent, theObject);}
-
- bool activeStudyChanged(QAD_Desktop* parent)
- {GeometryGUI::activeStudyChanged(parent);}
+ if(!buffer || !bufferSize) return;
+ buffer[0] = (int)VIEW_OCC;
+ if (--bufferSize) buffer[1] = (int)VIEW_VTK;
+}
- void buildPresentation(const Handle(SALOME_InteractiveObject)& theIO)
- {GeometryGUI::BuildPresentation(theIO);}
+void GeometryGUI::Deactivate()
+{
+ if ( GeomGUI )
+ GeomGUI->EmitSignalCloseAllDialogs();
+}
- void supportedViewType(int* buffer, int bufferSize)
- {
- if(!buffer || !bufferSize) return;
- buffer[0] = (int)VIEW_OCC;
- if (--bufferSize) buffer[1] = (int)VIEW_VTK;
+static GeometryGUI aGUI("");
+extern "C"
+{
+ Standard_EXPORT SALOMEGUI* GetComponentGUI() {
+ return &aGUI;
}
}
#ifndef GEOMETRYGUI_H
#define GEOMETRYGUI_H
+#include "SALOMEGUI.h"
#include "GEOMContext.h"
//=================================================================================
// class : GeometryGUI
// purpose :
//=================================================================================
-class GeometryGUI : public QObject
+class GeometryGUI : public SALOMEGUI
{
Q_OBJECT /* for QT compatibility */
public :
- GeometryGUI();
- ~GeometryGUI();
-
- static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop);
-
- /* Managed by IAPP */
- Standard_EXPORT static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
- Standard_EXPORT static bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
- Standard_EXPORT static bool SetSettings(QAD_Desktop* parent);
- Standard_EXPORT static void activeStudyChanged(QAD_Desktop* parent);
- Standard_EXPORT static void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
- Standard_EXPORT static void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
- Standard_EXPORT static bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
- const QString& theParent, const QString& theObject);
-
+ GeometryGUI( const QString& name = "", QObject* parent = 0 );
+ ~GeometryGUI();
+
+ static GEOMContext* GetOrCreateGeometryGUI(QAD_Desktop* desktop);
+
+ /* Managed by IAPP */
+ virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
+ virtual bool OnMousePress(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool OnMouseMove(QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool OnKeyPress(QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame);
+ virtual bool SetSettings(QAD_Desktop* parent);
+ virtual bool ActiveStudyChanged(QAD_Desktop* parent);
+ virtual void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
+ virtual void DefinePopup(QString & theContext, QString & theParent, QString & theObject);
+ virtual bool CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString& theContext,
+ const QString& theParent, const QString& theObject);
+ virtual void SupportedViewType (int* buffer, int bufferSize);
+ virtual void Deactivate ();
};
#endif
#include "OCCViewer_Viewer3d.h"
#include <TopExp_Explorer.hxx>
#include <TopTools_MapOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
#include "VTKViewer_RenderWindowInteractor.h"
#include "VTKViewer_ViewFrame.h"
GEOM::GEOM_Shape_var aSubShape = Geom->GetIORFromString(SubIOR);
TopoDS_Shape subshape = ShapeReader.GetShape(Geom, aSubShape);
- TopExp_Explorer Exp ( shape, subshape.ShapeType() );
int index = 1;
- TopTools_MapOfShape M;
- while ( Exp.More() ) {
- if ( M.Add(Exp.Current()) ) {
- if ( Exp.Current().IsSame(subshape) )
- return index;
- index++;
- }
- Exp.Next();
- }
+ if(subshape.ShapeType() == TopAbs_COMPOUND) {
+ TopoDS_Iterator it;
+ TopTools_ListOfShape CL;
+ CL.Append(shape);
+ TopTools_ListIteratorOfListOfShape itC;
+ for(itC.Initialize(CL); itC.More(); itC.Next()) {
+ for(it.Initialize(itC.Value()); it.More(); it.Next()) {
+ if (it.Value().ShapeType() == TopAbs_COMPOUND) {
+ if (it.Value().IsSame(subshape))
+ return index;
+ else
+ index++;
+ CL.Append(it.Value());
+ }
+ }
+ }
+ }
+ else {
+ TopExp_Explorer Exp(shape, subshape.ShapeType());
+ TopTools_MapOfShape M;
+ while(Exp.More()) {
+ if(M.Add(Exp.Current())) {
+ if(Exp.Current().IsSame(subshape))
+ return index;
+ index++;
+ }
+ Exp.Next();
+ }
+ }
return -1;
}
case TopAbs_SHAPE:
{ return "Shape" ;}
}
+ return 0;
}
//
//
//
-// File : GEOMBase_Tools.cxx
+// File : GEOMToolsGUI.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
-using namespace std;
#include "GEOMToolsGUI.h"
#include "QAD_Config.h"
#include "QAD_Tools.h"
#include "QAD_MessageBox.h"
#include "QAD_RightFrame.h"
+#include "QAD_PyEditor.h"
#include "OCCViewer_Viewer3d.h"
#include "VTKViewer_ViewFrame.h"
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
#include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : GEOMToolsGUI()
// purpose : Constructor
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
break;
-
+
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
}
else {
Quantity_Color Default = Quantity_Color();
- color = QColor ((int)Default.Red() * 255.0, (int)Default.Green()* 255.0, (int)Default.Blue() * 255.0);
+ color = QColor ((int)( Default.Red() * 255.0 ), (int)( Default.Green() * 255.0 ), (int)( Default.Blue() * 255.0 ) );
}
QColor c = QColorDialog::getColor(color, QAD_Application::getDesktop());
else
IsoV = "1";
- GEOMBase_NbIsosDlg* NbIsosDlg = new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
+ GEOMToolsGUI_NbIsosDlg* NbIsosDlg = new GEOMToolsGUI_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
int UIso = IsoU.toInt();
int VIso = IsoV.toInt();
Quantity_Color CSFColor;
Shape->Color(CSFColor);
- QColor c = QColorDialog::getColor(QColor(CSFColor.Red() * 255.0, CSFColor.Green()* 255.0, CSFColor.Blue() * 255.0), QAD_Application::getDesktop());
+ QColor c = QColorDialog::getColor(QColor((int)(CSFColor.Red() * 255.0), (int)(CSFColor.Green() * 255.0), (int)(CSFColor.Blue() * 255.0)), QAD_Application::getDesktop());
if(c.isValid()) {
CSFColor = Quantity_Color (c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB);
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
ic = v3d->getAISContext();
}
- GEOMBase_TransparencyDlg *aDlg = new GEOMBase_TransparencyDlg(parent, "", Sel, ic);
+ GEOMToolsGUI_TransparencyDlg *aDlg = new GEOMToolsGUI_TransparencyDlg(parent, "", Sel, ic);
break;
}
case 8034: // ISOS - POPUP VIEWER
else
IsoV = "1";
- GEOMBase_NbIsosDlg * NbIsosDlg =
- new GEOMBase_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
+ GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
+ new GEOMToolsGUI_NbIsosDlg(QAD_Application::getDesktop(), tr("GEOM_MEN_ISOS"), TRUE);
NbIsosDlg->SpinBoxU->setValue(IsoU.toInt());
NbIsosDlg->SpinBoxV->setValue(IsoV.toInt());
while(useSubItems?anIter->More():!anAttr->_is_nil()) {
if(!obj->FindAttribute(anAttr, "AttributeIOR") &&
obj->FindAttribute(anAttr, "AttributePersistentRef")) {
- // load
- Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
- if (!CORBA::is_nil(comp)) {
- SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
- SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
- aStudyBuilder->LoadWith(aStudy->FindComponent("GEOM"),driver);
- }
+
+ SALOMEDS::SComponent_var FComp = obj->GetFatherComponent();
+ if (!CORBA::is_nil(FComp)) {
+ if (FComp->FindAttribute(anAttr, "AttributeName")) {
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ QString compName = parent->getComponentName(aName->Value());
+ // parent->loadComponentData(parent->getComponentName(aName->Value()));
+ Engines::Component_var comp ;
+ if ( compName.compare("SUPERV") == 0 ) {
+ comp = parent->getEngine( "SuperVisionContainer", compName) ;
+ }
+ else {
+ comp = parent->getEngine( "FactoryServer", compName);
+ if ( comp->_is_nil() )
+ comp = parent->getEngine( "FactoryServerPy", compName);
+ }
+
+ if (!CORBA::is_nil(comp)) {
+ SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
+ if (!CORBA::is_nil(driver)) {
+ SALOMEDS::StudyBuilder_var B = aStudy->NewBuilder();
+ if (!CORBA::is_nil(B)) {
+ B->LoadWith(FComp,driver);
+ } else {
+ return false;
+ }
+ } else {
+ MESSAGE("loadComponentData(): Driver is null");
+ return false;
+ }
+ } else {
+ MESSAGE("loadComponentData(): Engine is null");
+ return false;
+ }
+ // // load
+ // Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer","GEOM");
+ // if (!CORBA::is_nil(comp)) {
+ // SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp);
+ // SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ // SALOMEDS::SComponent_var SC = aStudy->FindComponent("GEOM");
+ // if (!CORBA::is_nil(SC))
+ // aStudyBuilder->LoadWith(SC,driver);
+ }
+ }
else {
MESSAGE("Component is null");
}
// if (aLocked) return false;
father->ComponentIOR(myGeomGUI->GetFatherior());
- QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->GetNbGeom()++);
+ QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++);
- if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
+ if(myGeomBase->Display(aShape, (char*)nameShape.latin1())) {
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
}
QApplication::setOverrideCursor( Qt::waitCursor );
// Standard_Boolean result = BRepTools::Write(Shape->Shape(), strdup(file.latin1()) );
try {
- myGeom->ExportBREP(strdup( file.latin1()), aShape);
+ myGeom->ExportBREP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
if ( !file.isEmpty() && !aShape->_is_nil() ) {
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- myGeom->ExportIGES(strdup( file.latin1()), aShape);
+ myGeom->ExportIGES((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
QApplication::setOverrideCursor( Qt::waitCursor ) ;
try {
- myGeom->ExportSTEP(strdup( file.latin1()), aShape);
+ myGeom->ExportSTEP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
QApplication::restoreOverrideCursor() ;
+ return true;
}
//
//
//
-// File : GEOMBase_NbIsosDlg.cxx
+// File : GEOMToolsGUI_NbIsosDlg.cxx
// Author :
// Module : GEOM
// $Header:
#include <qspinbox.h>
//=================================================================================
-// class : GEOMBase_NbIsosDlg()
-// purpose : Constructs a GEOMBase_NbIsosDlg which is a child of 'parent', with the
+// class : GEOMToolsGUI_NbIsosDlg()
+// purpose : Constructs a GEOMToolsGUI_NbIsosDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
+GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
:QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
if( !name )
- setName("GEOMBase_NbIsosDlg");
+ setName("GEOMToolsGUI_NbIsosDlg");
setCaption(name);
setSizeGripEnabled(TRUE);
QGridLayout* MyDialogLayout = new QGridLayout(this);
//=================================================================================
-// function : ~GEOMBase_NbIsosDlg()
+// function : ~GEOMToolsGUI_NbIsosDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
-GEOMBase_NbIsosDlg::~GEOMBase_NbIsosDlg()
+GEOMToolsGUI_NbIsosDlg::~GEOMToolsGUI_NbIsosDlg()
{
// no need to delete child widgets, Qt does it all for us
}
//
//
//
-// File : GEOMBase_NbIsosDlg.h
+// File : GEOMToolsGUI_NbIsosDlg.h
// Author :
// Module : GEOM
// $Header:
-#ifndef GEOMBASE_NBISOSDLG_H
-#define GEOMBASE_NBISOSDLG_H
+#ifndef GEOMTOOLSGUI_NBISOSDLG_H
+#define GEOMTOOLSGUI_NBISOSDLG_H
#include <qdialog.h>
class QPushButton;
//=================================================================================
-// class : GEOMBase_NbIsosDlg
+// class : GEOMToolsGUI_NbIsosDlg
// purpose :
//=================================================================================
-class GEOMBase_NbIsosDlg : public QDialog
+class GEOMToolsGUI_NbIsosDlg : public QDialog
{
Q_OBJECT
public:
- GEOMBase_NbIsosDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
- ~GEOMBase_NbIsosDlg();
+ GEOMToolsGUI_NbIsosDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ ~GEOMToolsGUI_NbIsosDlg();
QPushButton* buttonOk;
QPushButton* buttonCancel;
};
-#endif // GEOMETRYGUI_NBISOSDLG_H
+#endif // GEOMTOOLSGUI_NBISOSDLG_H
//
//
//
-// File : GEOMBase_TransparencyDlg.cxx
+// File : GEOMToolsGUI_TransparencyDlg.cxx
// Author : Lucien PIGNOLONI
// Module : GEOM
#include "VTKViewer_RenderWindowInteractor.h"
//=================================================================================
-// class : GEOMBase_TransparencyDlg()
+// class : GEOMToolsGUI_TransparencyDlg()
// purpose : Constructs a GEOMBase_SUBSHAPE which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
//
// : WARNING : this dialog is modal !
//
//=================================================================================
-GEOMBase_TransparencyDlg::GEOMBase_TransparencyDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic, bool modal, WFlags fl)
+GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic, bool modal, WFlags fl)
:QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
if(!name)
- setName("GEOMBase_TransparencyDlg");
+ setName("GEOMToolsGUI_TransparencyDlg");
resize(152, 107);
setCaption(tr("GEOM_TRANSPARENCY_TITLE"));
setSizeGripEnabled(TRUE);
- GEOMBase_TransparencyDlgLayout = new QGridLayout(this);
- GEOMBase_TransparencyDlgLayout->setSpacing(6);
- GEOMBase_TransparencyDlgLayout->setMargin(11);
+ GEOMToolsGUI_TransparencyDlgLayout = new QGridLayout(this);
+ GEOMToolsGUI_TransparencyDlgLayout->setSpacing(6);
+ GEOMToolsGUI_TransparencyDlgLayout->setMargin(11);
/*************************************************************************/
QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
GroupC1Layout->addMultiCellWidget( Slider1, 1, 1, 0, 2 );
/*************************************************************************/
- GEOMBase_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
- GEOMBase_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
+ GEOMToolsGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
+ GEOMToolsGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
/* Initialisations */
this->myGeomGUI = GEOMContext::GetGeomGUI();
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(ValueHasChanged(int)));
/* Move widget on the botton right corner of main widget */
- int x, y ;
- myGeomBase->DefineDlgPosition(this, x, y);
- this->move(x, y) ;
+// int x, y ;
+// myGeomBase->DefineDlgPosition(this, x, y);
+// this->move(x, y) ;
this->show() ; /* Displays this Dialog */
}
//=================================================================================
-// function : ~GEOMBase_TransparencyDlg()
+// function : ~GEOMToolsGUI_TransparencyDlg()
// purpose :
//=================================================================================
-GEOMBase_TransparencyDlg::~GEOMBase_TransparencyDlg()
+GEOMToolsGUI_TransparencyDlg::~GEOMToolsGUI_TransparencyDlg()
{
// no need to delete child widgets, Qt does it all for us
}
// function : ClickOnOk()
// purpose :
//=======================================================================
-void GEOMBase_TransparencyDlg::ClickOnOk()
+void GEOMToolsGUI_TransparencyDlg::ClickOnOk()
{
accept();
return;
// function : ClickOnClose()
// purpose :
//=======================================================================
-void GEOMBase_TransparencyDlg::ClickOnClose()
+void GEOMToolsGUI_TransparencyDlg::ClickOnClose()
{
accept();
return;
// purpose : Called when value of slider change
// : or the first time as initilisation
//=================================================================================
-void GEOMBase_TransparencyDlg::ValueHasChanged(int newValue)
+void GEOMToolsGUI_TransparencyDlg::ValueHasChanged(int newValue)
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
// VTK
//
//
//
-// File : GEOMBase_TransparencyDlg.h
+// File : GEOMToolsGUI_TransparencyDlg.h
// Author : Lucien PIGNOLONI
// Module : GEOM
// $Header$
//=================================================================================
-// class : GEOMBase_TransparencyDlg
+// class : GEOMToolsGUI_TransparencyDlg
// purpose :
// : WARNING : that is a MODAL dialog.
//=================================================================================
-class GEOMBase_TransparencyDlg : public QDialog
+class GEOMToolsGUI_TransparencyDlg : public QDialog
{
Q_OBJECT
public:
- GEOMBase_TransparencyDlg( QWidget* parent = 0,
+ GEOMToolsGUI_TransparencyDlg( QWidget* parent = 0,
const char* name = 0,
SALOME_Selection* Sel = 0,
const Handle(AIS_InteractiveContext)& ic = 0,
bool modal = TRUE,
WFlags fl = 0 );
- ~GEOMBase_TransparencyDlg();
+ ~GEOMToolsGUI_TransparencyDlg();
private :
void ValueHasChanged( int newValue ) ;
protected:
- QGridLayout* GEOMBase_TransparencyDlgLayout;
+ QGridLayout* GEOMToolsGUI_TransparencyDlgLayout;
QHBoxLayout* Layout1;
QHBoxLayout* Layout2;
};
--- /dev/null
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python\r
+#\r
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
+# \r
+# This library is free software; you can redistribute it and/or \r
+# modify it under the terms of the GNU Lesser General Public \r
+# License as published by the Free Software Foundation; either \r
+# version 2.1 of the License. \r
+# \r
+# This library is distributed in the hope that it will be useful, \r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of \r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
+# Lesser General Public License for more details. \r
+# \r
+# You should have received a copy of the GNU Lesser General Public \r
+# License along with this library; if not, write to the Free Software \r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
+# \r
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
+#\r
+#\r
+#\r
+# File : GEOM_Sketcher.py\r
+# Author : Damien COQUERET, Open CASCADE\r
+# Module : GEOM\r
+# $Header$\r
+\r
+import geompy\r
+\r
+#SKETCHER INFOS\r
+#Init Sketcher\r
+#Create a string beginning by :"Sketcher:"\r
+#Each command must be separated by ":"\r
+#"F x y" : Create first point at X & Y\r
+\r
+#To Make Segment\r
+#"R angle" : Set the direction by angle\r
+#"D dx dy" : Set the direction by DX & DY\r
+\r
+#"TT x y" : Create by point at X & Y\r
+#"T dx dy" : Create by point with DX & DY\r
+#"L length" : Create by direction & Length\r
+#"IX x" : Create by direction & Intersect. X\r
+#"IY y" : Create by direction & Intersect. Y\r
+\r
+#To Make Arc\r
+#"C radius length" : Create by direction, radius and length(in degree)\r
+\r
+#To finish\r
+#"WW" : Close Wire\r
+\r
+#Create Sketcher\r
+Cmd = "Sketch:F 0 0:TT 0 100:C 100 180:WW"\r
+Sketcher = geompy.MakeSketcher(Cmd) #(string)->GEOM_Shape_ptr\r
+\r
+#Add In Study\r
+id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")\r
GEOM_Partition2.py \
GEOM_Partition3.py \
GEOM_Partition4.py \
- GEOM_Partition5.py
+ GEOM_Partition5.py \
+ GEOM_Sketcher.py
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
anObj._set_Name(ior)
return anObj
+def MakeEllipse(p1,d1,radiusMaj,radiusMin):
+ anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin)
+ ior = orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize)
ior = orb.object_to_string(anObj)
anObj._set_Name(ior)
return anObj
+def MakeSketcher(Cmd):
+ anObj = geom.MakeSketcher(Cmd)
+ ior = orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
# -----------------------------------------------------------------------------
# Create Geometry 3D
# -----------------------------------------------------------------------------
anObj._set_Name(ior)
return anObj
+def MakeFaces(ListShape,WantPlanarFace):
+ anObj = geom.MakeFaces(ListShape,WantPlanarFace)
+ ior = orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
def MakeCompound(ListShape):
anObj = geom.MakeCompound(ListShape)
ior = orb.object_to_string(anObj)
return anObj
def SuppressFaces(aShape,ListOfId):
- anObj = geom.SuppressFaces(aShape,ListOfId)
- ior = orb.object_to_string(anObj)
- anObj._set_Name(ior)
- return anObj
+ ListObj = geom.SuppressFaces(aShape,ListOfId)
+ for anObj in ListObj :
+ ior = orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return ListObj
def SuppressHole(aShape,ListOfFace,ListOfWire,ListOfEndFace):
anObj = geom.SuppressHole(aShape,ListOfFace,ListOfWire,ListOfEndFace)
anObj._set_Name(ior)
return anObj
+def MakeEllipse(p1,d1,radiusMaj,radiusMin):
+ anObj = geom.MakeEllipse(p1,d1,radiusMaj, radiusMin)
+ ior = salome.orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
def MakePlane(p1,d1,trimsize):
anObj = geom.MakePlane(p1,d1,trimsize)
ior = salome.orb.object_to_string(anObj)
anObj._set_Name(ior)
return anObj
+def MakeSketcher(Cmd):
+ anObj = geom.MakeSketcher(Cmd)
+ ior = salome.orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return anObj
+
# -----------------------------------------------------------------------------
# Create Geometry 3D
# -----------------------------------------------------------------------------
return anObj
def SuppressFaces(aShape,ListOfId):
- anObj = geom.SuppressFaces(aShape,ListOfId)
- ior = salome.orb.object_to_string(anObj)
- anObj._set_Name(ior)
- return anObj
+ ListObj = geom.SuppressFaces(aShape,ListOfId)
+ for anObj in ListObj :
+ ior = salome.orb.object_to_string(anObj)
+ anObj._set_Name(ior)
+ return ListObj
def SuppressHole(aShape,ListOfFace,ListOfWire,ListOfEndFace):
anObj = geom.SuppressHole(aShape,ListOfFace,ListOfWire,ListOfEndFace)
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_FillingDlg.h"
+#include "QAD_WaitCursor.h"
#include "QAD_Config.h"
#include <GeomFill_SectionGenerator.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_FillingDlg()
//=================================================================================
void GenerationGUI_FillingDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
return;
if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) {
- myEditCurrentArgument->setText(aString);
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
+ // mySectionShape should be a compound of edges
+ for ( TopoDS_Iterator it( mySectionShape ); it.More(); it.Next() )
+ if ( it.Value().ShapeType() != TopAbs_EDGE )
+ return;
+ myEditCurrentArgument->setText(aString);
myOkSectionShape = true;
}
//=================================================================================
void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
{
+ QAD_WaitCursor wc;
+
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE)
return;
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+ if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ;
i++ ;
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PipeDlg.h"
#include <TopoDS_Edge.hxx>
#include <BRepAlgoAPI.hxx>
#endif
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PipeDlg()
// purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the
}
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
myOkShape2 = false;
- if(S.ShapeType() != TopAbs_COMPSOLID && S.ShapeType() != TopAbs_COMPOUND && S.ShapeType() != TopAbs_SOLID && S.ShapeType() != TopAbs_SHAPE && S.ShapeType() != TopAbs_VERTEX) {
+ if(S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) {
myGeomShape2 = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PrismDlg.h"
#include <BRepPrimAPI_MakePrism.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PrismDlg()
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
//=================================================================================
void GenerationGUI_PrismDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_RevolDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include "QAD_Config.h"
+#include <TopExp_Explorer.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_RevolDlg()
//=================================================================================
void GenerationGUI_RevolDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
return;
}
+//=======================================================================
+//function : isAcceptableBase
+//purpose : return true if theBase can be used as algo argument
+//=======================================================================
+
+static bool isAcceptableBase(const TopoDS_Shape& theBase)
+{
+ switch ( theBase.ShapeType() ) {
+ case TopAbs_VERTEX:
+ case TopAbs_EDGE:
+ case TopAbs_WIRE:
+ case TopAbs_FACE:
+ case TopAbs_SHELL:
+ return true;
+ case TopAbs_SOLID:
+ case TopAbs_COMPSOLID:
+ return false;
+ case TopAbs_COMPOUND: {
+ TopExp_Explorer exp( theBase, TopAbs_SOLID);
+ return !exp.More();
+ }
+ default:
+ return false;
+ }
+ return false;
+}
//=================================================================================
// function : SelectionIntoArgument()
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- TopAbs_ShapeEnum aType = S.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType != TopAbs_COMPOUND)
+ if( !isAcceptableBase( S ))
return;
myEditCurrentArgument->setText(aString);
myOkBase = true;
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
- TopAbs_ShapeEnum aType = myBase.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType !=TopAbs_COMPOUND)
+ if (!isAcceptableBase( myBase ))
return;
try {
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_BndBoxDlg.h"
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBndLib.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_BndBoxDlg()
// purpose : Constructs a MeasureGUI_BndBoxDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CenterMassDlg.h"
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CenterMassDlg()
// purpose : Constructs a MeasureGUI_CenterMassDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CheckShapeDlg.h"
#include <BRepCheck_Analyzer.hxx>
#include <qtextedit.h>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CheckShapeDlg()
// purpose : Constructs a MeasureGUI_CheckShapeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_DistanceDlg.h"
#include "QAD_RightFrame.h"
#include <gce_MakePln.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_DistanceDlg()
// purpose : Constructs a MeasureGUI_DistanceDlg which is a child of 'parent', with the
gp_Pln gp_P = gce_MP.Value();
Handle(Geom_Plane) P = new Geom_Plane(gp_P);
- Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(strdup(S)));
+ char* aCopyS = CORBA::string_dup(S);
+ Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(aCopyS));
+ delete(aCopyS);
GroupC1->LineEdit3->setText(S);
// Author : Lucien PIGNOLONI
// Module : GEOM
-using namespace std;
#include "MeasureGUI_InertiaDlg.h"
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_InertiaDlg()
// purpose : Constructs a MeasureGUI_InertiaDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_MaxToleranceDlg.h"
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_MaxToleranceDlg()
// purpose : Constructs a MeasureGUI_MaxToleranceDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_PropertiesDlg.h"
#include <TopExp_Explorer.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_PropertiesDlg()
// purpose : Constructs a MeasureGUI_PropertiesDlg which is a child of 'parent', with the
#include <qlayout.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
+#include <qpushbutton.h>
class MeasureGUI_Skeleton : public MeasureGUI_Skeleton_QTD
{
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_WhatisDlg.h"
#include <TopTools_MapOfShape.hxx>
#include <qtextedit.h>
+#include <BRep_Tool.hxx>
+
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
return;
TCollection_AsciiString Astr;
- Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n";
+ if ( S.ShapeType() == TopAbs_EDGE ) {
+ if( BRep_Tool::Degenerated(TopoDS::Edge(S)) ) {
+ Astr = Astr + " " + CORBA::string_dup(SelectedName.latin1()) + " is a degenerated edge \n";
+ }
+ }
+
+ Astr = Astr + " Number of shapes in " + CORBA::string_dup(SelectedName.latin1()) + " : \n";
+
try {
int iType, nbTypes [TopAbs_SHAPE];
for(iType = 0; iType < TopAbs_SHAPE; ++iType)
#endif
#ifndef _Prs3d_Presentation_HeaderFile
#include <Prs3d_Presentation.hxx>
-#endif
\ No newline at end of file
+#endif
//=================================================================================
void OperationGUI_ArchimedeDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkIO)
myOperationGUI->Archimede(myIO, myWeight, myWaterDensity, myMeshingDeflection);
#include "OperationGUI_ChamferDlg.h"
#include "DisplayGUI.h"
+#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepTools.hxx>
#include <TopExp.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+
//=================================================================================
// class : OperationGUI_ChamferDlg()
// purpose : Constructs a OperationGUI_ChamferDlg which is a child of 'parent', with the
Group1->TextLabel3->setText(tr("GEOM_D2"));
Group1->PushButton1->setPixmap(image3);
- Group2 = new DlgRef_1Sel2Spin(this, "Group2");
- Group2->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
- Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
- Group2->TextLabel2->setText(tr("GEOM_D1"));
- Group2->TextLabel3->setText(tr("GEOM_D2"));
- Group2->PushButton1->setPixmap(image3);
-
- Group3 = new DlgRef_1Sel2Spin(this, "Group3");
- Group3->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
- Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
- Group3->TextLabel2->setText(tr("GEOM_D1"));
- Group3->TextLabel3->setText(tr("GEOM_D2"));
- Group3->PushButton1->setPixmap(image3);
-
Layout1->addWidget(Group1, 1, 0);
- Layout1->addWidget(Group2, 1, 0);
- Layout1->addWidget(Group3, 1, 0);
/***************************************************************/
/* Initialisations */
double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
Group1->SpinBox_DX->SetValue(myD1);
- Group2->SpinBox_DX->SetValue(myD1);
- Group3->SpinBox_DX->SetValue(myD1);
Group1->SpinBox_DY->SetValue(myD2);
- Group2->SpinBox_DY->SetValue(myD2);
- Group3->SpinBox_DY->SetValue(myD2);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DY, SLOT(SetStep(double)));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
- Group2->hide();
- Group3->hide();
Group1->show();
this->show();
myUseLocalContext = false;
}
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
+ myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC
+ RadioButton1->setChecked(TRUE);
+ }
+
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ Group1->LineEdit1->setText("");
+ Group1->SpinBox_DX->SetValue(myD1);
+ Group1->SpinBox_DY->SetValue(myD2);
switch (constructorId)
{
case 0: /* Chamfer All */
{
- Group2->hide();
- Group3->hide();
- resize(0, 0);
- Group1->show();
-
- myEditCurrentArgument = Group1->LineEdit1;
- Group1->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL"));
myShapeType = -1;
-
- Group1->SpinBox_DX->SetValue(myD1);
- Group1->SpinBox_DY->SetValue(myD2);
break;
}
case 1: /* Chamfer edges */
{
- Group1->hide();
- Group3->hide();
- resize(0, 0);
- Group2->show();
-
- myEditCurrentArgument = Group2->LineEdit1;
- Group2->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
myShapeType = 6;
-
- Group2->SpinBox_DX->SetValue(myD1);
- Group2->SpinBox_DY->SetValue(myD2);
break;
}
case 2: /* Chamfer Faces */
{
- Group1->hide();
- Group2->hide();
- resize(0, 0);
- Group3->show();
-
- myEditCurrentArgument = Group3->LineEdit1;
- Group3->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
myShapeType = 4;
-
- Group3->SpinBox_DX->SetValue(myD1);
- Group3->SpinBox_DY->SetValue(myD2);
break;
}
}
//=================================================================================
void OperationGUI_ChamferDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
}
}
}
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void OperationGUI_ChamferDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == Group1->LineEdit1)
- myEditCurrentArgument = Group1->LineEdit1;
- else if (send == Group2->LineEdit1)
- myEditCurrentArgument = Group2->LineEdit1;
- else if (send == Group3->LineEdit1)
- myEditCurrentArgument = Group3->LineEdit1;
- else
- return;
-
- GEOMBase_Skeleton::LineEditReturnPressed();
- return;
-}
-
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
{
QPushButton* send = (QPushButton*)sender();
- if(send == Group1->PushButton1) {
+ if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus();
- myEditCurrentArgument = Group1->LineEdit1;
- }
- else if(send == Group2->PushButton1) {
- Group2->LineEdit1->setFocus();
- myEditCurrentArgument = Group2->LineEdit1;
- }
- else if(send == Group3->PushButton1) {
- Group3->LineEdit1->setFocus();
- myEditCurrentArgument = Group3->LineEdit1;
- }
+
this->SelectionIntoArgument();
return;
}
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue )
+void OperationGUI_ChamferDlg::ValueChangedInSpinBox(double newValue)
{
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
QObject* send = (QObject*)sender();
- if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
+ if(send == Group1->SpinBox_DX) /* D1 */
myD1 = newValue;
- if(myConstructorId == 0)
- this->MakePreview();
- return ;
- }
- else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
+ else if(send == Group1->SpinBox_DY) /* D2 */
myD2 = newValue;
- if(myConstructorId == 0)
- this->MakePreview();
- return;
- }
+
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
+ this->MakePreview();
+
return;
}
void OperationGUI_ChamferDlg::MakePreview()
{
QApplication::setOverrideCursor(Qt::waitCursor);
-
- if(!myOkShape) {
- QApplication::restoreOverrideCursor();
- return;
- }
-
- GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
- ListOfID->length(0);
-
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
- if(theObj->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
- QApplication::restoreOverrideCursor();
- return;
- }
+ TopoDS_Shape tds;
try {
- if(myD1 <= Precision::Confusion() || myD2 <= Precision::Confusion()) {
- QApplication::restoreOverrideCursor();
- return;
- }
+ BRepFilletAPI_MakeChamfer MC(myShape);
+ switch(myConstructorId)
+ {
+ case 0: /* Chamfer All */
+ {
+ TopTools_IndexedDataMapOfShapeListOfShape M;
+ TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, M);
+ for(int i = 1; i <= M.Extent(); i++) {
+ TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
+ TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());
+ if(!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
+ MC.Add(myD1, myD2, E, F);
+ }
+ tds = MC.Shape();
+ break;
+ }
+ // case 1: /* Chamfer edges */
+ // case 2: /* Chamfer Faces */
+ }
- GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
- GEOM::GEOM_Shape_var result = myGeom->MakeChamfer(aShape, myD1, myD2, myShapeType, ListOfID);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- QApplication::restoreOverrideCursor();
- return;
+ if(!tds.IsNull()) {
+ mySimulationTopoDs = tds;
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
-
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
-
- mySimulationTopoDs = S;
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
catch(Standard_Failure) {
- MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor();
- return;
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+ Group1->SpinBox_DX->SetValue(5.0);
+ Group1->SpinBox_DY->SetValue(5.0);
}
+
QApplication::restoreOverrideCursor();
return;
-
}
double myD2;
DlgRef_1Sel2Spin* Group1;
- DlgRef_1Sel2Spin* Group2;
- DlgRef_1Sel2Spin* Group3;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
#include "OperationGUI_FilletDlg.h"
#include "DisplayGUI.h"
+#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
#include <AIS_InteractiveContext.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+
//=================================================================================
// class : OperationGUI_FilletDlg()
// purpose : Constructs a OperationGUI_FilletDlg which is a child of 'parent', with the
Group1->TextLabel2->setText(tr("GEOM_RADIUS"));
Group1->PushButton1->setPixmap(image3);
- Group2 = new DlgRef_1Sel1Spin(this, "Group2");
- Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
- Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
- Group2->TextLabel2->setText(tr("GEOM_RADIUS"));
- Group2->PushButton1->setPixmap(image3);
-
- Group3 = new DlgRef_1Sel1Spin(this, "Group3");
- Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
- Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
- Group3->TextLabel2->setText(tr("GEOM_RADIUS"));
- Group3->PushButton1->setPixmap(image3);
-
Layout1->addWidget(Group1, 1, 0);
- Layout1->addWidget(Group2, 1, 0);
- Layout1->addWidget(Group3, 1, 0);
/***************************************************************/
/* Initialisations */
double SpecificStep = 10.0;
/* min, max, step and decimals for spin boxes */
Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
- Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-
Group1->SpinBox_DX->SetValue(myRadius);
- Group2->SpinBox_DX->SetValue(myRadius);
- Group3->SpinBox_DX->SetValue(myRadius);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
- connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* displays Dialog */
- Group2->hide();
- Group3->hide();
Group1->show();
this->show();
myUseLocalContext = false;
}
+ if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
+ myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC
+ RadioButton1->setChecked(TRUE);
+ }
+
connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ Group1->LineEdit1->setText("");
+ Group1->SpinBox_DX->SetValue(myRadius);
switch (constructorId)
{
case 0: /* Fillet All */
{
- Group2->hide();
- Group3->hide();
- resize(0, 0);
- Group1->show();
-
- myEditCurrentArgument = Group1->LineEdit1;
- Group1->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
myShapeType = -1;
-
- Group1->SpinBox_DX->SetValue(myRadius);
break;
}
case 1: /* Fillet edges */
{
- Group1->hide();
- Group3->hide();
- resize(0, 0);
- Group2->show();
-
- myEditCurrentArgument = Group2->LineEdit1;
- Group2->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
myShapeType = 6;
-
- Group2->SpinBox_DX->SetValue(myRadius);
break;
}
case 2: /* Fillet Faces */
{
- Group1->hide();
- Group2->hide();
- resize(0, 0);
- Group3->show();
-
- myEditCurrentArgument = Group3->LineEdit1;
- Group3->LineEdit1->setText("");
+ Group1->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
myShapeType = 4;
-
- Group3->SpinBox_DX->SetValue(myRadius);
break;
}
}
//=================================================================================
void OperationGUI_FilletDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QApplication::setOverrideCursor(Qt::waitCursor);
QAD_Application::getDesktop()->putInfo(tr(""));
myGeomBase->EraseSimulationShape();
}
}
}
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
}
else
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void OperationGUI_FilletDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == Group1->LineEdit1)
- myEditCurrentArgument = Group1->LineEdit1;
- else if (send == Group2->LineEdit1)
- myEditCurrentArgument = Group2->LineEdit1;
- else if (send == Group3->LineEdit1)
- myEditCurrentArgument = Group3->LineEdit1;
- else
- return;
-
- GEOMBase_Skeleton::LineEditReturnPressed();
- return;
-}
-
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
{
QPushButton* send = (QPushButton*)sender();
- if(send == Group1->PushButton1) {
+ if(send == Group1->PushButton1)
Group1->LineEdit1->setFocus();
- myEditCurrentArgument = Group1->LineEdit1;
- }
- else if(send == Group2->PushButton1) {
- Group2->LineEdit1->setFocus();
- myEditCurrentArgument = Group2->LineEdit1;
- }
- else if(send == Group3->PushButton1) {
- Group3->LineEdit1->setFocus();
- myEditCurrentArgument = Group3->LineEdit1;
- }
+
this->SelectionIntoArgument();
return;
}
myRadius = newValue;
- if(myConstructorId == 0)
+ if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
this->MakePreview();
return;
}
void OperationGUI_FilletDlg::MakePreview()
{
QApplication::setOverrideCursor(Qt::waitCursor);
+ TopoDS_Shape tds;
- if(!myOkShape) {
- QApplication::restoreOverrideCursor();
- return;
- }
-
- GEOM::GEOM_Shape::ListOfSubShapeID_var ListOfID = new GEOM::GEOM_Shape::ListOfSubShapeID;
- ListOfID->length(0);
-
- SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
- SALOMEDS::SObject_var theObj = aStudy->FindObjectIOR(myShapeIOR);
- if(theObj->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
- QApplication::restoreOverrideCursor();
- return;
- }
-
try {
- if(myRadius <= Precision::Confusion()) {
- QApplication::restoreOverrideCursor();
- return;
- }
+ BRepFilletAPI_MakeFillet fill(myShape);
+ switch(myConstructorId)
+ {
+ case 0: /* Fillet All */
+ {
+ TopExp_Explorer Exp(myShape, TopAbs_EDGE);
+ for(Exp; Exp.More(); Exp.Next()) {
+ TopoDS_Edge E = TopoDS::Edge(Exp.Current());
+ fill.Add(E);
+ }
+
+ for(int i = 1; i <= fill.NbContours(); i++) {
+ try {
+ fill.SetRadius(myRadius,i,i);
+ }
+ catch(Standard_Failure) {
+ QApplication::restoreOverrideCursor();
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+ Group1->SpinBox_DX->SetValue(5.0);
+ QApplication::restoreOverrideCursor();
+ return;
+ }
+ }
+ tds = fill.Shape();
+ break;
+ }
+ // case 1: /* Fillet edges */
+ // case 2: /* Fillet Faces */
+ }
- GEOM::GEOM_Shape_var aShape = myGeom->GetIORFromString(myShapeIOR);
- GEOM::GEOM_Shape_var result = myGeom->MakeFillet(aShape, myRadius, myShapeType, ListOfID);
- if(result->_is_nil()) {
- QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
- QApplication::restoreOverrideCursor();
- return;
+ if(!tds.IsNull()) {
+ mySimulationTopoDs = tds;
+ myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
}
- TopoDS_Shape S = myGeomGUI->GetShapeReader().GetShape(myGeom, result);
-
- mySimulationTopoDs = S;
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
- }
+ }
catch(Standard_Failure) {
- MESSAGE("Exception catched in MakePreview");
QApplication::restoreOverrideCursor();
- return;
+ QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ myGeomBase->EraseSimulationShape();
+ mySimulationTopoDs.Nullify();
+ Group1->SpinBox_DX->SetValue(5.0);
}
+
QApplication::restoreOverrideCursor();
return;
}
double myRadius;
DlgRef_1Sel1Spin* Group1;
- DlgRef_1Sel1Spin* Group2;
- DlgRef_1Sel1Spin* Group3;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ActivateThisDialog();
void DeactivateActiveDialog();
- void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ValueChangedInSpinBox(double newValue);
GroupPoints = new DlgRef_4Sel1List_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
+ GroupPoints->GroupBox2->setTitle(tr("SUPPRESS_RESULT"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupPoints->TextLabel3->setText(tr("GEOM_RECONSTRUCTION_LIMIT"));
const double Radius1, const double Radius2, const double aHeight)
{
try {
- if((Radius1 <= Precision::Confusion() && Radius2 <= Precision::Confusion()) || aHeight <= Precision::Confusion())
+ double myRadius2 = Radius2;
+ if(myRadius2 < Precision::Confusion())
+ myRadius2 = Precision::Confusion();
+ if(Radius1 <= Precision::Confusion() || aHeight <= Precision::Confusion())
return;
GEOM::PointStruct pstruct = myGeom->MakePointStruct(BasePoint.X(), BasePoint.Y(), BasePoint.Z());
GEOM::PointStruct d = myGeom->MakePointStruct(aDir.X(), aDir.Y(), aDir.Z());
GEOM::DirStruct dstruct = myGeom->MakeDirection(d);
- GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, Radius2, aHeight);
+ GEOM::GEOM_Shape_var result = myGeom->MakeCone(pstruct, dstruct, Radius1, myRadius2, aHeight);
if(result->_is_nil()) {
QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
return;
//=================================================================================
void PrimitiveGUI_BoxDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_ConeDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_ConeDlg()
// purpose : Constructs a PrimitiveGUI_ConeDlg which is a child of 'parent', with the
step = St.toDouble();
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3);
GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3);
GroupPoints->SpinBox_DX->SetValue(myRadius1);
//=================================================================================
void PrimitiveGUI_ConeDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_CylinderDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_CylinderDlg()
// purpose : Constructs a PrimitiveGUI_CylinderDlg which is a child of 'parent', with the
//=================================================================================
void PrimitiveGUI_CylinderDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_TorusDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
myRadius1 = 300.0;
myRadius2 = 100.0;
- myOkRadius1 = myOkRadius2 = true;
myOkPoint1 = myOkDir = false;
myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
mySelection->ClearFilters();
myGeomBase->EraseSimulationShape();
disconnect(mySelection, 0, this, 0);
- myOkRadius1 = myOkRadius2 = true;
myRadius1 = 300.0;
myRadius2 = 100.0;
//=================================================================================
void PrimitiveGUI_TorusDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
- if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 )
+ if(myOkPoint1 && myOkDir)
myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2);
return ;
}
myOkDir = true;
}
- if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
+ if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay();
return;
}
QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) {
- myRadius1 = newValue;
- myOkRadius1 = true;
+ if(newValue > myRadius2)
+ myRadius1 = newValue;
+ else {
+ GroupPoints->SpinBox_DX->SetValue(myRadius1);
+ GroupDimensions->SpinBox_DX->SetValue(myRadius1);
+ }
}
else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) {
- myRadius2 = newValue;
- myOkRadius2 = true;
+ if(newValue < myRadius1)
+ myRadius2 = newValue;
+ else {
+ GroupPoints->SpinBox_DY->SetValue(myRadius2);
+ GroupDimensions->SpinBox_DY->SetValue(myRadius2);
+ }
}
- if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
+ if(myOkPoint1 && myOkDir)
MakeTorusSimulationAndDisplay();
return;
}
Standard_Real myRadius1;
Standard_Real myRadius2;
- bool myOkRadius1;
- bool myOkRadius2;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions;
// Module : GEOM
// $Header:
-using namespace std;
#include "RepairGUI.h"
#include "QAD_RightFrame.h"
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
#include "RepairGUI_SuppressHoleDlg.h" // Method SUPPRESS HOLE
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : RepairGUI()
// purpose : Constructor
Standard_CString Type;
if(myGeomBase->GetShapeTypeString(S, Type)) {
aShellOrFace->NameType(Type);
- sprintf (nameG, "%s_%d", Type, myGeomGUI->GetNbGeom()++);
+ sprintf (nameG, "%s_%d", Type, myGeomGUI->myNbGeom++);
}
else {
aShellOrFace->NameType(tr("GEOM_SHAPE"));
- sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->GetNbGeom()++);
+ sprintf (nameG, "%s_%d", tr("GEOM_SHAPE").latin1(), myGeomGUI->myNbGeom++);
}
/* Display with name */
// Module : GEOM
// $Header$
-using namespace std;
#include "RepairGUI_OrientationDlg.h"
#include <Precision.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopExp_Explorer.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : RepairGUI_OrientationDlg()
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
//=================================================================================
void RepairGUI_OrientationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
//=================================================================================
void RepairGUI_SewingDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if(myOkListShapes)
myRepairGUI->MakeSewingAndDisplay(myListShapes, myPrecision);
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Sketcher.cxx
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-using namespace std;
-#include "GEOM_Sketcher.h"
-#include "utilities.h"
-
-#include <qstring.h>
-
-#include <Geom_Axis1Placement.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_CartesianPoint.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepBuilderAPI_MakeEdge2d.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <gp_Lin2d.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Lin.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Circ2d.hxx>
-#include <gp_Vec2d.hxx>
-#include <IntAna_IntConicQuad.hxx>
-#include <BRepLib.hxx>
-#include <TopExp.hxx>
-#include <ProjLib.hxx>
-#include <Precision.hxx>
-#include <ElSLib.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <GccAna_Pnt2dBisec.hxx>
-#include <GeomAPI.hxx>
-#include <Geom2dAPI_ProjectPointOnCurve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-#include <Geom2d_Circle.hxx>
-#include <gce_MakeCirc2d.hxx>
-#include <GccAna_Circ2d2TanRad.hxx>
-#include <GccAna_Circ2d2TanOn.hxx>
-#include <GccEnt.hxx>
-#include <GccEnt_QualifiedLin.hxx>
-#include <GccEnt_QualifiedCirc.hxx>
-#include <GccAna_Lin2dTanPer.hxx>
-#include <GccAna_Lin2dTanObl.hxx>
-#include <gce_MakeLin2d.hxx>
-#include <GCE2d_MakeArcOfCircle.hxx>
-#include <Precision.hxx>
-#include <ElCLib.hxx>
-#include <AIS_Point.hxx>
-#include <TColgp_HArray1OfPnt2d.hxx>
-#include <Geom2dAPI_Interpolate.hxx>
-#include <TColgp_Array1OfVec2d.hxx>
-#include <TColStd_HArray1OfBoolean.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <DsgPrs_ArrowSide.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
-
-#include <AIS_Drawer.hxx>
-#include <Prs3d_TextAspect.hxx>
-#include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_NameOfFont.hxx>
-
-#include <TopoDS_Wire.hxx>
-
-/*!
- \class GEOM_Sketcher GEOM_Sketcher.h
- \brief ...
-*/
-
-Standard_Real resol = 1.0;
-
-/*!
- Constructor.
-*/
-Sketch::Sketch()
-{
-
-}
-
-/*!
- Destructor.
-*/
-Sketch::~Sketch()
-{
-
-}
-
-
-/*!
- Constructor.
-
- \param V3d_Viewer
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer) :
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(Quantity_Color(Quantity_NOC_YELLOW)),
-myCurrentColor(Quantity_Color(Quantity_NOC_GREEN)),
-myWireColor(Quantity_Color(Quantity_NOC_RED))
-{
- Init();
-}
-
-/*!
- Constructor.
-
- \param V3d_Viewer
- \param Quantity_Color
- \param Quantity_Color
- \param Quantity_Color
-*/
-Sketch::Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor):
-myInteractiveContext(new AIS_InteractiveContext(aViewer)),
-myAxisColor(anAxisColor),
-myCurrentColor(aCurrentColor),
-myWireColor(aWireColor)
-{
- Init();
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param Xp
- \param Yp
- \param V3d_View
-*/
-void Sketch::MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView )
-{
- /* 3d coordinates of the picked point */
- Standard_Real Xv,Yv,Zv;
- aView->Convert(Xp,Yp,Xv,Yv,Zv);
- /* computation of real 2d coordinates in plane of sketch */
- Standard_Real Vx,Vy,Vz;
- aView->Proj(Vx,Vy,Vz);
- gp_Dir D(Vx,Vy,Vz);
- gp_Pnt P(Xv,Yv,Zv);
- gp_Lin L(P,D);
- Standard_Real X,Y;
- gp_Pnt Sol;
- IntAna_IntConicQuad Int(L,myPlane->Pln(),Precision::Angular());
- if (Int.IsDone()) {
- if (!Int.IsParallel()) {
- if (Int.NbPoints() > 0 ) {
- Sol = Int.Point(1);
- ElSLib::Parameters(myPlane->Pln(),Sol,X,Y);
- }
- }
- }
- MakeCurrentEdge(X,Y);
-}
-
-/*!
- Build the current edge in a graphic mode.
- The first signature with view coordinates is used to connect to the move event from the user interface.
- The second signature is used when the current point is known by 2d real coordinates.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentEdge(const Standard_Real X, const Standard_Real Y)
-{
- /* Create the current edge depending on the active mode */
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- myCurrentEdge = BRepBuilderAPI_MakeVertex(ElCLib::To3d(myPlane->Pln().Position().Ax2(),gp_Pnt2d(X,Y)));
- break;
- case SEGMENT:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD:
- MakeCurrentSegment(X,Y);
- break;
- case ARC_CHORD_END:
- MakeCurrentArc(X,Y);
- break;
- }
- DisplayCurrentEdge();
-}
-
-/*!
- Build the current edge in a graphic mode.
- Function to connect to the input event from the user interface.
-*/
-void Sketch::ValidateEdge()
-{
- gp_Pnt pt;
- gp_Pnt2d pt2d;
- switch (myCurrentStatus) {
- case BEGIN_SKETCH:
- {
- myFirstPointSketch = TopoDS::Vertex(myCurrentEdge);
- myPresentableWire = new AIS_Shape(myFirstPointSketch);
- myPresentableWire->SetColor(myWireColor.Name());
- myInteractiveContext->Display(myPresentableWire);
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myCurrentStatus = SEGMENT;
- break;
- }
- case SEGMENT:
- {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,myLengthDimension->Value());
- if (myTransitionStatus == ANGLE ||
- myTransitionStatus == LENGTH_FIXED ||
- myTransitionStatus == X_FIXED ||
- myTransitionStatus == Y_FIXED)
- myTransitionStatus = NOCONSTRAINT;
- AddEdgeToWire();
- break;
- }
- case ARC_CHORD:
- {
- myInteractiveContext->CloseLocalContext();
- myInteractiveContext->OpenLocalContext();
- gp_Pnt2d p1 (myLastX,myLastY);
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myCurrentEdge)));
- gp_Pnt2d p2 = ProjLib::Project(myPlane->Pln(),pt);
- GccAna_Pnt2dBisec ComputeMediatrice(p1,p2);
- if (ComputeMediatrice.HasSolution()) {
- myMediatrice = new Geom2d_Line(ComputeMediatrice.ThisSolution());
- Handle(Geom_Curve) aMediatrice3d = GeomAPI::To3d(myMediatrice,myPlane->Pln());
- myPresentableMediatrice = new AIS_Axis(Handle(Geom_Line)::DownCast(aMediatrice3d));
- myInteractiveContext->Display(myPresentableMediatrice);
- }
- TopoDS_Edge e = BRepBuilderAPI_MakeEdge2d(gce_MakeCirc2d(gp_Pnt2d(0.,0),1.));
- BRepLib::BuildCurve3d(e);
- myLengthDimension->SetText(TCollection_ExtendedString());
- myInteractiveContext->Redisplay(myLengthDimension,Standard_False);
- if (myEdgesNumber == 0)
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- pt2d = ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
- myTransitionStatus = NOCONSTRAINT;
- myCurrentStatus = ARC_CHORD_END;
- break;
- }
- case ARC_CHORD_END:
- myCurrentStatus = ARC_CHORD;
- AddEdgeToWire();
- break;
- }
-}
-
-/*!
- Add edge to current wire on an edge validation .
-*/
-void Sketch::AddEdgeToWire()
-{
- myPreviousEdge = TopoDS::Edge(myCurrentEdge);
- BRepLib::BuildCurve3d(myPreviousEdge);
- myCurrentWire.Add(TopoDS::Edge(myPreviousEdge));
- myEdgesNumber++;
- myPresentableWire->Set( myCurrentWire.Wire() );
- myInteractiveContext->Redisplay(myPresentableWire);
- myConstructionMode.Append(myCurrentStatus);
- myConstraintMode.Append(myTransitionStatus);
- myInteractiveContext->CloseLocalContext();
- gp_Pnt pt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param aValue
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::SetDimension(Standard_Real& aValue)
-{
- fitInResol(aValue);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD){
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C =
- BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,first,last);
- myCurrentEdge =
- BRepBuilderAPI_MakeEdge2d(Handle(Geom2d_Line)::DownCast(C)->Lin2d(),0.,aValue);
- DisplayCurrentEdge();
- if (myTransitionStatus == NOCONSTRAINT) {
- mySegmentLength = aValue;
- myTransitionStatus = LENGTH_FIXED;
- }
- else
- ValidateEdge();
- return Standard_True;
- }
-
- else if( myCurrentStatus == ARC_CHORD_END){
- if (myTransitionStatus == TANGENT) return Standard_False;
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- GccAna_Circ2d2TanRad aSol(p, gp_Pnt2d(myLastX,myLastY),aValue,Precision::Confusion());
- Standard_Real dist = RealLast();
- if (aSol.NbSolutions() > 0) {
- gp_Circ2d CirSol;
- gp_Pnt2d pc = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopoDS::Vertex(myCenterCircle->Shape())));
- for (Standard_Integer i =1; i<= aSol.NbSolutions(); i++) {
- if (pc.Distance(aSol.ThisSolution(i).Location()) < dist)
- CirSol = aSol.ThisSolution(i);
- }
- if (myCurrentEdge.Orientation() == TopAbs_FORWARD)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- DisplayCurrentEdge();
- ValidateEdge();
- return Standard_True;
- }
- }
-
- return Standard_False;
-}
-
-/*!
- Set the numeric dimension for the current edge and validate creation.
-
- \param deltaX
- \param deltaY
-*/
-void Sketch::SetDimension(Standard_Real& deltaX, Standard_Real& deltaY)
-{
- fitInResol(deltaX);
- fitInResol(deltaY);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY + deltaY;
- MakeCurrentEdge(X,Y);
- ValidateEdge();
-}
-
-/*!
- Set the numeric value of the X coordinate of current point giving a deltaX relative to previous point.
-
- \param deltaX
-*/
-void Sketch::SetXDimension(Standard_Real& deltaX)
-{
- fitInResol(deltaX);
- Standard_Real X = myLastX + deltaX;
- Standard_Real Y = myLastY;
- if ( deltaX == 0. )
- Y = Y + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = X_FIXED;
- mySegmentX = X;
- }
- else if (myTransitionStatus == Y_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(X,mySegmentY);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- Y = X*Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of the Y coordinate of current point giving a deltaY relative to previous point.
-
- \param deltaY
-*/
-void Sketch::SetYDimension(Standard_Real& deltaY)
-{
- fitInResol(deltaY);
- Standard_Real X = myLastX;
- Standard_Real Y = myLastY + deltaY;
-
- if ( deltaY == 0. )
- X = X + 100.0 * Precision::Confusion();
-
- if (myTransitionStatus == NOCONSTRAINT) {
- MakeCurrentEdge(X,Y);
- myTransitionStatus = Y_FIXED;
- mySegmentY = Y;
- }
- else if (myTransitionStatus == X_FIXED) {
- myTransitionStatus = NOCONSTRAINT;
- MakeCurrentEdge(mySegmentX,Y);
- ValidateEdge();
- }
- else if (myTransitionStatus == ANGLE) {
- myTransitionStatus = NOCONSTRAINT;
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- X = Y/Tan(angle);
- MakeCurrentEdge(X,Y);
- ValidateEdge();
- }
- else
- myTransitionStatus = NOCONSTRAINT;
-}
-
-/*!
- Set the numeric value of angle between 2 segments.
-
- \param aValue
-*/
-void Sketch::SetSegmentAngle(Standard_Real& aValue)
-{
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Standard_Real angle;
- if (0 <= aValue && aValue<= PI )
- angle = PI - aValue;
- else
- angle = aValue - PI;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
-
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aSol.ThisSolution(1),0.,myLengthDimension->Value());
- }
- if (myTransitionStatus == LENGTH_FIXED) {
- ValidateEdge();
- }
- else if (myTransitionStatus == X_FIXED) {
- Standard_Real length = mySegmentX/Cos(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else if (myTransitionStatus == Y_FIXED) {
- Standard_Real length = mySegmentY/Sin(angle);
- SetDimension(length);
- ValidateEdge();
- }
- else {
- mySegmentAngle = aValue;
- myTransitionStatus = ANGLE;
- }
- }
-}
-
-/*!
- Get the angle value between 2 segments.
-
- \return Standard_Real
-*/
-Standard_Real Sketch::GetSegmentAngle()
-{
- return mySegmentAngle;
-}
-
-/*!
- Close automatically an open sketch.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::Close()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myEdgesNumber >= 2) {
- BRepTools_WireExplorer Ex(myCurrentWire.Wire());
- TopoDS_Vertex V1;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- V1 = TopExp::LastVertex(myPreviousEdge);
- else
- V1 = TopExp::FirstVertex(myPreviousEdge);
- myCurrentWire.Add(BRepBuilderAPI_MakeEdge(V1,myFirstPointSketch).Edge());
- myEdgesNumber++;
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-
-/*!
- Clear sketch presentation.
-*/
-void Sketch::Clear()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
-}
-
-/*!
- Terminate sketch without closing.
-
- \return TopoDS_Wire. Return null shape if not possible.
-*/
-TopoDS_Wire Sketch::End()
-{
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- if (myCurrentWire.IsDone()) {
- return myCurrentWire.Wire();
- }
- else
- return TopoDS_Wire();
-}
-
-
-/*!
- Delete current edge.
-*/
-Standard_Boolean Sketch::Delete()
-{
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-
- if (myCurrentStatus == BEGIN_SKETCH) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return true;
- }
- else if(myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- RemoveLastEdge();
- }
- else if(myCurrentStatus == ARC_CHORD_END) {
- myCurrentStatus = ARC_CHORD;
- myInteractiveContext->CloseAllContexts();
- }
- gp_Pnt pt;
- if (myEdgesNumber == 0) {
- //myInteractiveContext->EraseAll(Standard_False);
- ChangeMode(BEGIN_SKETCH); // DCQ
- pt = BRep_Tool::Pnt(myFirstPointSketch);
- }
- else {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD )
- pt = BRep_Tool::Pnt(TopExp::LastVertex(TopoDS::Edge(myPreviousEdge)));
- else
- pt = BRep_Tool::Pnt(TopExp::FirstVertex(TopoDS::Edge(myPreviousEdge)));
- }
- gp_Pnt2d pt2d= ProjLib::Project(myPlane->Pln(),pt);
- myLastX = pt2d.X();
- myLastY = pt2d.Y();
-
- return false;
-}
-
-/*!
- Set a specific plane for sketch.
-
- \param GeomyPlane
-*/
-void Sketch::SetPlane(const Handle(Geom_Plane)& aPlane)
-{
- myPlane = aPlane;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetWireColor(const Quantity_Color& aColor)
-{
- myWireColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetCurrentColor(const Quantity_Color& aColor)
-{
- myCurrentColor = aColor;
-}
-
-/*!
- Set display parameters.
-
- \param aColor
-*/
-void Sketch::SetAxisColor(const Quantity_Color& aColor)
-{
- myAxisColor = aColor;
-}
-
-
-/*!
- Change mode of construction line.
-
- \param aMode : SEGMENT, ARC_CHORD.
-*/
-void Sketch::ChangeMode(const SketchStatus aMode)
-{
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext(myInteractiveContext->IndexOfCurrentLocal());
- }
- if (!myCurrentStatus == BEGIN_SKETCH)
- myCurrentStatus = aMode; /* change the mode only when the sketch is not in state BEGIN_SKETCH, i.d. fist point has been fixed */
-
-}
-
-/*!
- Set transition constraint between consecutive edges.
-
- \param aStatus : NOCONSTRAINT, TANGENT, PERPENDICULAR, ANGLE, LENGTH_FIXED, X_FIXED, Y_FIXED.
-*/
-void Sketch::SetTransitionStatus(const TransitionStatus aStatus)
-{
- myTransitionStatus = aStatus;
-}
-
-/*!
- Set or unset the display of dimensions.
-
- \param atype
- \param OnOff
-*/
-void Sketch::SetParameterVisibility(const TypeOfParameter atype, const Standard_Boolean OnOff)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myIsAngleDimensionVisible = OnOff;
- if (!myIsAngleDimensionVisible && !myAngleDimension.IsNull())
- myInteractiveContext->Erase(myAngleDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case LENGTH_PARAMETER:
- myIsLengthDimensionVisible = OnOff;
- if (!myIsLengthDimensionVisible&& !myLengthDimension.IsNull())
- myInteractiveContext->Erase(myLengthDimension,Standard_True,Standard_False);
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case RADIUS_PARAMETER:
- myIsRadiusDimensionVisible = OnOff;
- if (!myIsRadiusDimensionVisible&& !myRadiusDimension.IsNull()){
- myInteractiveContext->Erase(myRadiusDimension,Standard_True,Standard_False);
- myInteractiveContext->Erase(myCenterCircle,Standard_True,Standard_False);
- }
- //else DCQ
- // DisplayCurrentEdge();
- break;
- case XVALUE_PARAMETER:
- myIsXDimensionVisible = OnOff;
- if (!myIsXDimensionVisible&& !myXDimension.IsNull())
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
- break;
- case YVALUE_PARAMETER:
- myIsYDimensionVisible = OnOff;
- if (!myIsYDimensionVisible&& !myYDimension.IsNull())
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
- break;
- }
-}
-
-/*!
- Hilight parameters.
-
- \param atype
- \param acolor
-*/
-void Sketch::HiligthWithColor(const TypeOfParameter atype, const Quantity_NameOfColor acolor)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->HilightWithColor(myAngleDimension, acolor);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->HilightWithColor(myLengthDimension, acolor);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->HilightWithColor(myRadiusDimension, acolor);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myXDimension, acolor);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->HilightWithColor(myYDimension, acolor);
- break;
- }
-}
-
-
-/*!
- Unhilight parameters.
-
- \param atype
-*/
-void Sketch::Unhiligth(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- myInteractiveContext->Unhilight(myAngleDimension);
- break;
- case LENGTH_PARAMETER:
- myInteractiveContext->Unhilight(myLengthDimension);
- break;
- case RADIUS_PARAMETER:
- myInteractiveContext->Unhilight(myRadiusDimension);
- break;
- case XVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myXDimension);
- break;
- case YVALUE_PARAMETER:
- myInteractiveContext->Unhilight(myYDimension);
- break;
- }
-}
-
-/*!
- Check if the edition of a type of parameter is relevant depending on sketch current status.
-
- \param atype
- \return Standard_Boolean
-*/
-Standard_Boolean Sketch::IsValidCurrentParameter(const TypeOfParameter atype)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- if (myCurrentStatus != SEGMENT && myCurrentStatus != ARC_CHORD)
- return Standard_False;
- else if (myTransitionStatus == TANGENT || myTransitionStatus == PERPENDICULAR)
- return Standard_False;
- else if (myEdgesNumber < 1)
- return Standard_False;
- else {
- TopLoc_Location L;
- Standard_Real First,Last;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (!PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)))
- return Standard_False;
- }
- break;
- case LENGTH_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == LENGTH_FIXED)
- return Standard_False;
- break;
- case RADIUS_PARAMETER:
- if (myCurrentStatus != ARC_CHORD_END)
- return Standard_False;
- break;
- case XVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == X_FIXED)
- return Standard_False;
- break;
- case YVALUE_PARAMETER:
- if (myCurrentStatus != SEGMENT &&
- myCurrentStatus != ARC_CHORD /*&&
- myCurrentStatus != CURVE_POINTS*/
- )
- return Standard_False;
- else if (myTransitionStatus == Y_FIXED)
- return Standard_False;
- break;
- }
- return Standard_True;
-}
-
-/*!
- Set a parameter value.
-
- \param atype
- \param aValue
-*/
-void Sketch::SetParameterValue(const TypeOfParameter atype, Standard_Real aValue)
-{
- switch (atype) {
- case ANGLE_PARAMETER:
- SetSegmentAngle(aValue);
- break;
- case LENGTH_PARAMETER:
- SetDimension(aValue);
- break;
- case RADIUS_PARAMETER:
- SetDimension(aValue);
- break;
- case XVALUE_PARAMETER:
- SetXDimension(aValue);
- break;
- case YVALUE_PARAMETER:
- SetYDimension(aValue);
- break;
- }
-}
-
-/*!
- Initialisation of sketch parameters or options.
-*/
-void Sketch::Init()
-{
- myPlane = new Geom_Plane (0.,0.,1.,0.);
- CreateConstraints();
- BRepLib::Plane(myPlane);
- myEdgesNumber = 0;
- myCurrentStatus = BEGIN_SKETCH;
- /* In order to update the visulisation of current objects by using Redisplay method from InteractiveContext */
- myCurrentEdge = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- myPresentableEdge = new AIS_Shape(myCurrentEdge);
- myPresentableEdge->SetColor(myCurrentColor.Name());
- myInteractiveContext->Display(myPresentableEdge);
- myTransitionStatus = NOCONSTRAINT;
- /* Init for display objects */
- TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(10.,0.,0.));
- myLengthDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myXDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Horizontal);
- myYDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString(),gp_Pnt(),DsgPrs_AS_NONE,
- AIS_TOD_Vertical);
- myRadiusDimension = new AIS_LengthDimension (V1,V2,myPlane,0.,TCollection_ExtendedString());
- myCenterCircle = new AIS_Shape(V1);
- myIsLengthDimensionVisible = Standard_False;
- myIsXDimensionVisible = Standard_False;
- myIsYDimensionVisible = Standard_False;
- myIsRadiusDimensionVisible = Standard_False;
-}
-
-/*!
- Build the current segment.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentSegment(Standard_Real X, Standard_Real Y)
-{
- if (myTransitionStatus == NOCONSTRAINT)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- else if (myTransitionStatus == X_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(mySegmentX,Y));
- else if (myTransitionStatus == Y_FIXED)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),gp_Pnt2d(X,mySegmentY));
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Vec2d Vt;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D1(last,p1,Vt);
- else
- C->D1(first,p1,Vt);
- gp_Lin2d aline(p1,Vt);
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(aline));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- Geom2dAPI_ProjectPointOnCurve proj(gp_Pnt2d(X,Y),new Geom2d_Line(perpen));
- if (proj.NbPoints() > 0)
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(p1,proj.Point(1));
- }
- else if (myTransitionStatus == ANGLE && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- Standard_Real angle;
- if (0 <= mySegmentAngle && mySegmentAngle<= PI )
- angle = PI - mySegmentAngle;
- else
- angle = mySegmentAngle - PI;
- GccAna_Lin2dTanObl aSol(gp_Pnt2d(myLastX,myLastY),Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d(),angle);
- Standard_Real dist = RealLast();
- gp_Pnt2d pt(X,Y),ptproj;
- for (Standard_Integer i =1; i<=aSol.NbSolutions(); i++) {
- Geom2dAPI_ProjectPointOnCurve proj(pt,new Geom2d_Line(aSol.ThisSolution(i)));
- if (pt.Distance(proj.Point(1)) < dist) {
- dist = pt.Distance(proj.Point(1));
- ptproj = proj.Point(1);
- }
- }
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(gp_Pnt2d(myLastX,myLastY),ptproj);
- }
- }
- else if (myTransitionStatus == LENGTH_FIXED && myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myPreviousEdge),myPlane,L,First,Last);
- gp_Lin2d aline = gce_MakeLin2d(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y));
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(aline,0.,mySegmentLength);
- }
- }
-}
-
-/*!
- Build the current arc.
-
- \param X
- \param Y
-*/
-void Sketch::MakeCurrentArc(Standard_Real X, Standard_Real Y)
-{
- gp_Circ2d CircSol;
- Standard_Boolean OK(Standard_False);
-
- if (myTransitionStatus == NOCONSTRAINT) {
- GccAna_Circ2d2TanOn aSol(gp_Pnt2d(myLastX,myLastY), gp_Pnt2d(X,Y),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- /* Tangency with previous edge */
- else if (myTransitionStatus == TANGENT && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))){
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Line)::DownCast(C)->Lin2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(Handle(Geom2d_Circle)::DownCast(C)->Circ2d()), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- else if(C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve))) {
- gp_Pnt2d pc;
- gp_Vec2d Vt;
- C->D1(last,pc,Vt);
- gp_Lin2d alin2d(pc,gp_Dir2d(Vt));
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(alin2d), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
- }
- /* Tangency with the perpendicular to the previous edge */
- else if (myTransitionStatus == PERPENDICULAR && myEdgesNumber > 0) {
- Standard_Real first,last;
- TopLoc_Location L;
- Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,first,last);
- gp_Pnt2d p1;
- gp_Lin2d perpen;
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- C->D0(last,p1);
- else
- C->D0(first,p1);
- if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Line)::DownCast(C)->Lin2d());
- perpen = aSol.ThisSolution(1);
- }
- else if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
- GccAna_Lin2dTanPer aSol(p1,Handle(Geom2d_Circle)::DownCast(C)->Circ2d());
- perpen = aSol.ThisSolution(1);
- }
- GccAna_Circ2d2TanOn aSol(GccEnt::Unqualified(perpen), gp_Pnt2d(myLastX,myLastY),myMediatrice->Lin2d(),Precision::Confusion());
- if (aSol.NbSolutions() > 0){
- CircSol = aSol.ThisSolution(1);
- OK = Standard_True;
- }
- }
-
- gp_Pnt2d p;
- if (myEdgesNumber > 0) {
- if (myPreviousEdge.Orientation() == TopAbs_FORWARD)
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::LastVertex(myPreviousEdge)));
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(TopExp::FirstVertex(myPreviousEdge)));
- }
- else
- p = ProjLib::Project(myPlane->Pln(),BRep_Tool::Pnt(myFirstPointSketch));
- if (OK){
- gp_Vec2d V1(p,gp_Pnt2d(X,Y));
- gp_Vec2d V2(p,gp_Pnt2d(myLastX,myLastY));
- if (V1.Angle(V2) > 0 )
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,p,gp_Pnt2d(myLastX,myLastY));
- else {
- myCurrentEdge = BRepBuilderAPI_MakeEdge2d(CircSol,gp_Pnt2d(myLastX,myLastY),p);
- myCurrentEdge.Reverse();
- }
- }
- else {
- myCurrentStatus = ARC_CHORD;
- myLastX = p.X();
- myLastY = p.Y();
- myInteractiveContext->CloseLocalContext();
- }
-
-}
-
-/*!
- Display the current edge under construction with it's dimension.
-*/
-void Sketch::DisplayCurrentEdge()
-{
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- if (myCurrentStatus == SEGMENT ||
- myCurrentStatus == ARC_CHORD ) {
- /* Length dimension */
- TopoDS_Vertex V1 = TopExp::FirstVertex(TopoDS::Edge(myCurrentEdge));
- TopoDS_Vertex V2 = TopExp::LastVertex(TopoDS::Edge(myCurrentEdge));
- DisplayLengthDimension(V1,V2);
- /* Angular dimension */
- DisplayAngleDimension();
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
- else if (myCurrentStatus == ARC_CHORD_END )
- DisplayRadiusDimension();
- else {
- TopoDS_Vertex V1 = TopoDS::Vertex(myCurrentEdge);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.));
- DisplayXDimension(V1,V2);
- DisplayYDimension(V1,V2);
- }
-
-}
-
-/*!
- Display the current length dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- Standard_Real length = p1.Distance(p2);
- if (length <= Precision::Confusion()) return;
- myLengthDimension->SetFirstShape(V1);
- myLengthDimension->SetSecondShape(V2);
- fitInResol(length);
- myLengthDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myLengthDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myIsLengthDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myLengthDimension))
- myInteractiveContext->Redisplay(myLengthDimension);
- else
- myInteractiveContext->Display(myLengthDimension);
- }
-}
-
-/*!
- Display the current X dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != X_FIXED) {
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
-
- gp_Lin aline(p1,myPlane->Pln().XAxis().Direction());
- GeomAPI_ProjectPointOnCurve proj(p2,new Geom_Line(aline));
-
- gp_Pnt pb = p1;
-
- if (proj.NbPoints() > 0) {
- Standard_Real length = p1.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myXDimension->SetFirstShape(V1);
- myXDimension->SetSecondShape(V2);
- fitInResol(length);
- myXDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myXDimension->SetText(TCollection_ExtendedString(strdup(S)));
- // myXDimension->SetPosition(proj.Point(1));
- pb.BaryCenter(5,proj.Point(1),5);
- myXDimension->SetPosition(pb);
- if (myIsXDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myXDimension))
- myInteractiveContext->Redisplay(myXDimension);
- else
- myInteractiveContext->Display(myXDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myXDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current Y dimension.
-
- \param V1
- \param V2
-*/
-void Sketch::DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2)
-{
- if (myTransitionStatus != Y_FIXED) {
-
- gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(V1));
- gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(V2));
- gp_Lin aline(p2 /*p1*/, myPlane->Pln().YAxis().Direction());
- gp_Pnt pb = p2 /*p1*/;
- GeomAPI_ProjectPointOnCurve proj(p1 /*p2*/,new Geom_Line(aline));
- if (proj.NbPoints() > 0) {
- Standard_Real length = /*p1*/ p2.Distance(proj.Point(1));
- if (length <= Precision::Confusion()) return;
- myYDimension->SetFirstShape(V1);
- myYDimension->SetSecondShape(V2);
- fitInResol(length);
- myYDimension->SetValue(length);
- QString S;
- S.sprintf("%.1f",length);
- myYDimension->SetText(TCollection_ExtendedString(strdup(S)));
- pb.BaryCenter(5,proj.Point(1),5);
- myYDimension->SetPosition(pb);
- // myYDimension->SetPosition(p2);
- if (myIsYDimensionVisible) {
- if (myInteractiveContext->IsDisplayed(myYDimension))
- myInteractiveContext->Redisplay(myYDimension);
- else
- myInteractiveContext->Display(myYDimension);
- }
- }
- } else
- myInteractiveContext->Erase(myYDimension,Standard_True,Standard_False);
-}
-
-/*!
- Display the current angle dimension.
-*/
-void Sketch::DisplayAngleDimension()
-{
- if (!myIsAngleDimensionVisible)
- return;
- if (myEdgesNumber > 0) {
- Standard_Real First,Last;
- TopLoc_Location L;
- Handle (Geom2d_Curve) PreviousCurve = BRep_Tool::CurveOnSurface(myPreviousEdge,myPlane,L,First,Last);
- Handle (Geom2d_Curve) CurrentCurve = BRep_Tool::CurveOnSurface(TopoDS::Edge(myCurrentEdge),myPlane,L,First,Last);
- if (PreviousCurve->IsKind(STANDARD_TYPE(Geom2d_Line)) && CurrentCurve->IsKind(STANDARD_TYPE(Geom2d_Line))) {
- Standard_Real angle = Handle(Geom2d_Line)::DownCast(PreviousCurve)->Lin2d().Angle(Handle(Geom2d_Line)::DownCast(CurrentCurve)->Lin2d());
- gp_Pnt2d apos;
- if (0 <= angle && angle<= PI)
- angle = PI - angle;
- else
- angle = PI + angle;
- CurrentCurve->D0((First+Last)/5.,apos);
- gp_Pnt apos3d = ElCLib::To3d(myPlane->Pln().Position().Ax2(),apos);
- Standard_Real angtext = angle*180./PI;
- mySegmentAngle = angle;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- fitInResol(angtext);
-
- QString S;
- S.sprintf("%.1f",angtext);
- if (myInteractiveContext->IndexOfCurrentLocal() == 0) {
- myInteractiveContext->OpenLocalContext();
- myAngleDimension = new AIS_AngleDimension(myPreviousEdge,TopoDS::Edge(myCurrentEdge),myPlane,angle,
- TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Display(myAngleDimension);
- }
- else {
- myAngleDimension->SetSecondShape(myCurrentEdge);
- myAngleDimension->SetValue(angle);
- myAngleDimension->SetPosition(apos3d);
- myAngleDimension->SetText(TCollection_ExtendedString(strdup(S)));
- myInteractiveContext->Redisplay(myAngleDimension);
- }
- }
- }
-}
-
-/*!
- Display the current radius dimension.
-*/
-void Sketch::DisplayRadiusDimension()
-{
- if (! myIsRadiusDimensionVisible)
- return;
- BRepLib::BuildCurve3d(TopoDS::Edge(myCurrentEdge));
- Standard_Real First,Last;
- Handle (Geom_Circle) C = Handle (Geom_Circle)::DownCast(BRep_Tool::Curve(TopoDS::Edge(myCurrentEdge),First,Last));
- if (!C.IsNull()) {
- Standard_Real R = C->Radius();
- TopoDS_Shape V1 = BRepBuilderAPI_MakeVertex(C->Location());
- gp_Pnt MidlePoint ;
- C->D0((First+Last)/2.,MidlePoint);
- TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(MidlePoint);
- myRadiusDimension->SetFirstShape(V1);
- myRadiusDimension->SetSecondShape(V2);
- myRadiusDimension->SetValue(R);
- fitInResol(R);
- QString S;
- S.sprintf("%.1f",R);
- myRadiusDimension->SetText(TCollection_ExtendedString(strdup(S)));
- if (myInteractiveContext->IsDisplayed(myRadiusDimension))
- myInteractiveContext->Redisplay(myRadiusDimension);
- else
- myInteractiveContext->Display(myRadiusDimension);
- myCenterCircle->Set(V1);
- if (myInteractiveContext->IsDisplayed(myCenterCircle))
- myInteractiveContext->Redisplay(myCenterCircle);
- else
- myInteractiveContext->Display(myCenterCircle);
- }
-}
-
-/*!
- Remove last edge from the current wire.
-*/
-void Sketch::RemoveLastEdge()
-{
- if (myEdgesNumber == 0) {
- myCurrentStatus = END_SKETCH;
- myInteractiveContext->CloseAllContexts();
- myInteractiveContext->EraseAll(Standard_False);
- return;
- }
- else {
- BRepTools_WireExplorer Ex;
- BRepBuilderAPI_MakeWire MW;
- Standard_Integer index = 1;
- myCurrentEdge = myPreviousEdge;
- for (Ex.Init(myCurrentWire.Wire());Ex.More();Ex.Next()){
- if (index <= myEdgesNumber-1) {
- MW.Add(Ex.Current());
- myPreviousEdge = Ex.Current();
- index++;
- }
- }
- myCurrentWire = MW;
- myCurrentStatus = (SketchStatus)myConstructionMode(myEdgesNumber);
- myTransitionStatus = (TransitionStatus)myConstraintMode(myEdgesNumber);
- myEdgesNumber--;
- myConstructionMode.Remove(index);
- myConstraintMode.Remove(index);
- if (myEdgesNumber == 0)
- myPresentableWire->Set(myFirstPointSketch);
- else
- myPresentableWire->Set(myCurrentWire.Wire());
- myInteractiveContext->Redisplay(myPresentableWire);
- myInteractiveContext->CloseLocalContext();
- myPresentableEdge->Set(myCurrentEdge);
- myInteractiveContext->Redisplay(myPresentableEdge);
- }
-}
-
-/*!
- Create initial constraints.
-*/
-void Sketch::CreateConstraints()
-{
- Handle(Geom_Axis1Placement) xAxis = new Geom_Axis1Placement(myPlane->Pln().XAxis());
- Handle(Geom_Axis1Placement) yAxis = new Geom_Axis1Placement(myPlane->Pln().YAxis());
- myHAxis = new AIS_Axis(xAxis);
- myVAxis = new AIS_Axis(yAxis);
- myAngularAxis = myVAxis;
- myHAxis->SetColor(myAxisColor.Name());
- myVAxis->SetColor(myAxisColor.Name());
- myAngularAxis->SetColor(myAxisColor.Name());
-}
-
-/*!
- fitInResol.
-
- \param toFit
- \param minIsResol
-*/
-void Sketch::fitInResol(Standard_Real &toFit, Standard_Boolean minIsResol)
-{
- Standard_Real sign = (toFit < 0) ? -1. : +1.;
- Standard_Real value = toFit + sign * resol/2.0; /* why "+ resol/2.0" ? because if resol = 0.5, 3.3 is rounded to 3.5 */
- int nTimesResol = int(value/resol);
- if ((nTimesResol == 0) && (minIsResol)) nTimesResol = 1;
- toFit = nTimesResol*resol;
-}
-
-SketchStatus Sketch::GetCurrentStatus()
-{
- return myCurrentStatus;
-}
-
-Standard_Integer Sketch::GetmyEdgesNumber()
-{
- return myEdgesNumber;
-}
-
-
-
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_Sketcher.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-#include "GEOM_SketcherStatus.h"
-
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <Geom_Plane.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
-#include <AIS_Axis.hxx>
-#include <TopoDS_Edge.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
-#include <AIS_AngleDimension.hxx>
-#include <Geom2d_Line.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TColgp_SequenceOfPnt2d.hxx>
-#include <gp_Vec2d.hxx>
-
-class Sketch
-{
-public:
- Sketch();
- ~Sketch();
- Sketch(const Handle(V3d_Viewer)& aViewer);
- Sketch(const Handle(V3d_Viewer)& aViewer,
- const Quantity_Color& anAxisColor,
- const Quantity_Color& aCurrentColor,
- const Quantity_Color& aWireColor);
-
- static void fitInResol(Standard_Real &toFit,
- Standard_Boolean minIsResol = Standard_False);
-
- void MakeCurrentEdge(const Standard_Integer Xp ,
- const Standard_Integer Yp ,
- const Handle(V3d_View)& aView );
-
- void MakeCurrentEdge(const Standard_Real X, const Standard_Real Y);
-
- Standard_Boolean SetDimension(Standard_Real& aValue);
- void SetDimension(Standard_Real& deltaX,Standard_Real& deltaY);
-
- void SetXDimension(Standard_Real& deltaX);
- void SetYDimension(Standard_Real& deltaY);
-
- void SetSegmentAngle(Standard_Real& aValue);
- Standard_Real GetSegmentAngle();
-
- void ValidateEdge();
-
- TopoDS_Wire Close();
- TopoDS_Wire End();
-
- void Clear();
-
- Standard_Boolean Delete();
-
- void SetPlane(const Handle(Geom_Plane)& aPlane);
-
- void SetWireColor(const Quantity_Color& aColor);
- void SetCurrentColor(const Quantity_Color& aColor);
- void SetAxisColor(const Quantity_Color& aColor);
-
- void SetParameterVisibility(const TypeOfParameter atype,
- const Standard_Boolean OnOff);
-
- void HiligthWithColor(const TypeOfParameter atype,
- const Quantity_NameOfColor acolor);
- void Unhiligth(const TypeOfParameter atype);
-
- Standard_Boolean IsValidCurrentParameter(const TypeOfParameter atype);
-
- void SetParameterValue(const TypeOfParameter atype, Standard_Real aValue);
-
- void ChangeMode(const SketchStatus aMode);
-
- void SetTransitionStatus(const TransitionStatus aStatus);
-
- SketchStatus GetCurrentStatus();
- Standard_Integer GetmyEdgesNumber();
-
-private :
-
- void Init();
-
- void MakeCurrentSegment(Standard_Real X, Standard_Real Y);
-
- void MakeCurrentArc(Standard_Real X, Standard_Real Y);
-
- void DisplayCurrentEdge();
-
- void DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
- void DisplayAngleDimension();
- void DisplayRadiusDimension();
-
- void AddEdgeToWire();
-
- void RemoveLastEdge();
-
- void CreateConstraints();
-
-private:
- // Current status of construction
- SketchStatus myCurrentStatus;
- // Transition status between arcs and segments
- TransitionStatus myTransitionStatus;
- // Current wire
- BRepBuilderAPI_MakeWire myCurrentWire;
- // Current presentable wire
- Handle_AIS_Shape myPresentableWire;
- // Number of edges into the current wire
- Standard_Integer myEdgesNumber;
- // Store for each edge how it has been built i.d the value of myCurrentStatus
- TColStd_SequenceOfInteger myConstructionMode;
- // Store for each edge how it has been built i.d the value of myTransitionStatus
- TColStd_SequenceOfInteger myConstraintMode;
- // Current edge
- TopoDS_Shape myCurrentEdge;
- // Previous edge
- TopoDS_Edge myPreviousEdge;
- // List of points to interpolate when computing a curve by interpolation
- TColgp_SequenceOfPnt2d myPointsToInterpolate;
- // Tangent vector at beginning of curve
- gp_Vec2d myTangentVector;
- // Tangent flag at beginning og curve
- Standard_Boolean myTangentFlag;
-
- // Origin of sketch
- TopoDS_Vertex myFirstPointSketch;
- // Last x coordinate of end point of previous edge or picked point
- Standard_Real myLastX;
- // Last y coordinate of end point of previous edge or picked point
- Standard_Real myLastY;
- // angle between 2 segments when an ANGLE TransitionStatus is set.
- Standard_Real mySegmentAngle;
- // Length of segment when the length of the segment is fixed before the angle
- Standard_Real mySegmentLength;
- // Value of X fixed coordinate
- Standard_Real mySegmentX;
- // Value of Y fixed Coordinate
- Standard_Real mySegmentY;
- Handle_AIS_Shape myPresentableEdge; // Current presentable edge
- Handle_AIS_LengthDimension myLengthDimension;// For display of current length segment dimension
- Handle_AIS_LengthDimension myXDimension; // For display of current X segment dimension
- Handle_AIS_LengthDimension myYDimension; // For display of current Y segment dimension
- Handle_AIS_LengthDimension myRadiusDimension;// For display of current radius dimension
- Handle_AIS_AngleDimension myAngleDimension; // For display of current angle dimension
- Standard_Boolean myIsLengthDimensionVisible; // Visibility flag for LengthDimension
- Standard_Boolean myIsXDimensionVisible; // Visibility flag for X Dimension
- Standard_Boolean myIsYDimensionVisible; // Visibility flag for Y Dimension
- Standard_Boolean myIsRadiusDimensionVisible; // Visibility flag for RadiusDimension
- Standard_Boolean myIsAngleDimensionVisible; // Visibility flag for AngleDimension
- Handle_AIS_Axis myPresentableMediatrice; // Chord mediatrice of current circle as a presentable object
- Handle_Geom2d_Line myMediatrice; // Chord mediatrice of current circle as a 2d line
- Handle_AIS_Shape myCenterCircle; // to visualise center of current arc
-
- Handle_AIS_Axis myHAxis; // Horizontal axis
- Handle_AIS_Axis myVAxis; // Vertical axis
- Handle_AIS_Axis myAngularAxis; // Axis making a predefined angle with the previous edge
-
- Quantity_Color myWireColor; // Color of wire and of build edges
- Quantity_Color myCurrentColor; // Color of edge under construction
- Quantity_Color myAxisColor; // Color for axis
- Handle_AIS_InteractiveContext myInteractiveContext; // Interactive context for display management
-
- Handle_Geom_Plane myPlane; // Plane of sketch
-
- BRepBuilderAPI_MakeWire myPasteWire;
- Standard_Integer myPasteEdgesNumber;
- TColStd_SequenceOfInteger myPasteConstructionMode;
- TColStd_SequenceOfInteger myPasteConstraintMode;
-};
+++ /dev/null
-// GEOM SKETCHER : basic sketcher
-//
-// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : GEOM_SketcherStatus.h
-// Author : Nicolas REJNERI
-// Module : GEOM
-// $Header$
-
-enum TransitionStatus {
- NOCONSTRAINT, // no constraint between consecutive edges
- TANGENT, // arc and segment are tangent
- PERPENDICULAR,// arc is tangent to the perpendicular to the segment
- ANGLE, // Angular constraint between 2 segments
- LENGTH_FIXED, // Length of segment has been fixed
- X_FIXED, // X coordinate for segment has been fixed
- Y_FIXED // Y coordinate for segment has been fixed
- };
-
-enum TypeOfParameter {
- ANGLE_PARAMETER,
- LENGTH_PARAMETER,
- RADIUS_PARAMETER,
- XVALUE_PARAMETER,
- YVALUE_PARAMETER
- };
-
-enum SketchStatus {
- BEGIN_SKETCH, // Begin sketch; no edges created yet
- SEGMENT, // Current mode for creation is segment
- ARC_CHORD, // Current mode for creation is arc by chord
- ARC_CHORD_END,// Chord validated, waiting for radius or center
- END_SKETCH // End sketch
-};
# Libraries targets
LIB = libGEOMSketcher.la
-LIB_SRC = GEOM_Sketcher.cxx
-LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
+LIB_SRC = Sketcher_Profile.cxx
+LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl
# header files
-EXPORT_HEADERS= GEOM_Sketcher.h \
- GEOM_SketcherStatus.h
+EXPORT_HEADERS= Sketcher_Profile.hxx
# additionnal information to compil and link file
-CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
-CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS += $(QT_LIBS) $(CAS_LDPATH) -lTKTopAlgo -L${KERNEL_ROOT_DIR}/lib/salome
-
-# additional file to be cleaned
-MOSTLYCLEAN =
-CLEAN =
-DISTCLEAN =
+CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
+CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
+LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
@CONCLUDE@
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : Sketcher_Profile.cxx
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+using namespace std;
+#include "Sketcher_Profile.hxx"
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Ax2.hxx>
+#include <BRepLib.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <Geom2d_Line.hxx>
+#include <Geom2d_Circle.hxx>
+#include <Geom_Surface.hxx>
+#include <Precision.hxx>
+#include <GeomAPI.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile()
+{
+}
+
+
+//=======================================================================
+// profile
+// command to build a profile
+//=======================================================================
+Sketcher_Profile::Sketcher_Profile(const char* aCmd)
+{
+ enum {line, circle, point, none} move;
+
+ Standard_Integer i = 1;
+ Standard_Real x0, y0, x, y, dx, dy;
+ x0 = y0 = x = y = dy = 0;
+ dx = 1;
+
+ Standard_Boolean first, stayfirst, face, close;
+ first = Standard_True;
+ stayfirst = face = close = Standard_False;
+
+ TopoDS_Shape S;
+ TopoDS_Vertex MP;
+ BRepBuilderAPI_MakeWire MW;
+ gp_Ax3 DummyHP(gp::XOY());
+ gp_Pln P(DummyHP);
+ TopLoc_Location TheLocation;
+ Handle(Geom_Surface) Surface;
+
+ myOK = Standard_False;
+
+ TCollection_AsciiString aCommand(CORBA::string_dup(aCmd));
+ TCollection_AsciiString aToken = aCommand.Token(":", 1);
+ int n = 0;
+ TCollection_AsciiString aTab[aCommand.Length()];
+ while(aToken.Length() != 0) {
+ if(aCommand.Token(":", n + 1).Length() > 0)
+ aTab[n] = aCommand.Token(":", n + 1);
+ aToken = aCommand.Token(":", ++n);
+ }
+ n = n - 1;
+
+ while(i < n) {
+ Standard_Real length = 0, radius = 0, angle = 0;
+ move = point;
+
+ int n1 = 0;
+ TCollection_AsciiString a[aTab[0].Length()];
+ aToken = aTab[i].Token(" ", 1);
+ while(aToken.Length() != 0) {
+ if(aTab[i].Token(" ", n1 + 1).Length() > 0)
+ a[n1] = aTab[i].Token(" ", n1 + 1);
+ aToken = aTab[i].Token(" ", ++n1);
+ }
+ n1 = n1 - 1;
+
+ switch(a[0].Value(1))
+ {
+ case 'F':
+ {
+ if (n1 != 3) goto badargs;
+ if (!first) {
+ cout<<"profile : The F instruction must precede all moves"<<endl;
+ return;
+ }
+ x0 = x = a[1].RealValue();
+ y0 = y = a[2].RealValue();
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'O':
+ {
+ if (n1 != 4) goto badargs;
+ P.SetLocation(gp_Pnt(a[1].RealValue(), a[2].RealValue(), a[3].RealValue()));
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'P':
+ {
+ if (n1 != 7) goto badargs;
+ gp_Vec vn(a[1].RealValue(), a[2].RealValue(), a[3].RealValue());
+ gp_Vec vx(a[4].RealValue(), a[5].RealValue(), a[6].RealValue());
+ if (vn.Magnitude() <= Precision::Confusion() || vx.Magnitude() <= Precision::Confusion()) {
+ cout<<"profile : null direction"<<endl;
+ return;
+ }
+ gp_Ax2 ax(P.Location(), vn, vx);
+ P.SetPosition(ax);
+ stayfirst = Standard_True;
+ break;
+ }
+ case 'X':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "XX")
+ length -= x;
+ dx = 1; dy = 0;
+ move = line;
+ break;
+ }
+ case 'Y':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "YY")
+ length -= y;
+ dx = 0; dy = 1;
+ move = line;
+ break;
+ }
+ case 'L':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'T':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ if (a[0] == "TT") {
+ vx -= x;
+ vy -= y;
+ }
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ move = line;
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'R':
+ {
+ if (n1 != 2) goto badargs;
+ angle = a[1].RealValue() * PI180;
+ if (a[0] == "RR") {
+ dx = Cos(angle);
+ dy = Sin(angle);
+ }
+ else {
+ Standard_Real c = Cos(angle);
+ Standard_Real s = Sin(angle);
+ Standard_Real t = c * dx - s * dy;
+ dy = s * dx + c * dy;
+ dx = t;
+ }
+ break;
+ }
+ case 'D':
+ {
+ if (n1 != 3) goto badargs;
+ Standard_Real vx = a[1].RealValue();
+ Standard_Real vy = a[2].RealValue();
+ length = Sqrt(vx * vx + vy * vy);
+ if (length > Precision::Confusion()) {
+ dx = vx / length;
+ dy = vy / length;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'C':
+ {
+ if (n1 != 3) goto badargs;
+ radius = a[1].RealValue();
+ if (Abs(radius) > Precision::Confusion()) {
+ angle = a[2].RealValue() * PI180;
+ move = circle;
+ }
+ else
+ move = none;
+ break;
+ }
+ case 'I':
+ {
+ if (n1 != 2) goto badargs;
+ length = a[1].RealValue();
+ if (a[0] == "IX") {
+ if (Abs(dx) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - x) / dx;
+ }
+ else if (a[0] == "IY") {
+ if (Abs(dy) < Precision::Confusion()) {
+ cout<<"profile : cannot intersect, arg "<<i-1<<endl;
+ return;
+ }
+ length = (length - y) / dy;
+ }
+ if (Abs(length) > Precision::Confusion())
+ move = line;
+ else
+ move = none;
+ break;
+ }
+ case 'W':
+ {
+ if (a[0] == "WW")
+ close = Standard_True;
+ else if(a[0] == "WF") {
+ close = Standard_True;
+ face = Standard_True;
+ }
+ i = n - 1;
+ break;
+ }
+ default:
+ {
+ cout<<"profile : unknown code "<<a[i]<<endl;
+ return;
+ }
+ }
+
+ again :
+ switch (move)
+ {
+ case line :
+ {
+ if (length < 0) {
+ length = -length;
+ dx = -dx;
+ dy = -dy;
+ }
+ Handle(Geom2d_Line) l = new Geom2d_Line(gp_Pnt2d(x,y),gp_Dir2d(dx,dy));
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(l,P),0,length));
+ x += length*dx;
+ y += length*dy;
+ break;
+ }
+ case circle :
+ {
+ Standard_Boolean sense = Standard_True;
+ if (radius < 0) {
+ radius = -radius;
+ sense = !sense;
+ dx = -dx;
+ dy = -dy;
+ }
+ gp_Ax2d ax(gp_Pnt2d(x-radius*dy,y+radius*dx),gp_Dir2d(dy,-dx));
+ if (angle < 0) {
+ angle = -angle;
+ sense = !sense;
+ }
+ Handle(Geom2d_Circle) c = new Geom2d_Circle(ax,radius,sense);
+ MW.Add(BRepBuilderAPI_MakeEdge(GeomAPI::To3d(c,P),0,angle));
+ gp_Pnt2d p;
+ gp_Vec2d v;
+ c->D1(angle,p,v);
+ x = p.X();
+ y = p.Y();
+ dx = v.X() / radius;
+ dy = v.Y() / radius;
+ break;
+ }
+ case point:
+ {
+ MP = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, 0.0));
+ break;
+ }
+ case none:
+ {
+ i = n - 1;
+ break;
+ }
+ }
+
+ // update first
+ first = stayfirst;
+ stayfirst = Standard_False;
+
+ if(!(dx == 0 && dy == 0))
+ myLastDir.SetCoord(dx, dy, 0.0);
+ else
+ return;
+ myLastPoint.SetX(x);
+ myLastPoint.SetY(y);
+
+ // next segment....
+ i++;
+ if ((i == n) && close) {
+ // the closing segment
+ dx = x0 - x;
+ dy = y0 - y;
+ length = Sqrt(dx * dx + dy * dy);
+ move = line;
+ if (length > Precision::Confusion()) {
+ dx = dx / length;
+ dy = dy / length;
+ goto again;
+ }
+ }
+ }
+
+ // get the result, face or wire
+ if (move == none)
+ return;
+ else if (move == point)
+ S = MP;
+ else if (face)
+ S = BRepBuilderAPI_MakeFace(P, MW.Wire());
+ else
+ S = MW;
+
+ if(!TheLocation.IsIdentity())
+ S.Move(TheLocation);
+
+ myShape = S;
+ myOK = true;
+ return;
+
+ badargs :
+ cout<<"profile : bad number of arguments"<<endl;
+ return;
+}
--- /dev/null
+// GEOM SKETCHER : basic sketcher
+//
+// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : Sketcher_Profile.h
+// Author : Damien COQUERET
+// Module : GEOM
+// $Header:
+
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <TopoDS_Shape.hxx>
+
+class Sketcher_Profile
+{
+
+public:
+ Sketcher_Profile();
+ Sketcher_Profile(const char* aCmd);
+
+private:
+ gp_Pnt myLastPoint;
+ gp_Dir myLastDir;
+
+ TopoDS_Shape myShape;
+ bool myOK;
+
+public:
+ gp_Pnt GetLastPoint(){return myLastPoint;};
+ gp_Dir GetLastDir(){return myLastDir;};
+
+ const TopoDS_Shape& GetShape(){return myShape;};
+ bool IsDone(){return myOK;};
+
+};
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MirrorDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include <Geom_Plane.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MirrorDlg()
// purpose : Constructs a TransformationGUI_MirrorDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_MirrorDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiRotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_MultiRotationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
QObject* send = (QObject*)sender();
if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
- myNbTimes1 = newValue;
+ myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX1)
myAng = newValue;
else if(send == GroupDimensions->SpinBox_DX2)
myStep = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
- myNbTimes2 = newValue;
+ myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir)
this->MakeMultiRotationSimulationAndDisplay();
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiTranslationDlg.h"
#include <gp_Lin.hxx>
#include <TopoDS_Compound.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_MultiTranslationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
if(send == GroupPoints->SpinBox_DX)
myStep1 = newValue;
else if(send == GroupPoints->SpinBox_DY)
- myNbTimes1 = newValue;
+ myNbTimes1 = (int)newValue;
if(myOkBase && myOkDir1)
this->MakeMultiTranslationSimulationAndDisplay();
break;
if(send == GroupDimensions->SpinBox_DX1)
myStep1 = newValue;
else if(send == GroupDimensions->SpinBox_DY1)
- myNbTimes1 = newValue;
+ myNbTimes1 = (int)newValue;
else if(send == GroupDimensions->SpinBox_DX2)
myStep2 = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
- myNbTimes2 = newValue;
+ myNbTimes2 = (int)newValue;
if(myOkBase && myOkDir1 && myOkDir2)
this->MakeMultiTranslationSimulationAndDisplay();
break;
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_RotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_RotationDlg()
// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_RotationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_ScaleDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_ScaleDlg()
// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_ScaleDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_TranslationDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_TranslationDlg()
// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the
//=================================================================================
void TransformationGUI_TranslationDlg::ClickOnApply()
{
+ buttonApply->setFocus();
QAD_Application::getDesktop()->putInfo(tr(""));
if (mySimulationTopoDs.IsNull())
return;