ORIG_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+GEOM_WITH_GUI="yes"
########################################################################
# Test if the KERNEL_ROOT_DIR is set correctly
# echo "failed : KERNEL_SRC variable is not correct !"
# exit
#fi
+
+for option
+do
+ case $option in
+ -with-ihm | --with-ihm)
+ GEOM_WITH_GUI="yes"
+ break;;
+ -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
+ GEOM_WITH_GUI="no"
+ break;;
+ esac
+done
+
########################################################################
# Test if the GUI_ROOT_DIR is set correctly
-if test ! -d "${GUI_ROOT_DIR}"; then
- echo "failed : GUI_ROOT_DIR variable is not correct !"
- exit
+if test ${GEOM_WITH_GUI} = yes; then
+ if test ! -d "${GUI_ROOT_DIR}"; then
+ echo "failed : GUI_ROOT_DIR variable is not correct !"
+ exit
+ fi
fi
cd ${CONF_DIR}
ABS_CONF_DIR=`pwd`
+#######################################################################
+# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
+sed -e s/GEOM_WITH_GUI=[a-z]*/GEOM_WITH_GUI=${GEOM_WITH_GUI}/g configure.ac > configure.tmp
+mv -f configure.tmp configure.ac
+
mkdir -p salome_adm/unix/config_files
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
# autom4te.cache (directory)
echo "====================================================== aclocal"
-aclocal -I adm_local/unix/config_files \
- -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
- -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+if test ${GEOM_WITH_GUI} = yes; then
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+else
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
+fi
# ____________________________________________________________________
# libtoolize creates some configuration files (ltmain.sh,
CORBA=adm_local/unix/$corba
fi
+
echo
echo ---------------------------------------------
-echo testing openGL
+echo testing msg2qm
echo ---------------------------------------------
echo
-CHECK_OPENGL
+CHECK_MSG2QM
-echo
-echo ---------------------------------------------
-echo testing QT
-echo ---------------------------------------------
-echo
-CHECK_QT
+GEOM_WITH_GUI=yes
-echo
-echo ---------------------------------------------
-echo testing msg2qm
-echo ---------------------------------------------
-echo
+AM_CONDITIONAL(GEOM_ENABLE_GUI, [test "${GEOM_WITH_GUI}" = "yes"])
-CHECK_MSG2QM
+if test "${GEOM_WITH_GUI}" = "yes"; then
+ echo
+ echo ---------------------------------------------
+ echo testing openGL
+ echo ---------------------------------------------
+ echo
-echo
-echo ---------------------------------------------
-echo testing VTK
-echo ---------------------------------------------
-echo
+ CHECK_OPENGL
+
+ echo
+ echo ---------------------------------------------
+ echo testing QT
+ echo ---------------------------------------------
+ echo
+
+ CHECK_QT
-CHECK_VTK
+ echo
+ echo ---------------------------------------------
+ echo testing VTK
+ echo ---------------------------------------------
+ echo
+
+ CHECK_VTK
+
+ echo
+ echo ---------------------------------------------
+ echo Testing GUI
+ echo ---------------------------------------------
+ echo
+
+ CHECK_SALOME_GUI
+
+ echo
+ echo ---------------------------------------------
+ echo Testing full GUI
+ echo ---------------------------------------------
+ echo
+
+ CHECK_CORBA_IN_GUI
+ if test "x${CORBA_IN_GUI}" != "xyes"; then
+ echo "failed : For configure GEOM module necessary full GUI !"
+ exit
+ fi
+fi
echo
echo ---------------------------------------------
CHECK_HTML_GENERATORS
-echo
-echo ---------------------------------------------
-echo Testing GUI
-echo ---------------------------------------------
-echo
-
-CHECK_SALOME_GUI
-
-echo
-echo ---------------------------------------------
-echo Testing full GUI
-echo ---------------------------------------------
-echo
-
-CHECK_CORBA_IN_GUI
-if test "x${CORBA_IN_GUI}" != "xyes"; then
- echo "failed : For configure GEOM module necessary full GUI !"
- exit
-fi
-
echo
echo ---------------------------------------------
echo Testing Kernel
./src/GEOM_I/Makefile \
./src/GEOM_I_Superv/Makefile \
./src/GEOM_SWIG/Makefile \
+ ./src/GEOM_SWIG_WITHIHM/Makefile \
./src/GenerationGUI/Makefile \
./src/GroupGUI/Makefile \
./src/IGESExport/Makefile \
* \param theSeqSubBases - list of corresponding subshapes of section shapes.
* \param theLocations - list of locations on the path corresponding
* specified list of the Bases shapes. Number of locations
- * should be equal to number of bases or list of locations can be empty.
+ * should be equal to number of bases.
* \param thePath - Path shape to extrude the base shape along it.
* \param theWithContact - the mode defining that the section is translated to be in
* contact with the spine.
* Replace coincident faces in theShape by one face.
* \param theShape Initial shape.
* \param theTolerance Maximum distance between faces, which can be considered as coincident.
+ * \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
* \return New GEOM_Object, containing a copy of theShape without coincident faces.
*/
- GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance);
+ GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
/*!
* Find coincident faces in theShape for possible gluing.
* \param theShape Initial shape.
* \param theTolerance Maximum distance between faces, which can be considered as coincident.
* \param theFaces List of faces for gluing.
+ * \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
* \return New GEOM_Object, containing a copy of theShape without some faces.
*/
GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
- in ListOfGO theFaces);
+ in ListOfGO theFaces, in boolean doKeepNonSolids);
/*!
* Explode a shape on subshapes of a given type.
in shape_state theState);
/*!
- * Get sub-shape(s) of theShapeWhere, which are
+ * Get sub-shape(s) of \a theShapeWhere, which are
* coincident with \a theShapeWhat or could be a part of it.
* \param theShapeWhere Shape to find sub-shapes of.
* \param theShapeWhat Shape, specifying what to find.
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
in GEOM_Object theShapeWhat);
+ /*!
+ * Get sub-shape(s) of \a theShapeWhere, which are
+ * coincident with \a theShapeWhat or could be a part of it.
+ *
+ * Implementation of this method is based on a saved history of an operation,
+ * produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
+ * arguments (an argument shape or a sub-shape of an argument shape).
+ * The operation could be the Partition or one of boolean operations,
+ * performed on simple shapes (not on compounds).
+ *
+ * \param theShapeWhere Shape to find sub-shapes of.
+ * \param theShapeWhat Shape, specifying what to find.
+ * \return Group of all found sub-shapes or a single found sub-shape.
+ */
+ GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
+ in GEOM_Object theShapeWhat);
+
/*!
* Get sub-shape of theShapeWhere, which are
* coincident with \a theShapeWhat that can either SOLID, FACE, EDGE or VERTEX.
* \note Each compound from ListShapes and ListTools will be exploded in order
* to avoid possible intersection between shapes from this compound.
* \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+ # \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+ # type <= Limit are kept in the result,
+ # else - shapes with type > Limit are kept
+ # also (if they exist)
*
* After implementation new version of PartitionAlgo (October 2006)
* other parameters are ignored by current functionality. They are kept
in ListOfGO theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in ListOfLong theMaterials);
+ in ListOfLong theMaterials,
+ in short theKeepNonlimitShapes);
/*!
* Perform partition operation.
in ListOfGO theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in ListOfLong theMaterials);
+ in ListOfLong theMaterials,
+ in short theKeepNonlimitShapes);
/*!
* Perform partition of the Shape with the Plane
in GEOM_List theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in GEOM_List theMaterials) ;
+ in GEOM_List theMaterials,
+ in short theKeepNonlimitShapes);
GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
in GEOM_Object thePlane) ;
GEOM_Object MakeSolidShells (in GEOM_List theShells) ;
GEOM_Object MakeCompound (in GEOM_List theShapes) ;
GEOM_Object MakeGlueFaces (in GEOM_Object theShape,
- in double theTolerance);
+ in double theTolerance,
+ in boolean doKeepNonSolids);
GEOM_List GetGlueFaces (in GEOM_Object theShape,
in double theTolerance);
GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape,
in double theTolerance,
- in ListOfGO theFaces);
+ in ListOfGO theFaces,
+ in boolean doKeepNonSolids);
GEOM_List MakeExplode (in GEOM_Object theShape,
in long theShapeType,
in boolean isSorted) ;
</outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
+ <component-service>
+ <service-name>GetDumpName</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theStudyEntry</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>string</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetAllDumpNames</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list></inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>string_array</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
</component-service-list>
</component-interface-list>
<constraint>hostname = localhost</constraint>
<component-name>GEOM_Superv</component-name>
<component-username>GEOM_Superv</component-username>
<component-type>OTHER</component-type>
- <component-author>mkr</component-author>
+ <component-author></component-author>
<component-version>@VERSION@</component-version>
<component-comment>Supervision wrapper for Geometry component</component-comment>
<component-multistudy>1</component-multistudy>
- <component-impltype>1</component-impltype>
+ <component-impltype>1</component-impltype>
<component-icone></component-icone>
<constraint></constraint>
<component-interface-list>
<component-service-list>
<component-service>
<service-name>SetStudyID</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>CreateListOfGO</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list></inParameter-list>
</component-service>
<component-service>
<service-name>AddItemToListOfGO</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>CreateListOfLong</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list></inParameter-list>
</component-service>
<component-service>
<service-name>AddItemToListOfLong</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>CreateListOfDouble</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list></inParameter-list>
</component-service>
<component-service>
<service-name>AddItemToListOfDouble</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePointXYZ</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePointWithReference</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePointOnCurve</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theRefCurve</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameter</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeTangentOnCurve</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeVectorDXDYDZ</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeVectorTwoPnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeLineTwoPnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePlaneThreePnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePlanePntVec</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePlaneFace</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeMarker</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
+ <component-service>
+ <service-name>MakeTangentPlaneOnFace</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theFace</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameterU</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theParameterV</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTrimSize</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
<component-service>
<service-name>MakeBox</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeBoxDXDYDZ</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeBoxTwoPnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCylinderPntVecRH</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCylinderRH</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSphere</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSphereR</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSpherePntR</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeTorusPntVecRR</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeTorusRR</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeConePntVecR1R2H</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeConeR1R2H</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePrismVecH</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePrismTwoPnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePipe</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeRevolutionAxisAngle</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFilling</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</outParameter-list>
<DataStream-list></DataStream-list>
</component-service>
+ <component-service>
+ <service-name>MakeThruSections</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theSeqSections</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theModeSolid</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePreci</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theRuled</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeWithDifferentSections</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theSeqBases</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLocations</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithContact</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithCorrection</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakePipeWithShellSections</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theSeqBases</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theSeqSubBases</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theLocations</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>thePath</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithContact</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theWithCorrection</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
<component-service>
<service-name>MakeBoolean</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFuse</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakePartition</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
<inParameter-type>GEOM_List</inParameter-type>
<inParameter-comment>unknown</inParameter-comment>
</inParameter>
+ <inParameter>
+ <inParameter-name>theKeepNonlimitShapes</inParameter-name>
+ <inParameter-type>short</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
</inParameter-list>
<outParameter-list>
<outParameter>
</component-service>
<component-service>
<service-name>MakeHalfPartition</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>Export</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>Import</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>ImportTranslators</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list></inParameter-list>
</component-service>
<component-service>
<service-name>ExportTranslators</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list></inParameter-list>
</component-service>
<component-service>
<service-name>TranslateTwoPoints</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>TranslateTwoPointsCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>TranslateDXDYDZ</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>TranslateDXDYDZCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>TranslateVector</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>TranslateVectorCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MultiTranslate1D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MultiTranslate2D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>Rotate</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>RotateCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>RotateThreePoints</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>RotateThreePointsCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MultiRotate1D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MultiRotate2D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorPlane</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorPlaneCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorAxis</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorAxisCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorPoint</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MirrorPointCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>OffsetShape</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>OffsetShapeCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>ScaleShape</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>ScaleShapeCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>PositionShape</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>PositionShapeCopy</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeEdge</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeWire</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFace</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFaceWires</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeShell</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSolidShell</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSolidShells</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCompound</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeGlueFaces</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theShape</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>doKeepNonSolids</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_Object</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>GetGlueFaces</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
<inParameter-comment>unknown</inParameter-comment>
</inParameter>
</inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>GEOM_List</outParameter-type>
+ <outParameter-comment>unknown</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>MakeGlueFacesByList</service-name>
+ <service-author></service-author>
+ <service-version></service-version>
+ <service-comment>unknown</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>theShape</inParameter-name>
+ <inParameter-type>GEOM_Object</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theTolerance</inParameter-name>
+ <inParameter-type>double</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>theFaces</inParameter-name>
+ <inParameter-type>ListOfGO</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>doKeepNonSolids</inParameter-name>
+ <inParameter-type>boolean</inParameter-type>
+ <inParameter-comment>unknown</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
</component-service>
<component-service>
<service-name>MakeExplode</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>NumberOfFaces</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>NumberOfEdges</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>ChangeOrientation</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeQuad4Vertices</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeQuad</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeQuad2Edges</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeHexa</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeHexa2Faces</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetPoint</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetEdge</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetEdgeNearPoint</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetFaceByPoints</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetFaceByEdges</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetOppositeFace</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetFaceNearPoint</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetFaceByNormale</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>IsCompoundOfBlocks</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
+ <outParameter-type>boolean</outParameter-type>
<outParameter-comment>unknown</outParameter-comment>
</outParameter>
<outParameter>
</component-service>
<component-service>
<service-name>CheckCompoundOfBlocks</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
- <outParameter-type>long</outParameter-type>
+ <outParameter-type>boolean</outParameter-type>
<outParameter-comment>unknown</outParameter-comment>
</outParameter>
<outParameter>
</component-service>
<component-service>
<service-name>PrintBCErrors</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>ExplodeCompoundOfBlocks</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetBlockNearPoint</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetBlockByParts</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetBlocksByParts</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeMultiTransformation1D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeMultiTransformation2D</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCirclePntVecR</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeCircleThreePnt</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeEllipse</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeArc</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeArcCenter</service-name>
- <service-author>ngr</service-author>
- <service-version>3.2.6</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</outParameter>
</outParameter-list>
<DataStream-list></DataStream-list>
- </component-service> <component-service>
+ </component-service>
+ <component-service>
<service-name>MakePolyline</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSplineBezier</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSplineInterpolation</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeSketcher</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFilletAll</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFilletEdges</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeFilletFaces</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeChamferAll</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeChamferEdge</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeChamferFaces</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>MakeArchimede</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetSubShapeIndex</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>CreateGroup</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>AddObject</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>RemoveObject</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetType</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetMainShape</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
</component-service>
<component-service>
<service-name>GetObjects</service-name>
- <service-author>mkr</service-author>
- <service-version>2.1.0</service-version>
+ <service-author></service-author>
+ <service-version></service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include <qlabel.h>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <GC_MakeArcOfCircle.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Precision.hxx>
-
#include "GEOMImpl_Types.hxx"
#include "utilities.h"
-using namespace std;
-
//=================================================================================
// class : BasicGUI_ArcDlg()
// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
: GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER")));
+ QPixmap image2(aResMgr->loadPixmap("GEOM",tr("ICON_SELECT")));
setCaption(tr("GEOM_ARC_TITLE"));
Group3Pnts2->PushButton1->setPixmap(image2);
Group3Pnts2->PushButton2->setPixmap(image2);
Group3Pnts2->PushButton3->setPixmap(image2);
-
+
Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
Layout1->addWidget( Group3Pnts, 2, 0 );
Layout1->addWidget( Group3Pnts2, 2, 0 );
+ /***************************************************************/
setHelpFileName("arc.htm");
void BasicGUI_ArcDlg::Init()
{
/* init variables */
- // myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
-
- myConstructorId = -1;
myEditCurrentArgument = Group3Pnts->LineEdit1;
- myEditCurrentArgument->setFocus();
-
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
Group3Pnts2->radioButton4->setChecked(FALSE);
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
+
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
-
+
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(Group3Pnts->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
+
connect(Group3Pnts2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(Group3Pnts2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-
+
connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- initName( tr( "GEOM_ARC" ));
-
-
+ initName( tr( "GEOM_ARC" ));
ConstructorsClicked( 0 );
}
//=================================================================================
-// function : ClickOnOk()
-// purpose :
+// function : ConstructorsClicked()
+// purpose : Radio button management
//=================================================================================
-void BasicGUI_ArcDlg::ClickOnOk()
+void BasicGUI_ArcDlg::ConstructorsClicked (int constructorId)
{
- if ( ClickOnApply() )
- ClickOnCancel();
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ globalSelection( GEOM_POINT );
+
+ Group3Pnts->show();
+ resize(0, 0);
+ Group3Pnts2->hide();
+
+ Group3Pnts->LineEdit1->setText(Group3Pnts2->LineEdit1->text());
+ Group3Pnts->LineEdit2->setText(Group3Pnts2->LineEdit2->text());
+ Group3Pnts->LineEdit3->setText(Group3Pnts2->LineEdit3->text());
+
+ myEditCurrentArgument = Group3Pnts->LineEdit1;
+
+ break;
+ }
+ case 1:
+ {
+ globalSelection( GEOM_POINT );
+
+ Group3Pnts->hide();
+ resize(0, 0);
+ Group3Pnts2->show();
+
+ Group3Pnts2->LineEdit1->setText(Group3Pnts->LineEdit1->text());
+ Group3Pnts2->LineEdit2->setText(Group3Pnts->LineEdit2->text());
+ Group3Pnts2->LineEdit3->setText(Group3Pnts->LineEdit3->text());
+
+ myEditCurrentArgument = Group3Pnts2->LineEdit1;
+
+ break;
+ }
+ }
+
+ myEditCurrentArgument->setFocus();
+ connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+ this, SLOT(SelectionIntoArgument()));
+
+ if (CORBA::is_nil(myPoint1))
+ SelectionIntoArgument();
+
+ displayPreview();
}
+
//=================================================================================
-// function : ClickOnCancel()
+// function : ClickOnOk()
// purpose :
//=================================================================================
-void BasicGUI_ArcDlg::ClickOnCancel()
+void BasicGUI_ArcDlg::ClickOnOk()
{
- GEOMBase_Skeleton::ClickOnCancel();
+ if ( ClickOnApply() )
+ ClickOnCancel();
}
//=================================================================================
return false;
initName();
-
- // reset
- myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
- Group3Pnts->LineEdit1->setText( "" );
- Group3Pnts->LineEdit2->setText( "" );
- Group3Pnts->LineEdit3->setText( "" );
- Group3Pnts2->LineEdit1->setText( "" );
- Group3Pnts2->LineEdit2->setText( "" );
- Group3Pnts2->LineEdit3->setText( "" );
- if (getConstructorId() == 0) myEditCurrentArgument = Group3Pnts->LineEdit1;
- if (getConstructorId() == 1) myEditCurrentArgument = Group3Pnts2->LineEdit1;
-
- ConstructorsClicked( getConstructorId() );
return true;
}
{
if ((getConstructorId() != 0) && (getConstructorId() != 1))
return;
-
+
myEditCurrentArgument->setText("");
- if ( IObjectCount() != 1 ){
+
+ if ( IObjectCount() != 1 )
+ {
switch (getConstructorId())
{
- case 0:
- {
- if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
- return;
- break;
+ case 0:
+ {
+ if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
+ return;
+ break;
}
- case 1:
- {
+ case 1:
+ {
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = GEOM::GEOM_Object::_nil();
break;
}
}
- }
+ }
+
// nbSel == 1
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
}
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void BasicGUI_ArcDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if (send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
+ send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3)
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
+}
+
+
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void BasicGUI_ArcDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if ( send == Group3Pnts->LineEdit1 || send == Group3Pnts->LineEdit2 || send == Group3Pnts->LineEdit3 ||
- send == Group3Pnts2->LineEdit1 || send == Group3Pnts2->LineEdit2 || send == Group3Pnts2->LineEdit3 )
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
-}
-
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
void BasicGUI_ArcDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
- // myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
-
- myEditCurrentArgument = Group3Pnts->LineEdit1;
- myEditCurrentArgument->setFocus();
- Group3Pnts->LineEdit1->setText( "" );
- Group3Pnts->LineEdit2->setText( "" );
- Group3Pnts->LineEdit3->setText( "" );
- myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
-
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void BasicGUI_ArcDlg::DeactivateActiveDialog()
-{
- // myGeomGUI->SetState( -1 );
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
//=================================================================================
// function : enterEvent()
//=================================================================================
void BasicGUI_ArcDlg::enterEvent(QEvent* e)
{
- if ( !GroupConstructors->isEnabled() )
+ if (!GroupConstructors->isEnabled())
ActivateThisDialog();
}
+
//=================================================================================
// function : createOperation
// purpose :
switch (getConstructorId())
{
- case 0:
+ case 0:
+ {
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
{
- if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
- anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
- res = true;
- }
- break;
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+ MakeArc(myPoint1, myPoint2, myPoint3);
+ res = true;
}
- case 1:
- {
- bool Sense;
- (Group3Pnts2->radioButton4->isChecked()) ? Sense=true : Sense = false;
- if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) ){
- anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArcCenter(myPoint1, myPoint2, myPoint3,Sense);
- res = true;
- }
- break;
- }
- }
- if ( !anObj->_is_nil() ){
- objects.push_back( anObj._retn() );
- }
- return res;
-}
-
-//=================================================================================
-// function : closeEvent
-// purpose :
-//=================================================================================
-void BasicGUI_ArcDlg::closeEvent( QCloseEvent* e )
-{
- GEOMBase_Skeleton::closeEvent( e );
-}
-
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
-{
-
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
- switch (constructorId)
- {
- case 0:
- {
- Group3Pnts->show();
- resize(0, 0);
- Group3Pnts2->hide();
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
- case 1:
+ case 1:
{
- Group3Pnts->hide();
- resize(0, 0);
- Group3Pnts2->show();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+ bool Sense;
+ (Group3Pnts2->radioButton4->isChecked()) ? Sense = true : Sense = false;
+ if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
+ {
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
+ MakeArcCenter(myPoint1, myPoint2, myPoint3, Sense);
+ res = true;
+ }
break;
}
}
- displayPreview();
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+
+ return res;
}
//=================================================================================
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#ifndef DIALOGBOX_ARC_H
#define DIALOGBOX_ARC_H
-#include "GEOM_BasicGUI.hxx"
+#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_3Sel_QTD.h"
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual void closeEvent( QCloseEvent* e );
-
-private :
+private:
void Init();
void enterEvent(QEvent* e);
- int myConstructorId;
+
GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
DlgRef_3Sel_QTD* Group3Pnts;
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
-
+
void ActivateThisDialog();
- void DeactivateActiveDialog();
- void ConstructorsClicked( int );
+ void ConstructorsClicked(int);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
double aStep = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupPntVecR->SpinBox_DX->SetValue( 100 );
/* signals and slots connections */
double aMajorR( 200. ), aMinorR( 100. );
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
- GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 );
+ GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY );
GroupPoints->SpinBox_DX->SetValue( aMajorR );
GroupPoints->SpinBox_DY->SetValue( aMinorR );
for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter )
{
- anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 );
+ anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
connect( anIter.data(), SIGNAL( valueChanged( double ) ),
this, SLOT( onValueChanged( double ) ) );
}
double aTrimSize = 2000.0;
/* min, max, step and decimals for spin boxes */
- GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 );
+ GroupPntDir->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupPntDir->SpinBox_DX->SetValue( aTrimSize );
- Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
Group3Pnts->SpinBox_DX->SetValue( aTrimSize );
- GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3);
+ GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, DBL_DIGITS_DISPLAY);
GroupFace->SpinBox_DX->SetValue( aTrimSize );
/* signals and slots connections */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupXYZ->SpinBox_DX->SetValue(0.0);
GroupXYZ->SpinBox_DY->SetValue(0.0);
GroupXYZ->SpinBox_DZ->SetValue(0.0);
- GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupRefPoint->SpinBox_DX->SetValue(0.0);
GroupRefPoint->SpinBox_DY->SetValue(0.0);
GroupRefPoint->SpinBox_DZ->SetValue(0.0);
step = 0.1;
- GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, 3);
+ GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
/* signals and slots connections */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double dx( 0. ), dy( 0. ), dz( 200. );
GroupDimensions->SpinBox_DX->SetValue( dx );
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/****************************************************************************
+** Form implementation generated from reading ui file 'DlgRef_4Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:04 2006
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "DlgRef_2Sel1List1Check_QTD.h"
+
+#include <qvariant.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qradiobutton.h>
+
+/*
+ * Constructs a DlgRef_2Sel1List_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+DlgRef_2Sel1List1Check_QTD::DlgRef_2Sel1List1Check_QTD( QWidget* parent,
+ const char* name,
+ WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "DlgRef_2Sel1List1Check_QTD" );
+ resize( 129, 175 );
+ setCaption( trUtf8( "DlgRef_2Sel1List1Check_QTD" ) );
+ DlgRef_2Sel1List1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1List1Check_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ 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 );
+
+ 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" );
+
+ Layout1->addWidget( LineEdit1, 0, 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 );
+
+ 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" );
+
+ Layout1->addWidget( LineEdit2, 1, 2 );
+
+
+ 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() ) );
+
+ Layout1->addWidget( ComboBox1, 2, 2 );
+
+ radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
+ GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
+
+ GroupBox1Layout->addLayout( Layout1, 0, 0 );
+
+ DlgRef_2Sel1List1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+ QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer, 5, 2 );
+
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+DlgRef_2Sel1List1Check_QTD::~DlgRef_2Sel1List1Check_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/****************************************************************************
+** Form interface generated from reading ui file 'DlgRef_2Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:03 2006
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef DLGREF_2SEL1LIST_QTD_H
+#define DLGREF_2SEL1LIST_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class DlgRef_2Sel1List1Check_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DlgRef_2Sel1List1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~DlgRef_2Sel1List1Check_QTD();
+
+ QGroupBox* GroupBox1;
+ QLineEdit* LineEdit2;
+ QPushButton* PushButton1;
+ QPushButton* PushButton2;
+ QLabel* TextLabel1;
+ QLineEdit* LineEdit1;
+ QLabel* TextLabel2;
+ QComboBox* ComboBox1;
+ QLabel* TextLabel3;
+ QRadioButton* radioButton4;
+
+
+protected:
+ QGridLayout* DlgRef_2Sel1List1Check_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // DLGREF_2SEL1LIST1CHECK_QTD_H
/****************************************************************************
** Form implementation generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
-** Created: Fri Mar 17 11:18:06 2006
+** Created: Tue Mar 13 14:40:34 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
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() ) );
-
- 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->setColumnLayout(0, Qt::Vertical );
*/
void DlgRef_Skeleton_QTD::languageChange()
{
- setCaption( tr( "DlgRef_Skeleton_QTD" ) );
- GroupMedium->setTitle( QString::null );
- GroupButtons->setTitle( QString::null );
- buttonOk->setText( tr( "&Ok" ) );
- buttonApply->setText( tr( "&Apply" ) );
- buttonCancel->setText( tr( "&Cancel" ) );
- buttonHelp->setText( tr( "&Help" ) );
- GroupConstructors->setTitle( QString::null );
- RadioButton1->setText( QString::null );
- RadioButton2->setText( QString::null );
- RadioButton3->setText( QString::null );
- RadioButton4->setText( QString::null );
- GroupBoxName->setTitle( tr( "Result name" ) );
- NameLabel->setText( tr( "Name" ) );
}
/****************************************************************************
** Form interface generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
-** Created: Fri Mar 17 11:18:06 2006
+** Created: Tue Mar 13 14:40:29 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
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;
setLineStep(step);
((QDoubleValidator*)validator())->setRange(min, max, decimals);
}
+
+QString DlgRef_SpinBox::PrintDoubleValue (double theValue, int thePrecision)
+{
+ QString aRes;
+ aRes.setNum(theValue, 'g', thePrecision);
+
+ // remove trailing zeroes
+ QString delim( "." );
+
+ int idx = aRes.findRev( delim );
+ if ( idx == -1 )
+ return aRes;
+
+ QString iPart = aRes.left( idx );
+ QString fPart = aRes.mid( idx + 1 );
+
+ while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
+ fPart.remove( fPart.length() - 1, 1 );
+
+ aRes = iPart;
+ if ( !fPart.isEmpty() )
+ aRes += delim + fPart;
+
+ return aRes;
+}
#define COORD_MIN -1e+15
#define COORD_MAX +1e+15
#define MAX_NUMBER 100000
+#define DBL_DIGITS_DISPLAY 16
//=================================================================================
// class : DlgRef_SpinBox
void SetValue(double v);
double GetValue();
QString GetString();
+
+ static QString PrintDoubleValue (double theValue, int Precision = DBL_DIGITS_DISPLAY);
public slots:
void SetStep(double newStep);
-
};
#endif // GEOMSPINBOX_H
DlgRef_3Sel4Spin2Check_QTD.cxx \
DlgRef_4Sel1List_QTD.cxx \
DlgRef_2Sel1List_QTD.cxx \
+ DlgRef_2Sel1List1Check_QTD.cxx \
DlgRef_1List1Spin1Btn_QTD.cxx \
DlgRef_4Sel1List1Check_QTD.cxx \
DlgRef_1Spin_QTD.cxx \
DlgRef_3Sel4Spin2Check_QTD_moc.cxx \
DlgRef_4Sel1List_QTD_moc.cxx \
DlgRef_2Sel1List_QTD_moc.cxx \
+ DlgRef_2Sel1List1Check_QTD_moc.cxx \
DlgRef_1List1Spin1Btn_QTD_moc.cxx \
DlgRef_4Sel1List1Check_QTD_moc.cxx \
DlgRef_1Spin_QTD_moc.cxx \
DlgRef_3Sel4Spin2Check_QTD.h \
DlgRef_4Sel1List_QTD.h \
DlgRef_2Sel1List_QTD.h \
+ DlgRef_2Sel1List1Check_QTD.h \
DlgRef_1List1Spin1Btn_QTD.h \
DlgRef_4Sel1List1Check_QTD.h \
DlgRef_1Spin_QTD.h \
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="caption">
- <string>DlgRef_Skeleton_QTD</string>
- </property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<property name="spacing">
<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>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string></string>
- </property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>buttonOk</cstring>
</property>
- <property name="text">
- <string>&Ok</string>
- </property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonApply</cstring>
</property>
- <property name="text">
- <string>&Apply</string>
- </property>
</widget>
<spacer>
<property name="name">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
- <property name="text">
- <string>&Cancel</string>
- </property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonHelp</cstring>
</property>
- <property name="text">
- <string>&Help</string>
- </property>
</widget>
</hbox>
</widget>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string></string>
- </property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>RadioButton1</cstring>
</property>
- <property name="text">
- <string></string>
- </property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>RadioButton2</cstring>
</property>
- <property name="text">
- <string></string>
- </property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>RadioButton3</cstring>
</property>
- <property name="text">
- <string></string>
- </property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>RadioButton4</cstring>
</property>
- <property name="text">
- <string></string>
- </property>
</widget>
</hbox>
</widget>
<property name="name">
<cstring>GroupBoxName</cstring>
</property>
- <property name="title">
- <string>Result name</string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>NameLabel</cstring>
</property>
- <property name="text">
- <string>Name</string>
- </property>
</widget>
</grid>
</widget>
/****************************************************************************
** Form implementation generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
**
-** Created: Fri Mar 17 15:47:14 2006
+** Created: Tue Mar 13 14:04:48 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
#include <qvariant.h>
#include <qpushbutton.h>
-#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
+#include <qgroupbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
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() ) );
-
- 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->setColumnLayout(0, Qt::Vertical );
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->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->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 );
*/
void EntityGUI_Skeleton_QTD::languageChange()
{
- setCaption( tr( "EntityGUI_Skeleton_QTD" ) );
- GroupVal->setTitle( QString::null );
- GroupConstructors->setTitle( tr( "Element Type" ) );
- RadioButton1->setText( tr( "Segment" ) );
- RadioButton2->setText( tr( "Arc" ) );
- GroupDest->setTitle( tr( "Destination" ) );
- GroupDest1->setTitle( tr( "Type" ) );
- RB_Dest2->setText( tr( "Direction" ) );
- RB_Dest1->setText( tr( "Point" ) );
- GroupDest2->setTitle( QString::null );
- GroupDest3->setTitle( QString::null );
- GroupButtons->setTitle( QString::null );
- buttonEnd->setText( tr( "End Sketch" ) );
- buttonClose->setText( tr( "Close Sketch" ) );
- buttonCancel->setText( tr( "&Cancel" ) );
- buttonHelp->setText( tr( "&Help" ) );
}
/****************************************************************************
** Form interface generated from reading ui file 'EntityGUI_Skeleton_QTD.ui'
**
-** Created: Fri Mar 17 15:47:13 2006
+** Created: Tue Mar 13 14:04:42 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
-class QGroupBox;
class QButtonGroup;
class QRadioButton;
+class QGroupBox;
class QPushButton;
class GEOM_ENTITYGUI_EXPORT EntityGUI_Skeleton_QTD : public QDialog
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;
QButtonGroup* GroupDest1;
QRadioButton* RB_Dest2;
QRadioButton* RB_Dest1;
- QButtonGroup* GroupDest2;
- QButtonGroup* GroupDest3;
QGroupBox* GroupButtons;
QPushButton* buttonEnd;
QPushButton* buttonClose;
QGridLayout* Layout5;
QGridLayout* GroupDest1Layout;
QGridLayout* Layout4;
- QGridLayout* GroupDest2Layout;
- QGridLayout* GroupDest3Layout;
QHBoxLayout* GroupButtonsLayout;
QHBoxLayout* Layout3;
QSpacerItem* Spacer1;
buttonClose->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
buttonHelp->setText(tr("GEOM_BUT_HELP"));
- GroupVal->close(TRUE);
- GroupDest2->close(TRUE);
- GroupDest3->close(TRUE);
-
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_UNDO")));
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_REDO")));
Init();
}
-
//=================================================================================
// function : ~EntityGUI_SketcherDlg()
// purpose : Destroys the object and frees any allocated resources
myGeometryGUI->SetActiveDialogBox( 0 );
}
-
//=================================================================================
// function : eventFilter()
// purpose : event filter for spin-boxes to provide Apply action on Return pressed
}
}
+ if (event->type() == QEvent::KeyRelease) {
+ // NPAL16010 (Sketcher Apply non available if only one line is modified)
+ // To have Apply active as soon as value text changed
+ QString s = ((QtxDblSpinBox*) object)->text();
+ bool ok;
+ double newVal = s.toDouble( &ok );
+ if ( ok )
+ ValueChangedInSpinBox( newVal );
+ }
+
return EntityGUI_Skeleton_QTD::eventFilter(object, event);
}
double step = SUIT_Session::session()->resourceMgr()->doubleValue( "Geometry", "SettingsGeomStep", 100.0 );
/* min, max, step and decimals for spin boxes */
- Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
+ Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
/* displays Dialog */
GroupConstructors->setEnabled(false);
if ( constructorId == 1 )
{ // XY
mySketchType = PT_ABS;
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2"));
myX = 0.0;
else if ( constructorId == 0 )
{ // DXDY
mySketchType = PT_RELATIVE;
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2"));
Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2"));
myDX = 0.0;
myLength = 100.0;
if ( myConstructorDirId == 2 )
{ // Angle
- Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2"));
Group2Spin->SpinBox_DX->SetValue(myAngle);
Group2Spin->buttonApply->setFocus();
}
else if ( myConstructorDirId == 3 )
{ // DXDY
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2"));
Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2"));
myDX = 0.0;
{ // Angle
if ( constructorId == 2 )
{ // Length
- mySketchType = DIR_ANGLE_LENGTH;
- Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3);
- Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 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();
+ mySketchType = DIR_ANGLE_LENGTH;
+ Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ 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(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 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();
+ mySketchType = DIR_PER_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ 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(COORD_MIN, COORD_MAX, step, 3);
- Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 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();
+ mySketchType = DIR_TAN_LENGTH;
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., DBL_DIGITS_DISPLAY);
+ 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 )
myCommand.append( ":WW" );
}
else
+ {
+ // PAL16008 (Sketcher Validation should be equal to Apply&Close)
+ if (Group1Spin->buttonApply->isEnabled() && Group1Spin->isVisible() ||
+ Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ||
+ Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ||
+ Group4Spin->buttonApply->isEnabled() && Group4Spin->isVisible() ||
+ Group1Sel ->buttonApply->isEnabled() && Group1Sel->isVisible() )
+ {
+ ClickOnApply();
+ }
myIsAllAdded = true;
+ }
if( myCommand.size() > 2 )
if( !onAccept() )
//=================================================================================
bool EntityGUI_SketcherDlg::ClickOnApply()
{
- ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
+ if (sender() && sender()->inherits("QPushButton"))
+ ((QPushButton*)sender())->setFocus(); // to update value of currently edited spin-box (PAL11948)
myCommand.append( GetNewCommand() );
mySketchState = NEXT_POINT;
vz = Group4Spin->SpinBox_DZ->GetValue();
vs = newValue;
}
+ // NPAL16010 (Sketcher Apply non available if only one line is modified)
+ // if ValueChangedInSpinBox() called from eventFilter()
+ else if ( Group1Spin->SpinBox_DX->hasFocus() )
+ {
+ vx = newValue;
+ }
+ else if ( Group2Spin->SpinBox_DX ->hasFocus() )
+ {
+ vx = newValue;
+ vy = Group2Spin->SpinBox_DY->GetValue();
+ }
+ else if ( Group2Spin->SpinBox_DY->hasFocus() )
+ {
+ vx = Group2Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ }
+ else if ( Group3Spin->SpinBox_DX->hasFocus() )
+ {
+ vx = newValue;
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ }
+ else if ( Group3Spin->SpinBox_DY->hasFocus() )
+ {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group3Spin->SpinBox_DZ->GetValue();
+ }
+ else if ( Group3Spin->SpinBox_DZ->hasFocus() )
+ {
+ vx = Group3Spin->SpinBox_DX->GetValue();
+ vy = Group3Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ }
+ else if ( Group4Spin->SpinBox_DX->hasFocus() )
+ {
+ vx = newValue;
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if ( Group4Spin->SpinBox_DY->hasFocus() )
+ {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = newValue;
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if ( Group4Spin->SpinBox_DZ->hasFocus() )
+ {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = newValue;
+ vs = Group4Spin->SpinBox_DS->GetValue();
+ }
+ else if ( Group4Spin->SpinBox_DS->hasFocus() )
+ {
+ vx = Group4Spin->SpinBox_DX->GetValue();
+ vy = Group4Spin->SpinBox_DY->GetValue();
+ vz = Group4Spin->SpinBox_DZ->GetValue();
+ vs = newValue;
+ }
if ( myConstructorId == 0 )
{ // SEGMENT
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="caption">
- <string>EntityGUI_Skeleton_QTD</string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="spacing">
<number>6</number>
</property>
- <widget class="QGroupBox" row="2" column="0">
- <property name="name">
- <cstring>GroupVal</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="QButtonGroup" row="0" column="0">
<property name="name">
<cstring>GroupConstructors</cstring>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string>Element Type</string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>RadioButton1</cstring>
</property>
- <property name="text">
- <string>Segment</string>
- </property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>RadioButton2</cstring>
</property>
- <property name="text">
- <string>Arc</string>
- </property>
</widget>
</hbox>
</widget>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string>Destination</string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string>Type</string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>RB_Dest2</cstring>
</property>
- <property name="text">
- <string>Direction</string>
- </property>
</widget>
<widget class="QRadioButton" row="0" column="0">
<property name="name">
<cstring>RB_Dest1</cstring>
</property>
- <property name="text">
- <string>Point</string>
- </property>
</widget>
</grid>
</widget>
</grid>
</widget>
- <widget class="QButtonGroup" row="1" column="0">
- <property name="name">
- <cstring>GroupDest2</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>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>11</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- </grid>
- </widget>
- <widget class="QButtonGroup" row="1" column="1">
- <property name="name">
- <cstring>GroupDest3</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>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>11</number>
- </property>
- <property name="spacing">
- <number>6</number>
- </property>
- </grid>
- </widget>
</grid>
</widget>
</grid>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string></string>
- </property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>buttonEnd</cstring>
</property>
- <property name="text">
- <string>End Sketch</string>
- </property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonClose</cstring>
</property>
- <property name="text">
- <string>Close Sketch</string>
- </property>
</widget>
<spacer>
<property name="name">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
- <property name="text">
- <string>&Cancel</string>
- </property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonHelp</cstring>
</property>
- <property name="text">
- <string>&Help</string>
- </property>
</widget>
</hbox>
</widget>
Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
{
Handle(TDF_Reference) aRef;
- if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) return NULL;
+ if (!theLabel.FindAttribute(TDF_Reference::GetID(), aRef)) {
+ return NULL;
+ }
+
+ if(aRef.IsNull() || aRef->Get().IsNull()) {
+ return NULL;
+ }
+
// Get TreeNode of a referenced function
Handle(TDataStd_TreeNode) aT, aFather;
- if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) return NULL;
+ if (!TDataStd_TreeNode::Find(aRef->Get(), aT)) {
+ return NULL;
+ }
+
// Get TreeNode of Object of the referenced function
aFather = aT->Father();
- if (aFather.IsNull()) return NULL;
+ if (aFather.IsNull()) {
+ return NULL;
+ }
// Get label of the referenced object
TDF_Label aLabel = aFather->Label();
-
+
return GEOM_Object::GetObject(aLabel);
}
Standard_Integer aLength = aSeq.Length();
if(aLength > 0) {
anArray = new TColStd_HSequenceOfTransient;
- for(Standard_Integer j =1; j<=aLength; j++)
- anArray->Append(GetReferencedObject(aSeq(j)));
+ for(Standard_Integer j =1; j<=aLength; j++) {
+ Handle(GEOM_Object) aRefObj = GetReferencedObject(aSeq(j));
+ if(!aRefObj.IsNull()) anArray->Append(aRefObj);
+ }
}
return anArray;
TCollection_AsciiString aDescr;
if ( myAppend )
aDescr = myFunction->GetDescription() + "\n\t";
- aDescr += (char *)myStream.str().c_str();
+ std::string aString = myStream.str();
+ aDescr += (char *)aString.c_str();
myFunction->SetDescription( aDescr );
}
}
-// TPythonDump::operator TCollection_AsciiString () const
-// {
-// if (myCounter == 1) {
-// return TCollection_AsciiString ((char *)myStream.str().c_str());
-// }
-// return TCollection_AsciiString ();
-// }
-
TPythonDump& TPythonDump::operator<< (long int theArg)
{
myStream<<theArg;
MapOfShape from TopTools,
Image from BRepAlgo,
- DSFiller from NMTTools,
- PDSFiller from NMTTools
+ PaveFiller from NMTTools,
+ PPaveFiller from NMTTools
--raises
is redefined;
PerformWithFiller(me:out;
- theDSF: DSFiller from NMTTools)
- ---Purpose: Performs calculations using prepared DSFiller
+ theDSF: PaveFiller from NMTTools)
+ ---Purpose: Performs calculations using prepared PaveFiller
-- object theDSF
is virtual;
--
-- protected methods
--
- --
PerformInternal(me:out;
- theDSF: DSFiller from NMTTools)
+ theDSF: PaveFiller from NMTTools)
---Purpose: Performs calculations using prepared DSFiller
-- object theDSF
- is protected;
- --
+ is virtual protected;
+
PrepareHistory (me:out)
---Purpose: Prepare information for history support
is redefined protected;
-- =====================================================
fields
- myDSFiller : PDSFiller from NMTTools is protected;
+ myPaveFiller : PPaveFiller from NMTTools is protected;
myShapes : ListOfShape from TopTools is protected;
-- Common usage
myNbTypes : Integer from Standard is protected;
mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
-- solids
myDraftSolids : IndexedDataMapOfShapeShape from TopTools is protected;
- myEntryPoint : Integer from Standard is protected;
+ myEntryPoint : Integer from Standard is protected;
--
end Builder;
#include <BOP_CorrectTolerances.hxx>
-#include <NMTTools_DSFiller.hxx>
-
#include <BRepLib.hxx>
+#include <NMTTools_PaveFiller.hxx>
//=======================================================================
//function :
GEOMAlgo_BuilderShape()
{
myNbTypes=9;
- myDSFiller=NULL;
+ myPaveFiller=NULL;
myEntryPoint=0; // Entry point through PerformWithFiller ()
}
//=======================================================================
GEOMAlgo_Builder::~GEOMAlgo_Builder()
{
if (myEntryPoint==1) {
- if (myDSFiller) {
- delete myDSFiller;
- myDSFiller=NULL;
+ if (myPaveFiller) {
+ delete myPaveFiller;
+ myPaveFiller=NULL;
}
}
}
aBB.Add(aCS, aS);
}
//
- if (myDSFiller) {
- delete myDSFiller;
- myDSFiller=NULL;
- }
- NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
+ NMTTools_PaveFiller* pPF=new NMTTools_PaveFiller;
//
- pDSF->SetCompositeShape(aCS);
- pDSF->Perform();
+ pPF->SetCompositeShape(aCS);
+ pPF->Perform();
//
myEntryPoint=1;
- PerformInternal(*pDSF);
+ PerformInternal(*pPF);
}
//=======================================================================
//function : PerformWithFiller
//purpose :
//=======================================================================
- void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
+ void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_PaveFiller& theDSF)
{
myEntryPoint=0;
//
//function : PerformInternal
//purpose :
//=======================================================================
- void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
+ void GEOMAlgo_Builder::PerformInternal(const NMTTools_PaveFiller& pPF)
{
myErrorStatus=0;
//
Standard_Boolean bIsDone;
//
- // 0. myDSFiller
- myDSFiller=(NMTTools_DSFiller *)&theDSF;
+ // 0. myPaveFiller
+ myPaveFiller=(NMTTools_PaveFiller *)&pPF;
//
- bIsDone=myDSFiller->IsDone();
+ bIsDone=myPaveFiller->IsDone();
if (!bIsDone) {
- myErrorStatus=2; // DSFiller is failed
+ myErrorStatus=2; // PaveFiller is failed
return;
}
//
//
// 0 - Ok
// 1 - The object is just initialized
-// 2 - DSFiller is failed
+// 2 - PaveFiller is failed
// 10 - No shapes to process
// 30 - SolidBuilder failed
#ifndef _GEOMAlgo_Builder_HeaderFile
#define _GEOMAlgo_Builder_HeaderFile
-#ifndef _NMTTools_PDSFiller_HeaderFile
-#include <NMTTools_PDSFiller.hxx>
+#ifndef _NMTTools_PPaveFiller_HeaderFile
+#include <NMTTools_PPaveFiller.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
-class NMTTools_DSFiller;
+class NMTTools_PaveFiller;
class TopoDS_Shape;
class TopTools_ListOfShape;
class BRepAlgo_Image;
//! Performs calculations <br>
Standard_EXPORT virtual void Perform() ;
-//! Performs calculations using prepared DSFiller <br>
+//! Performs calculations using prepared PaveFiller <br>
//! object theDSF <br>
-Standard_EXPORT virtual void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
//! Adds argument theShape of the operation <br>
Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
//! Performs calculations using prepared DSFiller <br>
//! object theDSF <br>
-Standard_EXPORT void PerformInternal(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
//! Prepare information for history support <br>
Standard_EXPORT virtual void PrepareHistory() ;
// Fields PROTECTED
//
-NMTTools_PDSFiller myDSFiller;
+NMTTools_PPaveFiller myPaveFiller;
TopTools_ListOfShape myShapes;
Standard_Integer myNbTypes;
TopTools_MapOfShape myMapFence;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#ifndef _NMTTools_DSFiller_HeaderFile
-#include <NMTTools_DSFiller.hxx>
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#include <GEOMAlgo_Builder.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
+//#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <IntTools_Context.hxx>
#include <TopoDS_Shape.hxx>
//
#include <NMTDS_ShapesDataStructure.hxx>
//
-#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
//
Standard_Integer i, aNb, iV;
//
myImages.Bind(aV, aVSD);
//
mySameDomainShapes.Add(aV, aVSD);
- //
}
}
}
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
IntTools_Context& aCtx=pPF->ChangeContext();
TopTools_MapOfShape aMS;
TopTools_MapIteratorOfMapOfShape aItS;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
aNbS=aDS.NumberOfShapesOfTheObject();
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_SequenceOfCurves.hxx>
#include <BOPTools_CArray1OfESInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
+#include <NMTDS_InterfPool.hxx>
static
void UpdateCandidates(const Standard_Integer ,
//=======================================================================
void GEOMAlgo_Builder::FillIn2DParts()
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
- BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
+ NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
//
//=======================================================================
void GEOMAlgo_Builder::BuildSplitFaces()
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
- BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
+ NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
IntTools_Context& aCtx= pPF->ChangeContext();
//
//=======================================================================
void GEOMAlgo_Builder::FillSameDomainFaces()
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
- BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
+ NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
IntTools_Context& aCtx= pPF->ChangeContext();
//
TopTools_ListOfShape aLFx;
TopTools_ListIteratorOfListOfShape aIt;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
//
aNb=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNb; ++i) {
//=======================================================================
void GEOMAlgo_Builder::FillInternalVertices()
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
- BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
+ NMTDS_InterfPool* pIP=pPF->IP();
IntTools_Context& aCtx= pPF->ChangeContext();
//
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
#include <IntTools_Context.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Boolean bToReverse;
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Boolean bIsIN, bHasImage;
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Integer i, aNbS, iErr;
{
myErrorStatus=0;
//
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
//Standard_Boolean bHasImage;
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_PaveFiller.hxx>
-#include <NMTTools_DSFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bHasImage, bToReverse;
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
{
- const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
- NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+ const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+ NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bHasImage, bToReverse;
#include <Poly_Triangle.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
+#include <Poly_Polygon3D.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
aLP.Clear();
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
if (aTRE.IsNull() || aPTE.IsNull()) {
- myErrorStatus=20; // no triangulation found
- return;
+ Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
+ if (aPE.IsNull()) {
+ myErrorStatus=20; // no triangulation found
+ return;
+ }
+ const gp_Trsf& aTrsf=aLoc.Transformation();
+ const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
+ //
+ aNbNodes=aPE->NbNodes();
+ Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
+ for (j=low+1; j<up; ++j) {
+ aP=aNodes(j).Transformed(aTrsf);
+ aLP.Append(aP);
+ }
}
- //
- const gp_Trsf& aTrsf=aLoc.Transformation();
- const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
- //
- aNbNodes=aPTE->NbNodes();
- const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
- for (j=2; j<aNbNodes; ++j) {
- aIndex=aInds(j);
- aP=aNodes(aIndex).Transformed(aTrsf);
- aLP.Append(aP);
+ else {
+ const gp_Trsf& aTrsf=aLoc.Transformation();
+ const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
+ //
+ aNbNodes=aPTE->NbNodes();
+ const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
+ for (j=2; j<aNbNodes; ++j) {
+ aIndex=aInds(j);
+ aP=aNodes(aIndex).Transformed(aTrsf);
+ aLP.Append(aP);
+ }
}
//
aNb=aLP.Extent();
// try to fill it yourself
InnerPoints(aE, myNbPntsMin, aLP);
aNb=aLP.Extent();
-
}
}
//=======================================================================
#include <Poly_Triangle.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
+#include <Poly_Polygon3D.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
aLP.Clear();
BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
if (aTRE.IsNull() || aPTE.IsNull()) {
- myErrorStatus=20; // no triangulation found
- return;
+ Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
+ if (aPE.IsNull()) {
+ myErrorStatus=20; // no triangulation found
+ return;
+ }
+ const gp_Trsf& aTrsf=aLoc.Transformation();
+ const TColgp_Array1OfPnt& aNodes=aPE->Nodes();
+ //
+ aNbNodes=aPE->NbNodes();
+ Standard_Integer low = aNodes.Lower(), up = aNodes.Upper();
+ for (j=low+1; j<up; ++j) {
+ aP=aNodes(j).Transformed(aTrsf);
+ aLP.Append(aP);
+ }
}
- //
- const gp_Trsf& aTrsf=aLoc.Transformation();
- const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
- //
- aNbNodes=aPTE->NbNodes();
- const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
- for (j=2; j<aNbNodes; ++j) {
- aIndex=aInds(j);
- aP=aNodes(aIndex).Transformed(aTrsf);
- aLP.Append(aP);
+ else {
+ const gp_Trsf& aTrsf=aLoc.Transformation();
+ const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
+ //
+ aNbNodes=aPTE->NbNodes();
+ const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
+ for (j=2; j<aNbNodes; ++j) {
+ aIndex=aInds(j);
+ aP=aNodes(aIndex).Transformed(aTrsf);
+ aLP.Append(aP);
+ }
}
//
aNb=aLP.Extent();
// try to fill it yourself
InnerPoints(aE, myNbPntsMin, aLP);
aNb=aLP.Extent();
-
}
}
//=======================================================================
// 30- can not obtain the line from the link
// 40- point can not be classified
// 41- invalid data for classifier
-
myTolerance=0.0001;
myTol=myTolerance;
myCheckGeometry=Standard_True;
+ myKeepNonSolids=Standard_False;
myNbAlone=0;
}
//=======================================================================
return myCheckGeometry;
}
//=======================================================================
+//function : SetKeepNonSolids
+//purpose :
+//=======================================================================
+void GEOMAlgo_Gluer::SetKeepNonSolids(const Standard_Boolean aFlag)
+{
+ myKeepNonSolids=aFlag;
+}
+//=======================================================================
//function : AloneShapes
//purpose :
//=======================================================================
}
}
//=======================================================================
-//function : MakeSolids
+//function : MakeSubShapes
//purpose :
//=======================================================================
-void GEOMAlgo_Gluer::MakeSolids()
+void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape& theShape,
+ TopTools_MapOfShape& theMS,
+ TopoDS_Compound& theResult)
{
- myErrorStatus=0;
+ if (theMS.Contains(theShape))
+ return;
//
- Standard_Integer aNbS;
- TopAbs_Orientation anOr;
- TopoDS_Compound aCmp;
- TopoDS_Solid aNewSolid;
- TopTools_IndexedMapOfShape aMS;
- TopExp_Explorer aExpS, aExp;
BRep_Builder aBB;
//
- aBB.MakeCompound(aCmp);
+ theMS.Add(theShape);
//
- aNbS=aMS.Extent();
- aExpS.Init(myShape, TopAbs_SOLID);
- for (; aExpS.More(); aExpS.Next()) {
- const TopoDS_Solid& aSolid=TopoDS::Solid(aExpS.Current());
- if (aMS.Contains(aSolid)) {
- continue;
+ if (theShape.ShapeType() == TopAbs_COMPOUND ||
+ theShape.ShapeType() == TopAbs_COMPSOLID)
+ {
+ TopoDS_Iterator It (theShape, Standard_True, Standard_True);
+ for (; It.More(); It.Next())
+ {
+ MakeSubShapes(It.Value(), theMS, theResult);
}
- aMS.Add(aSolid);
+ }
+ else if (theShape.ShapeType() == TopAbs_SOLID)
+ {
+ // build a solid
+ TopoDS_Solid aNewSolid;
+ TopExp_Explorer aExpS, aExp;
+ //
+ const TopoDS_Solid& aSolid = TopoDS::Solid(theShape);
//
- anOr=aSolid.Orientation();
+ TopAbs_Orientation anOr = aSolid.Orientation();
//
aBB.MakeSolid(aNewSolid);
aNewSolid.Orientation(anOr);
//
aExp.Init(aSolid, TopAbs_SHELL);
- for (; aExp.More(); aExp.Next()) {
+ for (; aExp.More(); aExp.Next())
+ {
const TopoDS_Shape& aShell=aExp.Current();
const TopoDS_Shape& aShellR=myOrigins.Find(aShell);
aBB.Add(aNewSolid, aShellR);
myImages.Bind(aNewSolid, aLS);
myOrigins.Bind(aSolid, aNewSolid);
//
- aBB.Add(aCmp, aNewSolid);
+ aBB.Add(theResult, aNewSolid);
+ }
+ else if (theShape.ShapeType() == TopAbs_WIRE)
+ {
+ if (myKeepNonSolids)
+ {
+ // just add image
+ if (!myOrigins.IsBound(theShape))
+ {
+ // build wire
+ const TopoDS_Wire& aW=TopoDS::Wire(theShape);
+ //
+ TopoDS_Wire newWire;
+ aBB.MakeWire(newWire);
+ //
+ TopExp_Explorer aExpE (aW, TopAbs_EDGE);
+ for (; aExpE.More(); aExpE.Next()) {
+ const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
+ TopoDS_Edge aER=TopoDS::Edge(myOrigins.Find(aE));
+ //
+ aER.Orientation(TopAbs_FORWARD);
+ if (!BRep_Tool::Degenerated(aER)) {
+ // build p-curve
+ //if (bIsUPeriodic) {
+ // GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+ //}
+ //BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+ //
+ // orient image
+ Standard_Boolean bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+ if (bIsToReverse) {
+ aER.Reverse();
+ }
+ }
+ else {
+ aER.Orientation(aE.Orientation());
+ }
+ //
+ aBB.Add(newWire, aER);
+ }
+ // xf
+ TopTools_ListOfShape aLW;
+ //
+ aLW.Append(aW);
+ myImages.Bind(newWire, aLW);
+ myOrigins.Bind(aW, newWire);
+ }
+ const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
+ aBB.Add(theResult, aShapeR);
+ }
}
+ else
+ {
+ if (myKeepNonSolids)
+ {
+ // just add image
+ const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
+ aBB.Add(theResult, aShapeR);
+ }
+ }
+}
+//=======================================================================
+//function : MakeSolids
+//purpose :
+//=======================================================================
+void GEOMAlgo_Gluer::MakeSolids()
+{
+ myErrorStatus=0;
+ //
+ BRep_Builder aBB;
+ TopoDS_Compound aCmp;
+ TopTools_MapOfShape aMS;
+ //
+ aBB.MakeCompound(aCmp);
+ //
+ // Add images of all initial sub-shapes in the result.
+ // If myKeepNonSolids==false, add only solids images.
+ MakeSubShapes(myShape, aMS, aCmp);
//
myResult=aCmp;
//
- aNbS=aMS.Extent();
- if (aNbS) {
- Standard_Real aTol=1.e-7;
+ if (aMS.Extent()) {
BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
}
}
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
+#ifndef _TopTools_MapOfShape_HeaderFile
+#include <TopTools_MapOfShape.hxx>
+#endif
#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
#include <GEOMAlgo_ShapeAlgo.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
+#ifndef _TopoDS_Compound_HeaderFile
+#include <TopoDS_Compound.hxx>
+#endif
class TopTools_ListOfShape;
class TopoDS_Shape;
class TopoDS_Edge;
Standard_EXPORT Standard_Boolean CheckGeometry() const;
+Standard_EXPORT void SetKeepNonSolids(const Standard_Boolean aFlag) ;
+
+
Standard_EXPORT virtual void Perform() ;
Standard_EXPORT void MakeShells() ;
+Standard_EXPORT void MakeSubShapes(const TopoDS_Shape& theShape,
+ TopTools_MapOfShape& theMS,
+ TopoDS_Compound& theResult);
+
+
Standard_EXPORT void MakeSolids() ;
// Fields PROTECTED
//
Standard_Boolean myCheckGeometry;
+Standard_Boolean myKeepNonSolids;
Standard_Real myTol;
TopTools_DataMapOfShapeListOfShape myImages;
TopTools_DataMapOfShapeShape myOrigins;
aF=TopoDS::Face(aS);
//
aNbWires=NbWires(aF);
- if (aNbWires>1) {
- return;
- }
//
aSurf=BRep_Tool::Surface(aF);
GeomAdaptor_Surface aGAS(aSurf);
aInfo.SetLocation(aP0);
aInfo.SetPosition(aAx3);
//
+ if (aNbWires>1) return;
+ //
//aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin);
aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aR1);
//
+ if (aNbWires>1) return;
+ //
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
//
aInfo.SetPosition(aAx3);
aInfo.SetRadius1(aR1);
//
+ if (aNbWires>1) return;
+ //
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin);
bInfU2=Precision::IsPositiveInfinite(aUMax);
aInfo.SetPosition(aAx3);
//aInfo.SetRadius1(aR1);
//
+ if (aNbWires>1) return;
+ //
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
bInfU1=Precision::IsNegativeInfinite(aUMin);
bInfU2=Precision::IsPositiveInfinite(aUMax);
aInfo.SetRadius1(aR1);
aInfo.SetRadius2(aR2);
//
+ if (aNbWires>1) return;
+ //
aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-
+ //
FillDetails(aF, aTorus);
}
}
Limit(me)
returns ShapeEnum from TopAbs;
+
+ SetLimitMode(me:out;
+ aLimitMode:Integer from Standard);
+
+ LimitMode(me)
+ returns Integer from Standard;
+
--
-- Protected methods
--
myTools : ListOfShape from TopTools is protected;
myMapTools : MapOfShape from TopTools is protected;
myLimit : ShapeEnum from TopAbs is protected;
+ myLimitMode : Integer from Standard is protected;
+
end Splitter;
#include <BOP_CorrectTolerances.hxx>
-#include <NMTTools_DSFiller.hxx>
+
+static
+ void TreatCompound(const TopoDS_Shape& aC,
+ TopTools_ListOfShape& aLSX);
//=======================================================================
//function :
GEOMAlgo_Builder()
{
myLimit=TopAbs_SHAPE;
+ myLimitMode=0;
}
//=======================================================================
//function : ~
return myLimit;
}
//=======================================================================
+//function : SetLimitMode
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode)
+{
+ myLimitMode=aMode;
+}
+//=======================================================================
+//function : LimitMode
+//purpose :
+//=======================================================================
+ Standard_Integer GEOMAlgo_Splitter::LimitMode()const
+{
+ return myLimitMode;
+}
+//=======================================================================
//function : Clear
//purpose :
//=======================================================================
Standard_Integer i, aNbS;
BRep_Builder aBB;
TopoDS_Compound aC;
- TopTools_IndexedMapOfShape aM;
+ TopTools_IndexedMapOfShape aMx;
//
aBB.MakeCompound(aC);
//
- TopExp::MapShapes(myShape, myLimit, aM);
- aNbS=aM.Extent();
+ TopExp::MapShapes(myShape, myLimit, aMx);
+ aNbS=aMx.Extent();
for (i=1; i<=aNbS; ++i) {
- const TopoDS_Shape& aS=aM(i);
+ const TopoDS_Shape& aS=aMx(i);
aBB.Add(aC, aS);
}
+ //modified by NIZNHY-PKV Thu Feb 15 17:09:32 2007f
+ if (myLimitMode) {
+ Standard_Integer iType, iLimit, iTypeX;
+ TopAbs_ShapeEnum aType, aTypeX;
+ TopTools_ListOfShape aLSP, aLSX;
+ TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;
+ TopTools_MapOfShape aM;
+ //
+ iLimit=(Standard_Integer)myLimit;
+ //
+ // 1. Collect the shapes to process aLSP
+ aIt.Initialize(myShapes);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if (myMapTools.Contains(aS)) {
+ continue;
+ }
+ //
+ aType=aS.ShapeType();
+ iType=(Standard_Integer)aType;
+ //
+ if (iType>iLimit) {
+ aLSP.Append(aS);
+ }
+ //
+ else if (aType==TopAbs_COMPOUND) {
+ aLSX.Clear();
+ //
+ TreatCompound(aS, aLSX);
+ //
+ aItX.Initialize(aLSX);
+ for (; aItX.More(); aItX.Next()) {
+ const TopoDS_Shape& aSX=aItX.Value();
+ aTypeX=aSX.ShapeType();
+ iTypeX=(Standard_Integer)aTypeX;
+ //
+ if (iTypeX>iLimit) {
+ aLSP.Append(aSX);
+ }
+ }
+ }
+ }// for (; aIt.More(); aIt.Next()) {
+ //
+ // 2. Add them to aC
+ aIt.Initialize(aLSP);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if (myImages.HasImage(aS)) {
+ const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+ aItIm.Initialize(aLSIm);
+ for (; aItIm.More(); aItIm.Next()) {
+ const TopoDS_Shape& aSIm=aItIm.Value();
+ if (aM.Add(aSIm)) {
+ aBB.Add(aC, aSIm);
+ }
+ }
+ }
+ else {
+ if (aM.Add(aS)) {
+ aBB.Add(aC, aS);
+ }
+ }
+ }
+ }// if (myLimitMode) {
+ //modified by NIZNHY-PKV Thu Feb 15 17:09:34 2007t
myShape=aC;
- }
+ }//if (myLimit!=TopAbs_SHAPE) {
//
GEOMAlgo_Builder::PostTreat();
+}
+//=======================================================================
+//function : TreatCompound
+//purpose :
+//=======================================================================
+void TreatCompound(const TopoDS_Shape& aC1,
+ TopTools_ListOfShape& aLSX)
+{
+ Standard_Integer aNbC1;
+ TopAbs_ShapeEnum aType;
+ TopTools_ListOfShape aLC, aLC1;
+ TopTools_ListIteratorOfListOfShape aIt, aIt1;
+ TopoDS_Iterator aItC;
//
+ aLC.Append (aC1);
+ while(1) {
+ aLC1.Clear();
+ aIt.Initialize(aLC);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aC=aIt.Value(); //C is compound
+ //
+ aItC.Initialize(aC);
+ for (; aItC.More(); aItC.Next()) {
+ const TopoDS_Shape& aS=aItC.Value();
+ aType=aS.ShapeType();
+ if (aType==TopAbs_COMPOUND) {
+ aLC1.Append(aS);
+ }
+ else {
+ aLSX.Append(aS);
+ }
+ }
+ }
+ //
+ aNbC1=aLC1.Extent();
+ if (!aNbC1) {
+ break;
+ }
+ //
+ aLC.Clear();
+ aIt.Initialize(aLC1);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSC=aIt.Value();
+ aLC.Append(aSC);
+ }
+ }// while(1)
}
//
// myErrorStatus
//
// 0 - Ok
// 1 - The object is just initialized
-// 2 - DSFiller is failed
+// 2 - PaveFiller is failed
// 10 - No shapes to process
// 30 - SolidBuilder failed
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
#ifndef _GEOMAlgo_Builder_HeaderFile
#include <GEOMAlgo_Builder.hxx>
#endif
Standard_EXPORT TopAbs_ShapeEnum Limit() const;
+
+Standard_EXPORT void SetLimitMode(const Standard_Integer aLimitMode) ;
+
+
+Standard_EXPORT Standard_Integer LimitMode() const;
+
//! Adds Tool arguments of the operation as <br>
//! shapes of upper level of container shape theShape <br>
//! ===================================================== <br>
TopTools_ListOfShape myTools;
TopTools_MapOfShape myMapTools;
TopAbs_ShapeEnum myLimit;
+Standard_Integer myLimitMode;
private:
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
+#include <qlabel.h>
#include <qpushbutton.h>
using namespace std;
if (!name)
setName("GEOMBase_Skeleton");
+ GroupBoxName->setTitle(tr("GEOM_RESULT_NAME_GRP"));
+ NameLabel->setText(tr("GEOM_RESULT_NAME_LBL"));
+
buttonCancel->setText(tr("GEOM_BUT_CLOSE"));
buttonOk->setText(tr("GEOM_BUT_OK"));
buttonApply->setText(tr("GEOM_BUT_APPLY"));
buttonHelp->setText(tr("GEOM_BUT_HELP"));
- GroupMedium->close(TRUE);
resize(0, 0);
Init();
TopExp::MapShapes(aMainShape, anIndices);
/* Case of only one subshape */
- if (list->length() == 1) {
+ if (list->length() == 1 && list[0] > 0) {
S = anIndices.FindKey(list[0]);
}
else {
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Reconstruction Limit"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Suppress Result"
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Limite de Reconstruction"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Supprimer le Resultat"
return GEOM::GEOM_Object::_nil();
}
-QString GEOMGUI_Selection:: selectionMode() const
-{
+QString GEOMGUI_Selection::selectionMode() const
+{
SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
- if(aGeomGUI)
- switch(aGeomGUI->getLocalSelectionMode())
- {
+ if (aGeomGUI) {
+ switch (aGeomGUI->getLocalSelectionMode())
+ {
case GEOM_POINT : return "VERTEX";
case GEOM_EDGE : return "EDGE";
case GEOM_WIRE : return "WIRE";
case GEOM_COMPOUND : return "COMPOUND";
case GEOM_ALLOBJECTS : return "ALL";
default: return "";
- }
+ }
+ }
}
+ return "";
}
#include <gp_Pln.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TopoDS_Iterator.hxx>
// VTK Includes
#include <vtkActorCollection.h>
Handle(GEOM_AISShape) AISShape;
if (myType == GEOM_VECTOR)
AISShape = new GEOM_AISVector (myShape, "");
- else
+ else {
+ if (myShape.ShapeType() != TopAbs_VERTEX && // fix pb with not displayed points
+ !TopoDS_Iterator(myShape).More())
+ return;// NPAL15983 (Bug when displaying empty groups)
AISShape = new GEOM_AISShape (myShape, "");
+ }
// Temporary staff: vertex must be infinite for correct visualization
AISShape->SetInfiniteState( myShape.Infinite() || myShape.ShapeType() == TopAbs_VERTEX );
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Reconstruction Limit"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Suppress Result"
msgid "NAME_LBL"
msgstr "Name: "
+msgid "GEOM_RESULT_NAME_GRP"
+msgstr "Result name"
+
+msgid "GEOM_RESULT_NAME_LBL"
+msgstr "Name"
+
msgid "GEOM_ERR_GET_ENGINE"
msgstr "Failed to obtain GEOM Engine component. Reload Geometry module and try again."
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Limite de Reconstruction"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Supprimer le Resultat"
#include <TopExp.hxx>
#include <GC_MakeArcOfCircle.hxx>
+#include <GC_MakeCircle.hxx>
#include <Standard_ConstructionError.hxx>
#include <Precision.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
-#include <gce_MakeCirc.hxx>
-#include <gce_MakePln.hxx>
-#include <ElCLib.hxx>
+#include <gp_Circ.hxx>
#include <Geom_Circle.hxx>
-#include <Geom_TrimmedCurve.hxx>
-
#include "utilities.h"
+
//=======================================================================
//function : GetID
//purpose :
Standard_Integer aType = aFunction->GetType();
TopoDS_Shape aShape;
- if ((aType == CIRC_ARC_THREE_PNT)||(aType == CIRC_ARC_CENTER)) {
+ if ((aType == CIRC_ARC_THREE_PNT) || (aType == CIRC_ARC_CENTER))
+ {
Handle(GEOM_Function) aRefPoint1 = aCI.GetPoint1();
Handle(GEOM_Function) aRefPoint2 = aCI.GetPoint2();
Handle(GEOM_Function) aRefPoint3 = aCI.GetPoint3();
+
TopoDS_Shape aShapePnt1 = aRefPoint1->GetValue();
TopoDS_Shape aShapePnt2 = aRefPoint2->GetValue();
TopoDS_Shape aShapePnt3 = aRefPoint3->GetValue();
+
if (aShapePnt1.ShapeType() == TopAbs_VERTEX &&
aShapePnt2.ShapeType() == TopAbs_VERTEX &&
- aShapePnt3.ShapeType() == TopAbs_VERTEX) {
+ aShapePnt3.ShapeType() == TopAbs_VERTEX)
+ {
gp_Pnt aP1 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt1));
gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt2));
gp_Pnt aP3 = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt3));
+
if (aP1.Distance(aP2) < gp::Resolution() ||
aP1.Distance(aP3) < gp::Resolution() ||
aP2.Distance(aP3) < gp::Resolution())
Standard_ConstructionError::Raise("Arc creation aborted: coincident points given");
+
if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
Standard_ConstructionError::Raise("Arc creation aborted: points lay on one line");
- if (aType == CIRC_ARC_THREE_PNT){
- GC_MakeArcOfCircle arc(aP1, aP2, aP3);
- aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
+ if (aType == CIRC_ARC_THREE_PNT)
+ {
+ GC_MakeArcOfCircle arc (aP1, aP2, aP3);
+ aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
}
- if (aType == CIRC_ARC_CENTER){
- Standard_Real Rad = aP1.Distance(aP2);
- gce_MakeCirc MC(aP1,gce_MakePln(aP1, aP2, aP3).Value(),Rad);
+ else // CIRC_ARC_CENTER
+ {
Standard_Boolean sense = aCI.GetSense();
- if (MC.IsDone()) {
- const gp_Circ& Circ = MC.Value();
- Standard_Real Alpha1 = ElCLib::Parameter(Circ,aP2);
- Standard_Real Alpha2 = ElCLib::Parameter(Circ,aP3);
- Handle(Geom_Circle) C = new Geom_Circle(Circ);
- Handle(Geom_TrimmedCurve) TheArc;
- if (!sense)
- TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,false);
- if (sense)
- TheArc= new Geom_TrimmedCurve(C,Alpha2,Alpha1,false);
- aShape = BRepBuilderAPI_MakeEdge(TheArc).Edge();
- }
+
+ Standard_Real aRad = aP1.Distance(aP2);
+ gp_Vec aV1 (aP1, aP2);
+ gp_Vec aV2 (aP1, aP3);
+ gp_Vec aN = aV1 ^ aV2;
+
+ if (sense)
+ aN = -aN;
+
+ GC_MakeCircle circ (aP1, aN, aRad);
+ Handle(Geom_Circle) aGeomCirc = circ.Value();
+
+ GC_MakeArcOfCircle arc (aGeomCirc->Circ(), aP2, aP3, Standard_True);
+ aShape = BRepBuilderAPI_MakeEdge(arc).Edge();
}
}
} else {
aFunction->SetValue(aShape);
log.SetTouched(Label());
- MESSAGE("Out of building step ...");
- return 1;
+ return 1;
}
#include <GEOM_Function.hxx>
#include <ShHealOper_Sewing.hxx>
-#include <NMTAlgo_Splitter1.hxx>
+//#include <NMTAlgo_Splitter1.hxx>
+#include <GEOMAlgo_Gluer.hxx>
#include <BlockFix_BlockFixAPI.hxx>
#include "utilities.h"
TopoDS_Shape aCompound = anArgs(1);
// Glue coincident faces and edges (with Partition algorithm).
- NMTAlgo_Splitter1 PS;
- PS.AddShape(aCompound);
- PS.Compute();
- PS.SetRemoveWebs(Standard_False);
-// PS.Build(aCompound.ShapeType());
- PS.Build(TopAbs_SOLID);
-
- aShape = PS.Shape();
+ //NMTAlgo_Splitter1 PS;
+ //PS.AddShape(aCompound);
+ //PS.Compute();
+ //PS.SetRemoveWebs(Standard_False);
+ // PS.Build(aCompound.ShapeType());
+ //PS.Build(TopAbs_SOLID);
+ //aShape = PS.Shape();
+
+ GEOMAlgo_Gluer aGluer;
+ aGluer.SetShape(aCompound);
+ aGluer.SetCheckGeometry(Standard_True);
+ aGluer.Perform();
+ aShape = aGluer.Result();
+
+
} else {
}
}
// 5. Glue Faces
- aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion());
+ aShape = GEOMImpl_GlueDriver::GlueFaces(aComp, Precision::Confusion(), Standard_False);
}
} else if (aType == BLOCK_MULTI_TRANSFORM_1D ||
}
// Glue faces of the multi-block
- aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol);
+ aShape = GEOMImpl_GlueDriver::GlueFaces(aMulti, aTol, Standard_False);
} else { // unknown function type
return 0;
}
if (isCompound) {
+ /*
TopTools_ListOfShape listShapeC;
AddSimpleShapes(C, listShapeC);
TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
else
aShape = C;
+ */
+
+ // As GlueFaces has been improved to keep all kind of shapes
+ TopExp_Explorer anExp (C, TopAbs_VERTEX);
+ if (anExp.More())
+ aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+ else
+ aShape = C;
}
}
}
if (isCompound) {
+ /*
TopTools_ListOfShape listShapeC;
AddSimpleShapes(C, listShapeC);
TopTools_ListIteratorOfListOfShape itSubC (listShapeC);
aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion());
else
aShape = C;
+ */
+
+ // As GlueFaces has been improved to keep all kind of shapes
+ TopExp_Explorer anExp (C, TopAbs_VERTEX);
+ if (anExp.More())
+ aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+ else
+ aShape = C;
}
}
// perform FUSE operation
else if (aType == BOOLEAN_FUSE) {
+ /* Fix for NPAL15379: refused
// Check arguments
TopTools_ListOfShape listShape1, listShape2;
AddSimpleShapes(aShape1, listShape1);
}
}
}
+ */
// Perform
BRepAlgoAPI_Fuse BO (aShape1, aShape2);
}
}
- if (isCompound)
- aShape = C;
+ if (isCompound) {
+ //aShape = C;
+
+ // As GlueFaces has been improved to keep all kind of shapes
+ TopExp_Explorer anExp (C, TopAbs_VERTEX);
+ if (anExp.More())
+ aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+ else
+ aShape = C;
+ }
}
// UNKNOWN operation
int res = fp( aShape, aFileName, aFormatName );
// unload plugin library
- //UnLoadLib( anExportLib );
+ // commented by enk:
+ // the bug was occured: using ACIS Import/Export plugin
+ // UnLoadLib( anExportLib );
+
if ( res )
log.SetTouched(Label());
//=======================================================================
TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesWithWarnings (const TopoDS_Shape& theShape,
const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids,
TCollection_AsciiString& theWarning) const
{
Standard_Integer iErr, iWrn;
aGluer.SetShape(theShape);
aGluer.SetTolerance(theTolerance);
aGluer.SetCheckGeometry(Standard_True);
+ aGluer.SetKeepNonSolids(doKeepNonSolids);
aGluer.Perform();
//purpose :
//=======================================================================
TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
- const Standard_Real theTolerance)
+ const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids)
{
Standard_Integer iErr, iWrn;
TopoDS_Shape aRes;
aGluer.SetShape(theShape);
aGluer.SetTolerance(theTolerance);
aGluer.SetCheckGeometry(Standard_True);
+ aGluer.SetKeepNonSolids(doKeepNonSolids);
aGluer.Perform();
//=======================================================================
TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids,
const TopTools_MapOfShape& aFaces)
{
TopoDS_Shape aRes;
aGluer.SetShape(theShape);
aGluer.SetTolerance(theTolerance);
+ aGluer.SetKeepNonSolids(doKeepNonSolids);
aGluer.Perform();
Standard_Integer iErr = aGluer.ErrorStatus();
if (iErr) return aRes;
Standard_Real tol3d = aCI.GetTolerance();
+ Standard_Boolean aKeepNonSolids = aCI.GetKeepNonSolids();
+
if (aType == GLUE_FACES) {
- aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aWrn);
+ aShape = GlueFacesWithWarnings(aShapeBase, tol3d, aKeepNonSolids, aWrn);
}
else { // aType == GLUE_FACES_BY_LIST
Handle(TColStd_HSequenceOfTransient) SF = aCI.GetFaces();
if(!aFaces.Contains(aFace))
aFaces.Add(aFace);
}
- aShape = GlueFacesByList(aShapeBase, tol3d, aFaces);
+ aShape = GlueFacesByList(aShapeBase, tol3d, aKeepNonSolids, aFaces);
}
if (aShape.IsNull()) return 0;
Standard_EXPORT ~GEOMImpl_GlueDriver() {};
Standard_EXPORT static TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
- const Standard_Real theTolerance);
+ const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids = Standard_True);
Standard_EXPORT TopoDS_Shape GlueFacesWithWarnings (const TopoDS_Shape& theShape,
const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids,
TCollection_AsciiString& theWarning) const;
Standard_EXPORT static TopoDS_Shape GlueFacesByList (const TopoDS_Shape& theShape,
const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids,
const TopTools_MapOfShape& aFaces);
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Boolean thePerformSelfIntersections)
+ const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Boolean thePerformSelfIntersections)
{
SetErrorCode(KO);
// Limit
aCI.SetLimit(theLimit);
+ aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
// Materials
if (theRemoveWebs) {
pd << ", " << theMaterials->Value(i);
}
}
- pd << "])";
+ pd << "], " << theKeepNonlimitShapes <<")";
SetErrorCode(OK);
return aPartition;
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Boolean thePerformSelfIntersections);
+ const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Boolean thePerformSelfIntersections);
Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
Handle(GEOM_Object) thePlane);
#define GLUE_ARG_BASE 1
#define GLUE_ARG_TOLER 2
#define GLUE_ARG_FACES 3
+#define GLUE_ARG_KEEPALL 4
class GEOMImpl_IGlue
{
Handle(TColStd_HSequenceOfTransient) GetFaces()
{ return _func->GetReferenceList(GLUE_ARG_FACES); }
+ void SetKeepNonSolids (Standard_Boolean theFlag) { _func->SetInteger(GLUE_ARG_KEEPALL, theFlag ? 1 : 0); }
+ Standard_Boolean GetKeepNonSolids() { return (_func->GetInteger(GLUE_ARG_KEEPALL) != 0); }
+
private:
Handle(GEOM_Function) _func;
#define PART_ARG_SHAPE 7
#define PART_ARG_PLANE 8
+#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
+
class GEOMImpl_IPartition
{
public:
void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
+ void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
+ { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
+
void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
{ _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
+ int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
+
Handle(TColStd_HSequenceOfTransient) GetShapes() { return _func->GetReferenceList(PART_ARG_SHAPES); }
Handle(TColStd_HSequenceOfTransient) GetTools() { return _func->GetReferenceList(PART_ARG_TOOLS); }
Handle(TColStd_HSequenceOfTransient) GetKeepIns() { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : GEOMImpl_IShapesOperations.cxx
+// Created :
+// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
+// Project : SALOME
+// $Header$
#include <Standard_Stream.hxx>
#include "GEOMAlgo_FinderShapeOnQuad.hxx"
#include "GEOMAlgo_FinderShapeOn2.hxx"
#include "GEOMAlgo_ClsfBox.hxx"
-//#include "GEOMAlgo_ClsfSurf.hxx"
#include "GEOMAlgo_Gluer1.hxx"
#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
#include "GEOMAlgo_CoupleOfShapes.hxx"
#include <BRepExtrema_ExtCF.hxx>
#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
#include <BRepTools.hxx>
#include <BRepGProp.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+// Includes added for GetInPlace algorithm improvement
+
+#include <GEOMImpl_MeasureDriver.hxx>
+#include <GEOMImpl_IMeasure.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+
+#include <BRepClass_FaceClassifier.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+#include <Precision.hxx>
+
//=============================================================================
/*!
* constructor:
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
(Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance)
+ const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids)
{
SetErrorCode(KO);
aCI.SetBase(aRefShape);
aCI.SetTolerance(theTolerance);
+ aCI.SetKeepNonSolids(doKeepNonSolids);
//Compute the sub-shape value
Standard_Boolean isWarning = Standard_False;
Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
(Handle(GEOM_Object) theShape,
const Standard_Real theTolerance,
- list<Handle(GEOM_Object)> theFaces)
+ list<Handle(GEOM_Object)> theFaces,
+ const Standard_Boolean doKeepNonSolids)
{
SetErrorCode(KO);
aCI.SetBase(aRefShape);
aCI.SetTolerance(theTolerance);
+ aCI.SetKeepNonSolids(doKeepNonSolids);
+
Handle(TColStd_HSequenceOfTransient) aFaces = new TColStd_HSequenceOfTransient;
list<Handle(GEOM_Object)>::iterator it = theFaces.begin();
for (; it != theFaces.end(); it++) {
TopoDS_Shape aBox = theBox->GetValue();
TopoDS_Shape aShape = theShape->GetValue();
+ // Check presence of triangulation, build if need
+ if (!CheckTriangulation(aShape)) {
+ SetErrorCode("Cannot build triangulation on the shape");
+ return aSeqOfIDs;
+ }
+
// Call algo
GEOMAlgo_FinderShapeOn2 aFinder;
Standard_Real aTol = 0.0001; // default value
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
// Check presence of triangulation, build if need
- if (!CheckTriangulation(theShape))
+ if (!CheckTriangulation(theShape)) {
+ SetErrorCode("Cannot build triangulation on the shape");
return aSeqOfIDs;
+ }
// Call algo
GEOMAlgo_FinderShapeOn1 aFinder;
Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
// Check presence of triangulation, build if need
- if (!CheckTriangulation(aShape))
+ if (!CheckTriangulation(aShape)) {
+ SetErrorCode("Cannot build triangulation on the shape");
return aSeqOfIDs;
+ }
// Call algo
gp_Pnt aPntTL = BRep_Tool::Pnt(TopoDS::Vertex(aTL));
//=============================================================================
/*!
- * GetInPlace
+ * GetInPlaceOfShape
*/
//=============================================================================
static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
return isFound;
}
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace
+//=============================================================================
+/*!
+ * GetShapeProperties
+ */
+//=============================================================================
+
+void GEOMImpl_IShapesOperations::GetShapeProperties( const TopoDS_Shape aShape, Standard_Real tab[],
+ gp_Pnt & aVertex )
+{
+ GProp_GProps SProps, VProps;
+ gp_Pnt aCenterMass;
+ TopoDS_Shape aPntShape;
+ Standard_Real aShapeSize;
+
+ BRepGProp::VolumeProperties(aShape, VProps);
+ aCenterMass = VProps.CentreOfMass();
+ aShapeSize = VProps.Mass();
+ if (aShape.ShapeType() == TopAbs_FACE) {
+ BRepGProp::SurfaceProperties(aShape, SProps);
+ aCenterMass = SProps.CentreOfMass();
+ aShapeSize = SProps.Mass();
+ }
+
+ aPntShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape();
+ aVertex = BRep_Tool::Pnt( TopoDS::Vertex( aPntShape ) );
+ tab[0] = aVertex.X();
+ tab[1] = aVertex.Y();
+ tab[2] = aVertex.Z();
+ tab[3] = aShapeSize;
+ return;
+}
+
+//=============================================================================
+/*!
+ * GetInPlace
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
+ Handle(GEOM_Object) theShapeWhat)
+{
+ SetErrorCode(KO);
+
+ if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
+
+ TopoDS_Shape aWhere = theShapeWhere->GetValue();
+ TopoDS_Shape aWhat = theShapeWhat->GetValue();
+
+ if (aWhere.IsNull() || aWhat.IsNull()) {
+ SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
+ return NULL;
+ }
+
+ Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
+ if (aWhereFunction.IsNull()) {
+ SetErrorCode("Error: aWhereFunction is Null.");
+ return NULL;
+ }
+
+ TopTools_IndexedMapOfShape aWhereIndices;
+ TopExp::MapShapes(aWhere, aWhereIndices);
+
+ TColStd_ListOfInteger aModifiedList;
+ Standard_Integer aWhereIndex;
+ Handle(TColStd_HArray1OfInteger) aModifiedArray;
+ Handle(GEOM_Object) aResult;
+
+ bool isFound = false;
+ Standard_Integer iType = TopAbs_SOLID;
+ Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.;
+ Standard_Real tab_aWhat[4], tab_aWhere[4];
+ Standard_Real dl_l = 1e-3;
+ Standard_Real min_l, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
+ gp_Pnt aPnt, aPnt_aWhat;
+ GProp_GProps aProps;
+
+ // 2D or 3D shapes
+ if ( aWhat.ShapeType() == TopAbs_COMPOUND ||
+ aWhat.ShapeType() == TopAbs_SHELL ||
+ aWhat.ShapeType() == TopAbs_COMPSOLID ) {
+ TopExp_Explorer Exp( aWhat, TopAbs_ShapeEnum( iType ) );
+ if ( ! Exp.More() ) iType = TopAbs_FACE;
+ }
+ else if ( aWhat.ShapeType() == TopAbs_FACE )
+ iType = TopAbs_FACE;
+
+ TopExp_Explorer Exp_aWhat( aWhat, TopAbs_ShapeEnum( iType ) );
+ TopExp_Explorer Exp_aWhere( aWhere, TopAbs_ShapeEnum( iType ) );
+ TopExp_Explorer Exp_Edge( aWhere, TopAbs_EDGE );
+
+ // Find the shortest edge in theShapeWhere shape
+ for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
+ BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
+ if ( ! nbEdge ) min_l = aProps.Mass();
+ if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
+ }
+
+ // Compute tolerances
+ Tol_1D = dl_l * min_l;
+ Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
+ Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
+
+ Tol_Mass = Tol_3D;
+ if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
+
+ // Compute the ShapeWhat Mass
+ for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) {
+ if ( iType == TopAbs_SOLID ) BRepGProp::VolumeProperties(Exp_aWhat.Current(), aProps);
+ else if ( iType == TopAbs_FACE ) BRepGProp::SurfaceProperties(Exp_aWhat.Current(), aProps);
+ aWhat_Mass += aProps.Mass();
+ }
+
+ // Finding the Sub-ShapeWhere
+ for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
+ GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
+ for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
+ GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
+ if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
+ isFound = true;
+ else if ( tab_aWhat[3] - ( tab_aWhere[3] > Tol_Mass) ) {
+ BRepClass3d_SolidClassifier SC_aWhere (Exp_aWhere.Current(), aPnt, Precision::Confusion());
+ BRepClass3d_SolidClassifier SC_aWhat (Exp_aWhat.Current(), aPnt, Precision::Confusion());
+ // Block construction 3D
+ if ( SC_aWhere.State() == TopAbs_IN && SC_aWhat.State() == TopAbs_IN ) isFound = true;
+ // Block construction 2D
+ else if ( SC_aWhere.State() == TopAbs_ON && SC_aWhat.State() == TopAbs_ON ) isFound = true;
+ }
+ if ( isFound ) {
+ aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current());
+ aModifiedList.Append(aWhereIndex);
+ aWhere_Mass += tab_aWhere[3];
+ isFound = false;
+ break;
+ }
+ }
+ if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) break;
+ }
+
+ aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
+ TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
+ for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
+ aModifiedArray->SetValue(imod, anIterModif.Value());
+
+ //Add a new object
+ aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+ if (aResult.IsNull()) {
+ SetErrorCode("Error in algorithm: result found, but cannot be returned.");
+ return NULL;
+ }
+
+ if (aModifiedArray->Length() > 1) {
+ //Set a GROUP type
+ aResult->SetType(GEOM_GROUP);
+
+ //Set a sub shape type
+ TopoDS_Shape aFirstFound = aWhereIndices.FindKey(aModifiedArray->Value(1));
+ TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
+
+ TDF_Label aFreeLabel = aResult->GetFreeLabel();
+ TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
+ }
+
+ //Make a Python command
+ Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
+
+ GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
+ << theShapeWhere << ", " << theShapeWhat << ")";
+
+ SetErrorCode(OK);
+ return aResult;
+}
+
+//=======================================================================
+//function : GetInPlaceByHistory
+//purpose :
+//=======================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
(Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat)
{
SL.Append( aShapes( OrderInd(Index) ));
}
+//=======================================================================
+//function : CompsolidToCompound
+//purpose :
+//=======================================================================
+TopoDS_Shape GEOMImpl_IShapesOperations::CompsolidToCompound (const TopoDS_Shape& theCompsolid)
+{
+ if (theCompsolid.ShapeType() != TopAbs_COMPSOLID) {
+ return theCompsolid;
+ }
+
+ TopoDS_Compound aCompound;
+ BRep_Builder B;
+ B.MakeCompound(aCompound);
+
+ TopTools_MapOfShape mapShape;
+ TopoDS_Iterator It (theCompsolid, Standard_True, Standard_True);
+
+ for (; It.More(); It.Next()) {
+ TopoDS_Shape aShape_i = It.Value();
+ if (mapShape.Add(aShape_i)) {
+ B.Add(aCompound, aShape_i);
+ }
+ }
+
+ return aCompound;
+}
+
//=======================================================================
//function : CheckTriangulation
//purpose :
//=======================================================================
bool GEOMImpl_IShapesOperations::CheckTriangulation (const TopoDS_Shape& aShape)
{
+ bool isTriangulation = true;
+
TopExp_Explorer exp (aShape, TopAbs_FACE);
- if (!exp.More()) {
- SetErrorCode("Shape without faces given");
- return false;
+ if (exp.More())
+ {
+ TopLoc_Location aTopLoc;
+ Handle(Poly_Triangulation) aTRF;
+ aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
+ if (aTRF.IsNull()) {
+ isTriangulation = false;
+ }
+ }
+ else // no faces, try edges
+ {
+ TopExp_Explorer expe (aShape, TopAbs_EDGE);
+ if (!expe.More()) {
+ return false;
+ }
+ TopLoc_Location aLoc;
+ Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc);
+ if (aPE.IsNull()) {
+ isTriangulation = false;
+ }
}
- TopLoc_Location aTopLoc;
- Handle(Poly_Triangulation) aTRF;
- aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
- if (aTRF.IsNull()) {
+ if (!isTriangulation) {
// calculate deflection
Standard_Real aDeviationCoefficient = 0.001;
if(P.Z() > zmaxB2) zmaxB2 = P.Z();
}
+
//Compare the bounding boxes of both faces
if(gp_Pnt(xminB1, yminB1, zminB1).Distance(gp_Pnt(xminB2, yminB2, zminB2)) > MAX_TOLERANCE)
return false;
if(gp_Pnt(xmaxB1, ymaxB1, zmaxB1).Distance(gp_Pnt(xmaxB2, ymaxB2, zmaxB2)) > MAX_TOLERANCE)
return false;
+ Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
+ Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
+
+ //Check if there a coincidence of two surfaces at least in two points
+ double U11, U12, V11, V12, U21, U22, V21, V22;
+ BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
+ BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
+
+ double rangeU = U12-U11;
+ double rangeV = V12-V11;
+ double U = U11 + rangeU/3.0;
+ double V = V11 + rangeV/3.0;
+ gp_Pnt P1 = S1->Value(U, V);
+ U = U11+rangeU*2.0/3.0;
+ V = V11+rangeV*2.0/3.0;
+ gp_Pnt P2 = S1->Value(U, V);
+
+ if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+ return false;
+
+ if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
+
+ if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+ return false;
+
+ if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
+
//Check that each edge of the Face1 has a counterpart in the Face2
TopTools_MapOfOrientedShape aMap;
TopTools_ListIteratorOfListOfShape LSI1(LS1);
if(!isFound) return false;
}
- Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace1);
- Handle(Geom_Surface) S2 = BRep_Tool::Surface(theFace2);
- if(S1->DynamicType() == S2->DynamicType()) {
- return true;
- }
- else { //Check if there a coincidence of two surfaces at least in two points
- double U11, U12, V11, V12, U21, U22, V21, V22;
- BRepTools::UVBounds(theFace1, U11, U12, V11, V12);
- BRepTools::UVBounds(theFace2, U21, U22, V21, V22);
-
- double rangeU = U12-U11;
- double rangeV = V12-V11;
- double U = U11 + rangeU/3.0;
- double V = V11 + rangeV/3.0;
- gp_Pnt P1 = S1->Value(U, V);
- U = U11+rangeU*2.0/3.0;
- V = V11+rangeV*2.0/3.0;
- gp_Pnt P2 = S1->Value(U, V);
-
- if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
- return false;
-
- if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
-
- if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
- return false;
-
- if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
- }
-
return true;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
+//=============================================================================
+// File : GEOMImpl_IShapesOperations.hxx
+// Created :
+// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
+// Project : SALOME
+// Copyright : CEA 2003
+// $Header$
+//=============================================================================
#ifndef _GEOMImpl_IShapesOperations_HXX_
#define _GEOMImpl_IShapesOperations_HXX_
#include <list>
#include <Handle_Geom_Surface.hxx>
+#include <gp_Pnt.hxx>
+
class GEOM_Engine;
class Handle(GEOM_Object);
class Handle(TColStd_HArray1OfInteger);
-class GEOMImpl_IShapesOperations : public GEOM_IOperations {
+class GEOMImpl_IShapesOperations : public GEOM_IOperations
+{
public:
Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IShapesOperations();
Standard_EXPORT Handle(GEOM_Object) MakeCompound (list<Handle(GEOM_Object)> theShapes);
Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
- const Standard_Real theTolerance);
+ const Standard_Real theTolerance,
+ const Standard_Boolean doKeepNonSolids);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
const Standard_Real theTolerance);
Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
const Standard_Real theTolerance,
- list<Handle(GEOM_Object)> theFaces);
+ list<Handle(GEOM_Object)> theFaces,
+ const Standard_Boolean doKeepNonSolids);
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape,
- const Standard_Integer theShapeType,
- const Standard_Boolean isSorted);
+ const Standard_Integer theShapeType,
+ const Standard_Boolean isSorted);
Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs (Handle(GEOM_Object) theShape,
- const Standard_Integer theShapeType,
- const Standard_Boolean isSorted);
+ const Standard_Integer theShapeType,
+ const Standard_Boolean isSorted);
Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object) theMainShape,
const Standard_Integer theID);
const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theAxis,
- const Standard_Real theRadius,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+ GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAxis,
+ const Standard_Real theRadius,
+ const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theCenter,
- const Standard_Real theRadius,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+ GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theCenter,
+ const Standard_Real theRadius,
+ const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theAx1,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAx1,
+ const GEOMAlgo_State theState);
Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
GetShapesOnPlaneWithLocationIDs (const Handle(GEOM_Object)& theShape,
const Handle(GEOM_Object)& thePnt,
const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theAxis,
- const Standard_Real theRadius,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAxis,
+ const Standard_Real theRadius,
+ const GEOMAlgo_State theState);
- Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
- const Standard_Integer theShapeType,
- const Handle(GEOM_Object)& theCenter,
- const Standard_Real theRadius,
- const GEOMAlgo_State theState);
+ Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
+ GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theCenter,
+ const Standard_Real theRadius,
+ const GEOMAlgo_State theState);
/*!
* \brief Find subshapes complying with given status about quadrangle
Handle(GEOM_Object) theCenter,
const Standard_Real theRadius);
+ void GetShapeProperties(const TopoDS_Shape aShape, Standard_Real propertiesArray[], gp_Pnt & aPnt);
+
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat);
- Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
+ Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
+ Handle(GEOM_Object) theShapeWhat);
/*!
* \brief Searches a shape equal to theWhat in the context of theWhere
const Standard_Integer theShapeType,
GEOMAlgo_State theState);
+ public:
+ /*!
+ * \brief Sort shapes in the list by their coordinates.
+ * \param SL The list of shapes to sort.
+ */
+ Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
+
+ /*!
+ * \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
+ *
+ * If the argument shape is not of type TopoDS_COMPSOLID, this method returns it as is.
+ *
+ * \param theCompsolid The compsolid to be converted.
+ * \retval TopoDS_Shape Returns the resulting compound.
+ */
+ Standard_EXPORT static TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
+
+ /*!
+ * \brief Build a triangulation on \a theShape if it is absent.
+ * \param theShape The shape to check/build triangulation on.
+ * \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
+ */
+ Standard_EXPORT static bool CheckTriangulation (const TopoDS_Shape& theShape);
+
private:
Handle(GEOM_Object) MakeShape (list<Handle(GEOM_Object)> theShapes,
const Standard_Integer theObjectType,
const TCollection_AsciiString& theMethodName);
// ----------------------------------------------------
- // methods common for all GetShapesOnXXX() functions
+// methods common for all GetShapesOnXXX() functions
// ----------------------------------------------------
- bool CheckTriangulation (const TopoDS_Shape& aShape);
-
/*!
* \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
* \param theShapeType - the shape type to check
TCollection_AsciiString anError;
TopoDS_Shape aShape = fp( aFileName, aFormatName, anError );
- // unload plugin library
+ // unload plugin library
+ // commented by enk:
+ // the bug was occured: using ACIS Import/Export plugin
//UnLoadLib( anImportLib ); //This is workaround of BUG OCC13051
if ( aShape.IsNull() ) {
}
}
+ PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() );
PS.Perform();
#include <Standard_Stream.hxx>
#include <GEOMImpl_PipeDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
+#include <GEOMImpl_IPipeDiffSect.hxx>
+#include <GEOMImpl_IPipeShellSect.hxx>
#include <GEOMImpl_IPipe.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
+#include <ShapeAnalysis_FreeBounds.hxx>
+#include <ShapeAnalysis_Edge.hxx>
+
#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepCheck_Analyzer.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepOffsetAPI_MakePipeShell.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
#include <TopAbs.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
-#include <BRepOffsetAPI_MakePipeShell.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
-#include <GEOMImpl_IPipeDiffSect.hxx>
-#include <GEOMImpl_IPipeShellSect.hxx>
-
-#include <Standard_NullObject.hxx>
-#include <Standard_TypeMismatch.hxx>
-#include <Standard_ConstructionError.hxx>
-#include "utilities.h"
-#include <TopExp_Explorer.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <BRep_Builder.hxx>
#include <TopoDS_Compound.hxx>
-#include <ShapeAnalysis_FreeBounds.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
-#include <ShapeAnalysis_Edge.hxx>
+#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopExp.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+
#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <Precision.hxx>
#include <Geom_TrimmedCurve.hxx>
-#include <BRepBuilderAPI_Sewing.hxx>
-//#include <BRepTools.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
+
+#include <Precision.hxx>
+#include <Standard_NullObject.hxx>
+#include <Standard_TypeMismatch.hxx>
+#include <Standard_ConstructionError.hxx>
+
+#include "utilities.h"
+
+//#include "BRepTools.hxx"
//=======================================================================
}
FindNextPairOfFaces(F1other, aMapEdgeFaces1, aMapEdgeFaces2, FF, aCI);
-
}
}
Standard_ConstructionError::Raise
("First location shapes is not coincided with first vertex of aWirePath");
}
+ VLocs.ChangeValue(1) = VF;
edge = TopoDS::Edge(Edges.Last());
tol = BRep_Tool::Tolerance(edge);
TopoDS_Vertex VL = sae.LastVertex(edge);
Standard_ConstructionError::Raise
("Last location shapes is not coincided with last vertex of aWirePath");
}
+ VLocs.ChangeValue(nbLocs) = VL;
int jcurr = 2;
TopTools_SequenceOfShape tmpEdges;
for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
- tol = BRep_Tool::Tolerance(edge);
+ tol = BRep_Tool::Tolerance(E);
TopoDS_Vertex V1 = sae.FirstVertex(E);
TopoDS_Vertex V2 = sae.LastVertex(E);
gp_Pnt P1 = BRep_Tool::Pnt(V1);
B.Add(W,tmpEdges.Value(j));
B.Add(W,E);
Wires.Append(W);
+ VLocs.ChangeValue(jcurr) = V2;
jcurr++;
tmpEdges.Clear();
}
else {
- // find distance between E and aLocs(icurr)
+ // find distance between E and aLocs(jcurr)
double fp,lp;
Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
TopoDS_Edge E1,E2;
- if(PC1.Distance(P1)<tol) {
+ gp_Pnt Pfp;
+ C->D0(fp,Pfp);
+ if(Pfp.Distance(P1)<tol) {
B.MakeEdge(E1,tc1,tol);
B.Add(E1,V1);
TopoDS_Shape tmpV = VLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
Edges.InsertAfter(i,E2);
}
else {
- tmpEdges.Append(edge);
+ tmpEdges.Append(E);
}
}
}
CreateFewSolids = true;
}
+ /*
+ // check orientation of sections
+ bool NeedReverse = false;
+ {
+ // first section
+ anExp.Init( aShBase1, TopAbs_FACE );
+ TopoDS_Shape aFace = anExp.Current();
+ TColgp_SequenceOfPnt aPnts;
+ double xc=0, yc=0, zc=0;
+ for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+ TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+ aPnts.Append(BRep_Tool::Pnt(V));
+ xc += aPnts.Last().X();
+ yc += aPnts.Last().Y();
+ zc += aPnts.Last().Z();
+ }
+ gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+ gp_Vec V1(PC,aPnts.Value(1));
+ gp_Vec V2(PC,aPnts.Value(2));
+ gp_Vec VN = V1.Crossed(V2);
+ for(int ip=2; ip<aPnts.Length(); ip++) {
+ V1 = gp_Vec(PC,aPnts.Value(ip));
+ V2 = gp_Vec(PC,aPnts.Value(ip+1));
+ VN.Add(V1.Crossed(V2));
+ }
+ gp_Vec PathNorm;
+ gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
+ TopExp_Explorer WE;
+ for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+ TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+ double tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VF = sae.FirstVertex(edge);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ if( PF.Distance(PLoc) < tol ) {
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+ gp_Pnt P1,P2;
+ C->D0(fp,P1);
+ if( P1.Distance(PLoc) < tol ) {
+ C->D0(fp+(lp-fp)/100,P2);
+ }
+ else {
+ C->D0(lp,P1);
+ C->D0(lp+(fp-lp)/100,P2);
+ }
+ PathNorm = gp_Vec(P1,P2);
+ break;
+ }
+ else {
+ TopoDS_Vertex VL = sae.LastVertex(edge);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if( PL.Distance(PLoc) < tol ) {
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+ gp_Pnt P1,P2;
+ C->D0(fp,P1);
+ if( P1.Distance(PLoc) < tol ) {
+ C->D0(fp+(lp-fp)/100,P2);
+ }
+ else {
+ C->D0(lp,P1);
+ C->D0(lp+(fp-lp)/100,P2);
+ }
+ PathNorm = gp_Vec(P2,P1);
+ break;
+ }
+ }
+ }
+ cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
+ cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
+ if(fabs(VN.Angle(PathNorm))>PI/2.) {
+ NeedReverse = true;
+ aShBase1.Reverse();
+ }
+ }
+ {
+ // second section
+ anExp.Init( aShBase2, TopAbs_FACE );
+ TopoDS_Shape aFace = anExp.Current();
+ TColgp_SequenceOfPnt aPnts;
+ double xc=0, yc=0, zc=0;
+ for ( anExp.Init( aFace, TopAbs_VERTEX ); anExp.More(); anExp.Next() ) {
+ TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
+ aPnts.Append(BRep_Tool::Pnt(V));
+ xc += aPnts.Last().X();
+ yc += aPnts.Last().Y();
+ zc += aPnts.Last().Z();
+ }
+ gp_Pnt PC( xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length() );
+ gp_Vec V1(PC,aPnts.Value(1));
+ gp_Vec V2(PC,aPnts.Value(2));
+ gp_Vec VN = V1.Crossed(V2);
+ for(int ip=2; ip<aPnts.Length(); ip++) {
+ V1 = gp_Vec(PC,aPnts.Value(ip));
+ V2 = gp_Vec(PC,aPnts.Value(ip+1));
+ VN.Add(V1.Crossed(V2));
+ }
+ gp_Vec PathNorm;
+ gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
+ TopExp_Explorer WE;
+ for ( WE.Init( WPath, TopAbs_EDGE ); WE.More(); WE.Next() ) {
+ TopoDS_Edge edge = TopoDS::Edge(WE.Current());
+ double tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VF = sae.FirstVertex(edge);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ if( PF.Distance(PLoc) < tol ) {
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+ gp_Pnt P1,P2;
+ C->D0(fp,P1);
+ if( P1.Distance(PLoc) < tol ) {
+ C->D0(fp+(lp-fp)/100,P2);
+ }
+ else {
+ C->D0(lp,P1);
+ C->D0(lp+(fp-lp)/100,P2);
+ }
+ PathNorm = gp_Vec(P2,P1);
+ break;
+ }
+ else {
+ TopoDS_Vertex VL = sae.LastVertex(edge);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if( PL.Distance(PLoc) < tol ) {
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+ gp_Pnt P1,P2;
+ C->D0(fp,P1);
+ if( P1.Distance(PLoc) < tol ) {
+ C->D0(fp+(lp-fp)/100,P2);
+ }
+ else {
+ C->D0(lp,P1);
+ C->D0(lp+(fp-lp)/100,P2);
+ }
+ PathNorm = gp_Vec(P2,P1);
+ break;
+ }
+ }
+ }
+ //cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
+ //cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
+ if(fabs(VN.Angle(PathNorm))>PI/2.)
+ aShBase2.Reverse();
+ }
+ */
+
if(!CreateFewSolids) {
// we can create only one solid
TopoDS_Shape aWire1, aWire2;
const TopoDS_Shape aSewShape = aSewing->SewedShape();
if( aSewShape.ShapeType() == TopAbs_SHELL ) {
aShell = TopoDS::Shell(aSewShape);
+ GProp_GProps aSystem;
+ BRepGProp::VolumeProperties(aShell, aSystem);
+ if(aSystem.Mass()<0) {
+ aShell.Reverse();
+ }
if(BRep_Tool::IsClosed(aShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
else {
// main block - creation few solids (for each pair of faces)
TopTools_MapOfShape aFaces1,aFaces2;
- for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() )
+ for ( anExp.Init( aShBase1, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
aFaces1.Add(anExp.Current());
- for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() )
+ }
+ for ( anExp.Init( aShBase2, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
aFaces2.Add(anExp.Current());
+ }
// creating map of edge faces
TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces1;
TopExp::MapShapesAndAncestors(aShBase1, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces1);
// make pipe for each pair of faces
- //BRepTools::Write(WPath,"/dn02/users_Linux/skl/work/Bugs/14857/wpath.brep");
for(j=1; j<=FF.Extent(); j++) {
TopoDS_Shape F1 = FF.FindKey(j);
if( F1.ShapeType() != TopAbs_FACE )
TopoDS_Shape aShape = aBuilder.Shape();
TopoDS_Shell aShell;
B.MakeShell(aShell);
- //int nbf=0;
for ( anExp.Init( aShape, TopAbs_FACE ); anExp.More(); anExp.Next() ) {
- //nbf++;
- //cout<<"nbf="<<nbf<<endl;
B.Add(aShell,anExp.Current());
}
+
B.Add(aShell,F1);
B.Add(aShell,F2);
// make sewing for this shell
const TopoDS_Shape aSewShape = aSewing->SewedShape();
if( aSewShape.ShapeType() == TopAbs_SHELL ) {
aShell = TopoDS::Shell(aSewShape);
+ GProp_GProps aSystem;
+ BRepGProp::VolumeProperties(aShell, aSystem);
+ if(aSystem.Mass()<0) {
+ //cout<<"aSewShape is reversed"<<endl;
+ aShell.Reverse();
+ }
if(BRep_Tool::IsClosed(aShell)) {
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
}
}
+ //BRepTools::Write(aComp,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
return aComp;
}
{
GEOMImpl_IPipeDiffSect* aCIDS = (GEOMImpl_IPipeDiffSect*)aCI;
//GEOMImpl_IPipeDiffSect* aCIDS = static_cast<GEOMImpl_IPipeDiffSect*>(aCI);
- BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+ //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases ();
Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
}
nbLocs = aSeqLocs.Length();
+
+ // skl 02.05.2007
+ if(nbLocs>0) {
+ // we have to check that each location shape is a vertex from
+ // path and update aSeqLocs if it is needed (and possible)
+ TColgp_SequenceOfPnt PLocs;
+ for(i=1; i<=nbLocs; i++) {
+ TopoDS_Vertex V = TopoDS::Vertex(aSeqLocs.Value(i));
+ PLocs.Append(BRep_Tool::Pnt(V));
+ }
+ TopTools_SequenceOfShape Edges;
+ TopExp_Explorer anExp;
+ for ( anExp.Init( aWirePath, TopAbs_EDGE ); anExp.More(); anExp.Next() ) {
+ Edges.Append(anExp.Current());
+ }
+ int nbEdges = Edges.Length();
+ ShapeAnalysis_Edge sae;
+ TopoDS_Edge edge = TopoDS::Edge(Edges.First());
+ double tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VF = sae.FirstVertex(edge);
+ gp_Pnt PF = BRep_Tool::Pnt(VF);
+ //cout<<"PF("<<PF.X()<<","<<PF.Y()<<","<<PF.Z()<<")"<<endl;
+ if( PF.Distance(PLocs.First()) > tol ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise
+ ("First location shapes is not coincided with first vertex of aWirePath");
+ }
+ aSeqLocs.ChangeValue(1) = VF;
+ edge = TopoDS::Edge(Edges.Last());
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex VL = sae.LastVertex(edge);
+ gp_Pnt PL = BRep_Tool::Pnt(VL);
+ if( PL.Distance(PLocs.Last()) > tol ) {
+ if(aCI) delete aCI;
+ Standard_ConstructionError::Raise
+ ("Last location shapes is not coincided with last vertex of aWirePath");
+ }
+ aSeqLocs.ChangeValue(nbLocs) = VL;
+ int jcurr = 2;
+ for(i=1; i<=Edges.Length() && jcurr<nbLocs; i++) {
+ TopoDS_Edge E = TopoDS::Edge(Edges.Value(i));
+ tol = BRep_Tool::Tolerance(edge);
+ TopoDS_Vertex V1 = sae.FirstVertex(E);
+ TopoDS_Vertex V2 = sae.LastVertex(E);
+ gp_Pnt P1 = BRep_Tool::Pnt(V1);
+ gp_Pnt P2 = BRep_Tool::Pnt(V2);
+ if( P2.Distance(PLocs.Value(jcurr)) < tol ) {
+ aSeqLocs.ChangeValue(jcurr) = V2;
+ jcurr++;
+ }
+ else {
+ // find distance between E and aLocs(jcurr)
+ double fp,lp;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(E,fp,lp);
+ GeomAPI_ProjectPointOnCurve PPC (PLocs.Value(jcurr),C);
+ if( PPC.NbPoints()>0 &&
+ PLocs.Value(jcurr).Distance(PPC.Point(1)) < tol ) {
+ double param = PPC.Parameter(1);
+ gp_Pnt PC1;
+ C->D0(param,PC1);
+ // split current edge
+ Handle(Geom_TrimmedCurve) tc1 = new Geom_TrimmedCurve(C,fp,param);
+ Handle(Geom_TrimmedCurve) tc2 = new Geom_TrimmedCurve(C,param,lp);
+ TopoDS_Edge E1,E2;
+ BRep_Builder B;
+ gp_Pnt Pfp;
+ C->D0(fp,Pfp);
+ if(Pfp.Distance(P1)<tol) {
+ B.MakeEdge(E1,tc1,tol);
+ B.Add(E1,V1);
+ TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ B.MakeEdge(E2,tc2,tol);
+ tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ B.Add(E2,V2);
+ }
+ else {
+ B.MakeEdge(E1,tc2,tol);
+ TopoDS_Shape tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_FORWARD);
+ B.Add(E1,TopoDS::Vertex(tmpV));
+ B.Add(E1,V1);
+ E1.Reverse();
+ B.MakeEdge(E2,tc1,tol);
+ B.Add(E2,V2);
+ tmpV = aSeqLocs.Value(jcurr).Oriented(TopAbs_REVERSED);
+ B.Add(E2,TopoDS::Vertex(tmpV));
+ E2.Reverse();
+ }
+ jcurr++;
+ Edges.Remove(i);
+ Edges.InsertAfter(i-1,E1);
+ Edges.InsertAfter(i,E2);
+ }
+ }
+ }
+ if(nbEdges<Edges.Length()) {
+ // one of edges was splitted => we have to update WirePath
+ BRep_Builder B;
+ TopoDS_Wire W;
+ B.MakeWire(W);
+ for(i=1; i<=Edges.Length(); i++) {
+ B.Add(W,TopoDS::Edge(Edges.Value(i)));
+ }
+ aWirePath = W;
+ }
+ }
+
+ BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
+
Standard_Integer nbShapes = aSeqBases.Length();
Standard_Integer step = nbShapes/nbBases;
Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
}
- aFunction->SetValue(aShape);
+ TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+ aFunction->SetValue(aRes);
log.SetTouched(Label());
if(aCI) delete aCI;
#include <Standard_Stream.hxx>
#include <GEOMImpl_PrismDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
#include <GEOMImpl_IPrism.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
if (aShape.IsNull()) return 0;
- aFunction->SetValue(aShape);
+ TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+ aFunction->SetValue(aRes);
log.SetTouched(Label());
#include <Standard_Stream.hxx>
#include <GEOMImpl_RevolutionDriver.hxx>
+
+#include <GEOMImpl_IShapesOperations.hxx>
#include <GEOMImpl_IRevolution.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
}
if (aShape.IsNull()) return 0;
- aFunction->SetValue(aShape);
- log.SetTouched(Label());
+ TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
+ aFunction->SetValue(aRes);
+
+ log.SetTouched(Label());
- return 1;
+ return 1;
}
$(KERNEL_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../ShHealOper \
- -I$(srcdir)/../NMTAlgo \
-I$(srcdir)/../NMTTools \
-I$(srcdir)/../GEOM \
-I$(srcdir)/../GEOMAlgo \
libGEOMimpl_la_LDFLAGS = \
../GEOM/libGEOMbasic.la \
- ../NMTAlgo/libNMTAlgo.la \
../GEOMAlgo/libGEOMAlgo.la \
../ShHealOper/libShHealOper.la \
../ARCHIMEDE/libGEOMArchimede.la \
{
static QString lastUsedFilter;
QStringList filters;
- for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it )
+ QString aBrepFilter;
+ for ( FilterMap::const_iterator it = filterMap.begin(); it != filterMap.end(); ++it ) {
filters.push_back( it.key() );
+ if (it.key().contains("BREP", false)) {
+ aBrepFilter = it.key();
+ }
+ }
+
SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
if ( !caption.isEmpty() )
fd->setCaption( caption );
if ( !initial.isEmpty() )
fd->setSelection( initial );
+ fd->setFilters( filters );
+
if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
fd->setSelectedFilter( lastUsedFilter );
-
- fd->setFilters( filters );
+ else {
+ if (!aBrepFilter.isEmpty()) {
+ fd->setSelectedFilter(aBrepFilter);
+ }
+ }
fd->exec();
QString filename = fd->selectedFile();
const GEOM::ListOfGO& theRemoveIns,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials)
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
GEOM::GEOM_Object_var aGEOMObject;
Handle(GEOM_Object) anObject =
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
theLimit, theRemoveWebs, aMaterials,
+ theKeepNonlimitShapes,
/*PerformSelfIntersections*/Standard_True);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
const GEOM::ListOfGO& theRemoveIns,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials)
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
GEOM::GEOM_Object_var aGEOMObject;
Handle(GEOM_Object) anObject =
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
theLimit, theRemoveWebs, aMaterials,
+ theKeepNonlimitShapes,
/*PerformSelfIntersections*/Standard_False);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
const GEOM::ListOfGO& theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials);
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakePartitionNonSelfIntersectedShape (const GEOM::ListOfGO& theShapes,
const GEOM::ListOfGO& theTools,
const GEOM::ListOfGO& theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials);
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
(GEOM::GEOM_Object_ptr theShape,
- const CORBA::Double theTolerance)
+ const CORBA::Double theTolerance,
+ const CORBA::Boolean doKeepNonSolids)
{
GEOM::GEOM_Object_var aGEOMObject;
//Perform the gluing
Handle(GEOM_Object) anObject =
- GetOperations()->MakeGlueFaces(aShape, theTolerance);
+ GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
//if (!GetOperations()->IsDone() || anObject.IsNull())
// to allow warning
if (anObject.IsNull())
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
(GEOM::GEOM_Object_ptr theShape,
const CORBA::Double theTolerance,
- const GEOM::ListOfGO& theFaces)
+ const GEOM::ListOfGO& theFaces,
+ const CORBA::Boolean doKeepNonSolids)
{
GEOM::GEOM_Object_var aGEOMObject;
//Perform the gluing
Handle(GEOM_Object) anObject =
- GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces);
+ GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids);
//if (!GetOperations()->IsDone() || anObject.IsNull())
// to allow warning
if (anObject.IsNull())
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetInPlaceByHistory
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceByHistory
+ (GEOM::GEOM_Object_ptr theShapeWhere,
+ GEOM::GEOM_Object_ptr theShapeWhat)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theShapeWhere == NULL ||
+ theShapeWhat == NULL) return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShapeWhere = GetOperations()->GetEngine()->GetObject
+ (theShapeWhere->GetStudyID(), theShapeWhere->GetEntry());
+ Handle(GEOM_Object) aShapeWhat = GetOperations()->GetEngine()->GetObject
+ (theShapeWhat->GetStudyID(), theShapeWhat->GetEntry());
+
+ if (aShapeWhere.IsNull() ||
+ aShapeWhat.IsNull()) return aGEOMObject._retn();
+
+ //Get Shapes in place of aShapeWhat
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetInPlaceByHistory(aShapeWhere, aShapeWhat);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* GetSame
GEOM::GEOM_Object_ptr MakeCompound (const GEOM::ListOfGO& theShapes);
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance);
+ CORBA::Double theTolerance,
+ const CORBA::Boolean doKeepNonSolids);
GEOM::ListOfGO* GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance,
- const GEOM::ListOfGO& theFaces);
+ const GEOM::ListOfGO& theFaces,
+ const CORBA::Boolean doKeepNonSolids);
GEOM::ListOfGO* MakeExplode (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat);
+ GEOM::GEOM_Object_ptr GetInPlaceByHistory (GEOM::GEOM_Object_ptr theShapeWhere,
+ GEOM::GEOM_Object_ptr theShapeWhat);
+
GEOM::GEOM_Object_ptr GetSame (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat);
GEOM::GEOM_List_ptr theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- GEOM::GEOM_List_ptr theMaterials)
+ GEOM::GEOM_List_ptr theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
beginService( " GEOM_Superv_i::MakePartition" );
MESSAGE("GEOM_Superv_i::MakePartition");
dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theMaterials, myPOA).in());
if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) {
getBoolOp();
- GEOM::GEOM_Object_ptr anObj = myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
- aListImplKI->GetList(), aListImplRI->GetList(),
- theLimit, theRemoveWebs, aListImplM->GetList());
+ GEOM::GEOM_Object_ptr anObj =
+ myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
+ aListImplKI->GetList(), aListImplRI->GetList(),
+ theLimit, theRemoveWebs, aListImplM->GetList(),
+ theKeepNonlimitShapes);
endService( " GEOM_Superv_i::MakePartition" );
return anObj;
}
// MakeGlueFaces:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance)
+ CORBA::Double theTolerance,
+ CORBA::Boolean doKeepNonSolids)
{
beginService( " GEOM_Superv_i::MakeGlueFaces" );
MESSAGE("GEOM_Superv_i::MakeGlueFaces");
getShapesOp();
- GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFaces(theShape, theTolerance);
+ GEOM::GEOM_Object_ptr anObj =
+ myShapesOp->MakeGlueFaces(theShape, theTolerance, doKeepNonSolids);
endService( " GEOM_Superv_i::MakeGlueFaces" );
return anObj;
}
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance,
- const GEOM::ListOfGO& theFaces)
+ const GEOM::ListOfGO& theFaces,
+ CORBA::Boolean doKeepNonSolids)
{
beginService( " GEOM_Superv_i::MakeGlueFacesByList" );
MESSAGE("GEOM_Superv_i::MakeGlueFacesByList");
getShapesOp();
- GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces);
+ GEOM::GEOM_Object_ptr anObj =
+ myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids);
endService( " GEOM_Superv_i::MakeGlueFacesByList" );
return anObj;
}
GEOM::GEOM_List_ptr theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- GEOM::GEOM_List_ptr theMaterials);
+ GEOM::GEOM_List_ptr theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
GEOM::GEOM_Object_ptr thePlane);
GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
- CORBA::Double theTolerance);
+ CORBA::Double theTolerance,
+ CORBA::Boolean doKeepNonSolids);
GEOM::GEOM_List_ptr GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance);
GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
CORBA::Double theTolerance,
- const GEOM::ListOfGO& theFaces);
+ const GEOM::ListOfGO& theFaces,
+ CORBA::Boolean doKeepNonSolids);
GEOM::GEOM_List_ptr MakeExplode (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theShapeType,
CORBA::Boolean isSorted);
geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
- # GetInPlace(theShapeWhere, theShapeWhat)
+ # Prepare arguments for GetInPlace and GetInPlaceByHistory
box5 = geompy.MakeBoxDXDYDZ(100, 100, 100)
box6 = geompy.MakeTranslation(box5, 50, 50, 0)
+ geompy.addToStudy(box5, "Box 5")
+ geompy.addToStudy(box6, "Box 6")
+
+ part = geompy.MakePartition([box5], [box6])
+ geompy.addToStudy(part, "Partitioned")
+
+ box5_faces = geompy.SubShapeAll(box5, geompy.ShapeType["FACE"])
+ box6_faces = geompy.SubShapeAll(box6, geompy.ShapeType["FACE"])
+
+ ifa = 1
+ for aface in box5_faces:
+ geompy.addToStudyInFather(box5, aface, "Face" + `ifa`)
+ ifa = ifa + 1
+
+ ifa = 1
+ for aface in box6_faces:
+ geompy.addToStudyInFather(box6, aface, "Face" + `ifa`)
+ ifa = ifa + 1
+
+ # GetInPlace(theShapeWhere, theShapeWhat)
+ ibb = 5
+ faces_list = [box5_faces, box6_faces]
+ for afaces in faces_list:
+ ifa = 1
+ for aface in afaces:
+ if ibb == 6 and (ifa == 2 or ifa == 4):
+ # use IDL interface directly to avoid error message appearence in Python console
+ refl_box_face = geompy.ShapesOp.GetInPlace(part, aface)
+ if refl_box_face is not None:
+ geompy.addToStudyInFather(part, refl_box_face,
+ "Reflection of face " + `ifa` + " of box " + `ibb`)
+ error = "Result of GetInPlace must be NULL for face " + `ifa` + " of box " + `ibb`
+ raise RuntimeError, error
+ else:
+ # use geompy interface
+ refl_box_face = geompy.GetInPlace(part, aface)
+ geompy.addToStudyInFather(part, refl_box_face,
+ "Reflection of face " + `ifa` + " of box " + `ibb`)
+ ifa = ifa + 1
+ ibb = ibb + 1
+
+ # GetInPlaceByHistory(theShapeWhere, theShapeWhat)
part = geompy.MakePartition([box5], [box6])
geompy.addToStudy(part, "Partitioned")
ibb = 5
- box_list = [box5, box6]
- for abox in box_list:
- geompy.addToStudy(abox, "Box " + `ibb`)
- box_faces = geompy.SubShapeAll(abox, geompy.ShapeType["FACE"])
+ faces_list = [box5_faces, box6_faces]
+ for afaces in faces_list:
ifa = 1
- for aface in box_faces:
- geompy.addToStudyInFather(abox, aface, "Face" + `ifa`)
- refl_box_face = geompy.GetInPlace(part, aface)
- if refl_box_face is not None:
+ for aface in afaces:
+ if ibb == 6 and (ifa == 2 or ifa == 4):
+ # use IDL interface directly to avoid error message appearence in Python console
+ refl_box_face = geompy.ShapesOp.GetInPlaceByHistory(part, aface)
+ if refl_box_face is not None:
+ geompy.addToStudyInFather(part, refl_box_face,
+ "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
+ error = "Result of GetInPlaceByHistory must be NULL for face " + `ifa` + " of box " + `ibb`
+ raise RuntimeError, error
+ else:
+ # use geompy interface
+ refl_box_face = geompy.GetInPlaceByHistory(part, aface)
geompy.addToStudyInFather(part, refl_box_face,
- "Reflection of Face " + `ifa` + " of box " + `ibb`)
+ "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
ifa = ifa + 1
ibb = ibb + 1
addToStudy(t_boite, "t_boite")
-p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [])
+p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [], 0)
# Compound
# --------
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-# ===============================================================
-# Swig targets
-# ===============================================================
-# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
-#
-# Step 1: build the wrapping source files with swig
-#
-# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
-# libSALOME_Swig.py
-#
-# Step 2: build the dynamic library from cpp built source files and
-# dependant libraries.
-#
-# swig_wrap.cpp -- gcc --> swig_wrap.o |-- link --> _libSALOME_Swig.la
-# + |
-# dependant libs |
-#
-# The file libSALOME_Swigcmodule.py will be installed in
-# <prefix>/lib/python<version>/site-package/salome.
-# The library will be installed in the same place.
-#
-
-# this option puts it to dist
-#BUILT_SOURCES = swig_wrap.cpp
-
-SWIG_FLAGS = \
- @SWIG_FLAGS@ \
- -I$(srcdir) \
- -I$(srcdir)/../GEOMGUI
-
-SWIG_SOURCES = libGEOM_Swig.i
-
-# Libraries targets
-lib_LTLIBRARIES = libGEOM_Swigcmodule.la
-
-nodist_pkgpython_DATA = libGEOM_Swig.py
-libGEOM_Swig.py: swig_wrap.cpp
-
-libGEOM_Swigcmodule_la_SOURCES = \
- $(BUILT_SOURCES) \
- $(SWIG_SOURCES)
-
-nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
-
-#LIB_CLIENT_IDL = SALOMEDS.idl \
-# SALOMEDS_Attributes.idl \
-# SALOME_Exception.idl \
-# GEOM_Gen.idl \
-# SALOME_Component.idl \
-# SALOME_GenericObj.idl
EXPORT_SHAREDPYSCRIPTS=\
GEOM_shared_modules.py
-libGEOM_Swigcmodule_la_CPPFLAGS = \
- $(QT_INCLUDES) \
- $(PYTHON_INCLUDES) \
- $(CAS_CPPFLAGS) \
- $(VTK_INCLUDES) \
- $(OGL_INCLUDES) \
- $(KERNEL_CXXFLAGS) \
- $(GUI_CXXFLAGS) \
- $(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
- -I$(srcdir)/../GEOMGUI \
- -I$(top_builddir)/idl \
- -I$(top_builddir)/salome_adm/unix
-
-libGEOM_Swigcmodule_la_LDFLAGS = \
- ../GEOMGUI/libGEOM.la
-
-
-libGEOM_Swigcmodule_la_LIBADD = \
- $(PYTHON_LIBS)
-
-swig_wrap.cpp : $(SWIG_SOURCES)
- $(SWIG) $(SWIG_FLAGS) -o $@ $<
-
-CLEANFILES = \
- swig_wrap.cpp
-
#
# ===============================================================
# Files to be installed
# Scripts to be installed.
dist_salomescript_DATA= \
- libGEOM_Swig.py \
geompy.py \
geompyDC.py \
batchmode_geompy.py \
sharedpkgpython_PYTHON = \
GEOM_shared_modules.py
-
-install-exec-hook:\
- $(libdir)/_libGEOM_Swig.so
-
-$(libdir)/_libGEOM_Swig.so:
- ( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
return MakeBoolean(s1, s2, 4)
def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if BoolOp.IsDone() == 0:
print "MakePartition : ", BoolOp.GetErrorCode()
return anObj
def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
return anObj
def MakeHalfPartition(theShape, thePlane):
# @param theSeqSubBases - list of corresponding subshapes of section shapes.
# @param theLocations - list of locations on the path corresponding
# specified list of the Bases shapes. Number of locations
- # should be equal to number of bases or list of locations can be empty.
+ # should be equal to number of bases. First and last
+ # locations must be coincided with first and last vertexes
+ # of path correspondingly.
# @param thePath - Path shape to extrude the base shape along it.
# @param theWithContact - the mode defining that the section is translated to be in
# contact with the spine.
print "GetInPlace : ", self.ShapesOp.GetErrorCode()
return anObj
+ ## Get sub-shape(s) of \a theShapeWhere, which are
+ # coincident with \a theShapeWhat or could be a part of it.
+ #
+ # Implementation of this method is based on a saved history of an operation,
+ # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
+ # arguments (an argument shape or a sub-shape of an argument shape).
+ # The operation could be the Partition or one of boolean operations,
+ # performed on simple shapes (not on compounds).
+ #
+ # @param theShapeWhere Shape to find sub-shapes of.
+ # @param theShapeWhat Shape, specifying what to find (must be in the
+ # building history of the ShapeWhere).
+ # @return Group of all found sub-shapes or a single found sub-shape.
+ #
+ # Example: see GEOM_TestOthers.py
+ def GetInPlaceByHistory(theShapeWhere, theShapeWhat):
+ anObj = ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
+ if ShapesOp.IsDone() == 0:
+ print "GetInPlace : ", ShapesOp.GetErrorCode()
+ return anObj
+
## Get sub-shape of theShapeWhere, which is
# equal to \a theShapeWhat.
# @param theShapeWhere Shape to find sub-shape of.
## Replace coincident faces in theShape by one face.
# @param theShape Initial shape.
# @param theTolerance Maximum distance between faces, which can be considered as coincident.
+ # @param doKeepNonSolids If FALSE, only solids will present in the result,
+ # otherwise all initial shapes.
# @return New GEOM_Object, containing a copy of theShape without coincident faces.
#
# Example: see GEOM_Spanner.py
- def MakeGlueFaces(self,theShape, theTolerance):
- anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance)
+ def MakeGlueFaces(theShape, theTolerance, doKeepNonSolids=True):
+ anObj = ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
if self.ShapesOp.IsDone() == 0:
print "MakeGlueFaces : ", self.ShapesOp.GetErrorCode()
return anObj
# @return ListOfGO.
#
# Example: see GEOM_Spanner.py
- def GetGlueFaces(self,theShape, theTolerance):
+ def GetGlueFaces(self, theShape, theTolerance):
anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
if self.ShapesOp.IsDone() == 0:
print "GetGlueFaces : ", self.ShapesOp.GetErrorCode()
# @param theTolerance Maximum distance between faces,
# which can be considered as coincident.
# @param theFaces List of faces for gluing.
+ # @param doKeepNonSolids If FALSE, only solids will present in the result,
+ # otherwise all initial shapes.
# @return New GEOM_Object, containing a copy of theShape
# without some faces.
#
# Example: see GEOM_Spanner.py
- def MakeGlueFacesByList(self,theShape, theTolerance, theFaces):
- anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces)
+ def MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids=True):
+ anObj = ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
if self.ShapesOp.IsDone() == 0:
print "MakeGlueFacesByList : ", self.ShapesOp.GetErrorCode()
return anObj
# in order to avoid possible intersection between shapes from
# this compound.
# @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+ # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+ # type <= Limit are kept in the result,
+ # else - shapes with type > Limit are kept
+ # also (if they exist)
#
# After implementation new version of PartitionAlgo (October 2006)
# other parameters are ignored by current functionality. They are kept
#
# Example: see GEOM_TestAll.py
def MakePartition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if self.BoolOp.IsDone() == 0:
print "MakePartition : ", self.BoolOp.GetErrorCode()
return anObj
#
# @return New GEOM_Object, containing the result shapes.
#
- def MakePartitionNonSelfIntersectedShape(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[],
+ ListKeepInside=[], ListRemoveInside=[],
+ Limit=ShapeType["SHAPE"], RemoveWebs=0,
+ ListMaterials=[], KeepNonlimitShapes=0):
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if self.BoolOp.IsDone() == 0:
print "MakePartitionNonSelfIntersectedShape : ", self.BoolOp.GetErrorCode()
return anObj
#
# Example: see GEOM_TestOthers.py
def Partition(self,ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = self.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
return anObj
## Perform partition of the Shape with the Plane
+++ /dev/null
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : libGeometry_Swig.i
-// Created : Tue Mar 26 15:04:48 2002
-// Author : Nicolas REJNERI, Paul RASCLE
-// Project : SALOME
-// Module : GEOM
-// Copyright : Open CASCADE, EDF 2002
-// $Header$
-
-%module libGEOM_Swig
-
-%include "GeometryGUI_Swig.i"
-
--- /dev/null
+# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+#
+# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+#
+#
+# File : Makefile.in
+# Author : Nicolas REJNERI, Paul RASCLE
+# Modified by : Alexander BORODIN (OCN) - autotools usage
+# Module : GEOM
+# $Header$
+
+
+# Libraries targets
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# ===============================================================
+# Swig targets
+# ===============================================================
+# (cf. http://www.geocities.com/foetsch/python/swig_linux.htm)
+#
+# Step 1: build the wrapping source files with swig
+#
+# libSALOME_LifeCycleCORBA.i -- swig --> swig_wrap.cpp
+# libSALOME_Swig.py
+#
+# Step 2: build the dynamic library from cpp built source files and
+# dependant libraries.
+#
+# swig_wrap.cpp -- gcc --> swig_wrap.o |-- link --> _libSALOME_Swig.la
+# + |
+# dependant libs |
+#
+# The file libSALOME_Swigcmodule.py will be installed in
+# <prefix>/lib/python<version>/site-package/salome.
+# The library will be installed in the same place.
+#
+
+# this option puts it to dist
+#BUILT_SOURCES = swig_wrap.cpp
+
+SWIG_FLAGS = \
+ @SWIG_FLAGS@ \
+ -I$(srcdir) \
+ -I$(srcdir)/../GEOMGUI
+
+SWIG_SOURCES = libGEOM_Swig.i
+
+# Libraries targets
+lib_LTLIBRARIES = libGEOM_Swigcmodule.la
+
+nodist_pkgpython_DATA = libGEOM_Swig.py
+libGEOM_Swig.py: swig_wrap.cpp
+
+libGEOM_Swigcmodule_la_SOURCES = \
+ $(BUILT_SOURCES) \
+ $(SWIG_SOURCES)
+
+nodist_libGEOM_Swigcmodule_la_SOURCES = swig_wrap.cpp
+
+#LIB_CLIENT_IDL = SALOMEDS.idl \
+# SALOMEDS_Attributes.idl \
+# SALOME_Exception.idl \
+# GEOM_Gen.idl \
+# SALOME_Component.idl \
+# SALOME_GenericObj.idl
+
+libGEOM_Swigcmodule_la_CPPFLAGS = \
+ $(QT_INCLUDES) \
+ $(PYTHON_INCLUDES) \
+ $(CAS_CPPFLAGS) \
+ $(VTK_INCLUDES) \
+ $(OGL_INCLUDES) \
+ $(KERNEL_CXXFLAGS) \
+ $(GUI_CXXFLAGS) \
+ $(CORBA_CXXFLAGS) \
+ $(CORBA_INCLUDES) \
+ -I$(srcdir)/../GEOMGUI \
+ -I$(top_builddir)/idl \
+ -I$(top_builddir)/salome_adm/unix
+
+libGEOM_Swigcmodule_la_LDFLAGS = \
+ ../GEOMGUI/libGEOM.la
+
+
+libGEOM_Swigcmodule_la_LIBADD = \
+ $(PYTHON_LIBS)
+
+swig_wrap.cpp : $(SWIG_SOURCES)
+ $(SWIG) $(SWIG_FLAGS) -o $@ $<
+
+CLEANFILES = \
+ swig_wrap.cpp
+
+#
+# ===============================================================
+# Files to be installed
+# ===============================================================
+#
+
+# Scripts to be installed.
+dist_salomescript_DATA= \
+ libGEOM_Swig.py
+
+install-exec-hook:\
+ $(libdir)/_libGEOM_Swig.so
+
+$(libdir)/_libGEOM_Swig.so:
+ ( cd $(libdir); ln -sf libGEOM_Swigcmodule.so _libGEOM_Swig.so; )
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : libGeometry_Swig.i
+// Created : Tue Mar 26 15:04:48 2002
+// Author : Nicolas REJNERI, Paul RASCLE
+// Project : SALOME
+// Module : GEOM
+// Copyright : Open CASCADE, EDF 2002
+// $Header$
+
+%module libGEOM_Swig
+
+%include "GeometryGUI_Swig.i"
+
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
-#include <BRepPrimAPI_MakePrism.hxx>
-#include <BRepAdaptor_Curve.hxx>
-#include <gp_Lin.hxx>
-#include "GEOMImpl_Types.hxx"
-
#include <qlabel.h>
#include <qcheckbox.h>
+#include "GEOMImpl_Types.hxx"
+
#include "utilities.h"
//=================================================================================
// class : GenerationGUI_PrismDlg()
-// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
+// purpose : Constructs a GenerationGUI_PrismDlg 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.
//=================================================================================
GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PRISM_2P")));
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+ QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM_2P")));
setCaption(tr("GEOM_EXTRUSION_TITLE"));
GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
RadioButton1->setPixmap(image0);
RadioButton2->setPixmap(image2);
- //RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
+ RadioButton1->setChecked(true);
+
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
GroupPoints->CheckButton1->hide();
GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
setHelpFileName("extrusion.htm");
- /* Initialisations */
Init();
}
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
GenerationGUI_PrismDlg::~GenerationGUI_PrismDlg()
-{
- /* no need to delete child widgets, Qt does it all for us */
+{
+ // no need to delete child widgets, Qt does it all for us
}
GroupPoints2->LineEdit2->setReadOnly( true );
GroupPoints2->LineEdit3->setReadOnly( true );
- //myOkBase = myOkVec = false;
+ myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
-
+
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
/* signals and slots connections */
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
+ connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName(tr("GEOM_EXTRUSION"));
-
- globalSelection( GEOM_ALLSHAPES );
ConstructorsClicked(0);
}
//=================================================================================
void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
+ erasePreview();
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
switch (constructorId)
+ {
+ case 0:
{
- case 0:
- {
- globalSelection( GEOM_POINT );
-
- GroupPoints2->hide();
- resize(0, 0);
- GroupPoints->show();
-
- //GroupPoints->LineEdit1->setFocus();
- //myEditCurrentArgument = GroupPoints->LineEdit1;
- //displayPreview();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText("");
- GroupPoints->LineEdit2->setText("");
- GroupPoints2->LineEdit1->setText("");
- GroupPoints2->LineEdit2->setText("");
- GroupPoints2->LineEdit3->setText("");
- myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
- myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
-
- break;
- }
- case 1:
- {
- GroupPoints->hide();
- resize(0, 0);
- GroupPoints2->show();
-
- myEditCurrentArgument = GroupPoints2->LineEdit1;
- GroupPoints2->LineEdit1->setText("");
- GroupPoints2->LineEdit2->setText("");
- GroupPoints2->LineEdit3->setText("");
- myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
- myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
- GroupPoints->LineEdit1->setText("");
- GroupPoints->LineEdit2->setText("");
-
- break;
- }
+ globalSelection( GEOM_ALLSHAPES );
+
+ GroupPoints2->hide();
+ resize(0, 0);
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText(GroupPoints2->LineEdit1->text()); // keep base
+ GroupPoints->LineEdit2->setText("");
+ myVec = GEOM::GEOM_Object::_nil();
+ myOkVec = false;
+
+ break;
}
- displayPreview();
+ case 1:
+ {
+ globalSelection( GEOM_ALLSHAPES );
+
+ GroupPoints->hide();
+ resize(0, 0);
+ GroupPoints2->show();
+
+ myEditCurrentArgument = GroupPoints2->LineEdit1;
+ GroupPoints2->LineEdit1->setText(GroupPoints->LineEdit1->text()); // keep base
+ GroupPoints2->LineEdit2->setText("");
+ GroupPoints2->LineEdit3->setText("");
+ myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
+ myOkPnt1 = myOkPnt2 = false;
+
+ break;
+ }
+ }
+
+ myEditCurrentArgument->setFocus();
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ if (!myOkBase)
+ SelectionIntoArgument();
}
erasePreview();
myEditCurrentArgument->setText("");
- if ( getConstructorId()==0 ) {
-
+ if (getConstructorId() == 0)
+ {
if (IObjectCount() != 1) {
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkBase = false;
myVec = aSelectedObject;
myOkVec = true;
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
- displayPreview();
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
}
-
- else { // getConstructorId()==1 - extrusion using 2 points
-
+ else // getConstructorId()==1 - extrusion using 2 points
+ {
if (IObjectCount() != 1) {
if (myEditCurrentArgument == GroupPoints2->LineEdit1)
myOkBase = false;
myOkPnt2 = true;
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ }
+
+ displayPreview();
+}
- displayPreview();
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void GenerationGUI_PrismDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if (send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2 ||
+ send == GroupPoints2->LineEdit1 ||
+ send == GroupPoints2->LineEdit2 ||
+ send == GroupPoints2->LineEdit3 )
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
}
}
void GenerationGUI_PrismDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- globalSelection( GEOM_ALLSHAPES );
- if(send == GroupPoints->PushButton1) {
+ if (send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
+ globalSelection( GEOM_ALLSHAPES );
}
- else if(send == GroupPoints->PushButton2) {
+ else if (send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_LINE );
}
- else if(send == GroupPoints2->PushButton1) {
+ else if (send == GroupPoints2->PushButton1) {
GroupPoints2->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit1;
+ globalSelection( GEOM_ALLSHAPES );
}
- else if(send == GroupPoints2->PushButton2) {
+ else if (send == GroupPoints2->PushButton2) {
GroupPoints2->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit2;
globalSelection( GEOM_POINT );
}
- else if(send == GroupPoints2->PushButton3) {
+ else if (send == GroupPoints2->PushButton3) {
GroupPoints2->LineEdit3->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit3;
globalSelection( GEOM_POINT );
}
+
+ myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
//=================================================================================
-// function : LineEditReturnPressed()
+// function : ActivateThisDialog()
// purpose :
//=================================================================================
-void GenerationGUI_PrismDlg::LineEditReturnPressed()
+void GenerationGUI_PrismDlg::ActivateThisDialog()
{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2 ||
- send == GroupPoints2->LineEdit1 ||
- send == GroupPoints2->LineEdit2 ||
- send == GroupPoints2->LineEdit3 )
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ GEOMBase_Skeleton::ActivateThisDialog();
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ ConstructorsClicked( getConstructorId() );
}
+
//=================================================================================
// function : enterEvent()
// purpose : when mouse enter onto the QWidget
//=================================================================================
void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
{
- if ( !GroupConstructors->isEnabled() )
+ if (!GroupConstructors->isEnabled())
ActivateThisDialog();
}
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void GenerationGUI_PrismDlg::ActivateThisDialog()
-{
- GEOMBase_Skeleton::ActivateThisDialog();
- globalSelection( GEOM_ALLSHAPES );
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- //GroupPoints->LineEdit1->setFocus();
- //myEditCurrentArgument = GroupPoints->LineEdit1;
- //displayPreview();
- ConstructorsClicked( getConstructorId() );
-}
-
-
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
bool GenerationGUI_PrismDlg::isValid( QString& )
{
- return myOkBase && ( myOkVec || (myOkPnt1 && myOkPnt2) );
+ if (getConstructorId() == 0)
+ // by vector and height
+ return (myOkBase && myOkVec);
+
+ // by two points
+ return (myOkBase && myOkPnt1 && myOkPnt2);
}
//=================================================================================
{
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
- case 0 :
- {
+ case 0:
+ {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismVecH(myBase, myVec, getHeight());
break;
}
- case 1 :
+ case 1:
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismTwoPnt(myBase, myPoint1, myPoint2);
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
virtual bool isValid( QString& msg );
virtual bool execute( ObjectList& objects );
-private :
+private:
void Init();
void enterEvent(QEvent* e);
double getHeight() const;
-
+
GEOM::GEOM_Object_var myBase; /* Base shape */
GEOM::GEOM_Object_var myVec; /* Vector, defining the direction */
- GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
-
+ GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points for extrusion */
+
bool myOkBase;
bool myOkVec;
bool myOkPnt1;
private slots:
void ClickOnOk();
bool ClickOnApply();
+
void ActivateThisDialog();
+ void ConstructorsClicked(int);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
- void ConstructorsClicked(int);
void ValueChangedInSpinBox();
void onReverse();
};
double SpecificStep = 5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(45.0);
/* signals and slots connections */
#include <TopAbs_ShapeEnum.hxx>
+class QGroupBox;
class QLineEdit;
class QListBox;
GEOM::GEOM_Object_var myMainObj;
GEOM::GEOM_Object_var myGroup;
+ QGroupBox* GroupMedium;
QPushButton* mySelBtn;
QLineEdit* myMainName;
QPushButton* mySelSubBtn;
# Module : GEOM
# $Header$
-SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_I_Superv GEOM_SWIG
+SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport STLExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG
+
+if GEOM_ENABLE_GUI
+ SUBDIRS+= OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM
+endif
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "MeasureGUI_CenterMassDlg.h"
#include "MeasureGUI_1Sel3LineEdit_QTD.h"
+#include "DlgRef_SpinBox.h"
+
#include "utilities.h"
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
getParameters( x, y, z );
myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
- myGrp->LineEdit2->setText( QString( "%1" ).arg( x ) );
- myGrp->LineEdit3->setText( QString( "%1" ).arg( y ) );
- myGrp->LineEdit4->setText( QString( "%1" ).arg( z ) );
+ myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( x ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( y ) );
+ myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( z ) );
displayPreview();
}
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "MeasureGUI_2Sel1LineEdit_QTD.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "DlgRef_SpinBox.h"
#include "SUIT_Session.h"
#include "SUIT_ViewWindow.h"
mySelEdit = myGrp->LineEdit1;
mySelBtn2 = myGrp->PushButton2;
mySelEdit2 = myGrp->LineEdit2;
-
+
myEditCurrentArgument = mySelEdit;
connect( mySelEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
MeasureGUI_Skeleton::Init();
-
}
double aDist = 0.;
if ( getParameters( aDist, aPnt1, aPnt2 ) )
{
- myGrp->LineEdit3->setText( QString( "%1" ).arg( aDist ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( aDist ) );
redisplayPreview();
}
else
myGrp->LineEdit3->setText( "" );
erasePreview();
}
-
}
//=================================================================================
{
double aDist = 0.;
gp_Pnt aPnt1( 0, 0, 0 ), aPnt2( 0, 0, 0 );
-
- if ( myObj->_is_nil() || myObj2->_is_nil() || !getParameters( aDist, aPnt1, aPnt2 ) ||
- SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
- != OCCViewer_Viewer::Type() )
+
+ SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+
+ if ( myObj->_is_nil() || myObj2->_is_nil() ||
+ !getParameters( aDist, aPnt1, aPnt2 ) ||
+ vw->getViewManager()->getType() != OCCViewer_Viewer::Type() )
return 0;
-
+
try
{
if( aDist <= 1.e-9 )
( aPnt1.Y() + aPnt2.Y() ) / 2,
( aPnt1.Z() + aPnt2.Z() ) / 2 + 100 );
-
gp_Vec va( aPnt3, aPnt1 );
gp_Vec vb( aPnt3, aPnt2 );
aPnt3.SetY( ( aPnt1.Y() + aPnt2.Y() ) / 2 + 100 );
aPnt3.SetZ( ( aPnt1.Z() + aPnt2.Z() ) / 2 );
}
-
+
gce_MakePln gce_MP( aPnt1, aPnt2, aPnt3 );
Handle( Geom_Plane ) P = new Geom_Plane( gce_MP.Value() );
- Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension(
- aVert1, aVert2, P, aDist, TCollection_ExtendedString( (Standard_CString)aLabel.latin1() ) );
+ Handle( AIS_LengthDimension ) anIO = new AIS_LengthDimension
+ (aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.latin1()));
- SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
- SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
-
- //QAD_ViewFrame* vf = GEOM_Displayer::GetActiveView();
- //OCCViewer_Prs* aPrs = dynamic_cast<OCCViewer_Prs*>( vf->CreatePrs( 0 ) );
+ SOCC_Prs* aPrs =
+ dynamic_cast<SOCC_Prs*>( ((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs( 0 ) );
if ( aPrs )
aPrs->AddObject( anIO );
{
return MeasureGUI_Skeleton::isValid( msg ) && !myObj2->_is_nil();
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
return getOperation()->IsDone();
}
}
-
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
return getOperation()->IsDone();
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include "MeasureGUI_PointDlg.h"
#include "GEOMBase.h"
+#include "DlgRef_SpinBox.h"
+
#include "utilities.h"
+
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
//=================================================================================
// class : MeasureGUI_PointDlg()
// purpose : Constructs a MeasureGUI_PointDlg which is a child of 'parent'
-//
//=================================================================================
MeasureGUI_PointDlg::MeasureGUI_PointDlg( GeometryGUI* GUI, QWidget* parent )
: MeasureGUI_Skeleton( GUI, parent, "MeasureGUI_PointDlg" )
{
QPixmap iconPnt( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_DLG_POINT" ) ) );
-
+
QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap(
"GEOM",tr( "ICON_SELECT" ) ) );
RadioButton1->setPixmap( iconPnt );
QGroupBox* aGrp = new QGroupBox( 2, Qt::Horizontal, tr( "COORDINATES" ), this );
-
+
new QLabel( tr( "POINT" ), aGrp );
QFrame* aFrame = new QFrame( aGrp );
mySelBtn = new QPushButton( aFrame );
//=================================================================================
// function : ~MeasureGUI_PointDlg()
// purpose : Destroys the object and frees any allocated resources
-//======================myX->setReadOnly( true );===========================================================
+//=================================================================================
MeasureGUI_PointDlg::~MeasureGUI_PointDlg()
{
}
TopTools_IndexedMapOfShape aShapes;
TopExp::MapShapes( aShape, aShapes );
-
+
if ( aShape != aShapes( i ) )
aName += QString( ":%1" ).arg( i );
{
gp_Pnt aPnt = BRep_Tool::Pnt( aPoint );
mySelEdit->setText( aName );
- myX->setText( QString( "%1" ).arg( aPnt.X() ) );
- myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
- myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
+ myX->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.X()));
+ myY->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Y()));
+ myZ->setText(DlgRef_SpinBox::PrintDoubleValue(aPnt.Z()));
}
}
catch( ... )
myZ->setText( "" );
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include "GEOM_Displayer.h"
#include "GEOMImpl_Types.hxx"
#include "GEOMBase.h"
+#include "DlgRef_SpinBox.h"
#include "SalomeApp_Tools.h"
#include "utilities.h"
}
else
{
- myGrp->LineEdit2->setText( QString( "%1" ).arg( aLength ) );
- myGrp->LineEdit3->setText( QString( "%1" ).arg( anArea ) );
- myGrp->LineEdit4->setText( QString( "%1" ).arg( aVolume ) );
+ myGrp->LineEdit2->setText( DlgRef_SpinBox::PrintDoubleValue( aLength ) );
+ myGrp->LineEdit3->setText( DlgRef_SpinBox::PrintDoubleValue( anArea ) );
+ myGrp->LineEdit4->setText( DlgRef_SpinBox::PrintDoubleValue( aVolume ) );
}
}
return getDisplayer()->BuildPrs( aResult );
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
myGeomGUI( GUI )
{
-
mySelBtn = 0;
mySelEdit = 0;
myDisplayer = 0;
myHelpFileName = "";
-
+
if ( !name )
setName( "MeasureGUI_Skeleton" );
buttonClose->setAutoDefault( false );
- GroupMedium->close( TRUE );
resize( 350, 0 );
}
/****************************************************************************
** Form implementation generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
**
-** Created: Tue Mar 21 10:10:08 2006
+** Created: Tue Mar 13 14:20:24 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
Layout1->addWidget( GroupConstructors, 0, 0 );
- GroupMedium = new QGroupBox( this, "GroupMedium" );
- GroupMedium->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, GroupMedium->sizePolicy().hasHeightForWidth() ) );
-
- Layout1->addWidget( GroupMedium, 1, 0 );
-
MeasureGUI_Skeleton_QTDLayout->addLayout( Layout1, 0, 0 );
languageChange();
resize( QSize(228, 266).expandedTo(minimumSizeHint()) );
*/
void MeasureGUI_Skeleton_QTD::languageChange()
{
- setCaption( tr( "MeasureGUI_Skeleton_QTD" ) );
- GroupButtons->setTitle( QString::null );
- buttonClose->setText( tr( "&Close" ) );
- buttonHelp->setText( tr( "&Help" ) );
- GroupConstructors->setTitle( QString::null );
- RadioButton1->setText( QString::null );
- GroupMedium->setTitle( QString::null );
}
/****************************************************************************
** Form interface generated from reading ui file 'MeasureGUI_Skeleton_QTD.ui'
**
-** Created: Tue Mar 21 10:10:08 2006
+** Created: Tue Mar 13 14:20:20 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
QPushButton* buttonHelp;
QButtonGroup* GroupConstructors;
QRadioButton* RadioButton1;
- QGroupBox* GroupMedium;
protected:
QGridLayout* MeasureGUI_Skeleton_QTDLayout;
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="caption">
- <string>MeasureGUI_Skeleton_QTD</string>
- </property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string></string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>buttonClose</cstring>
</property>
- <property name="text">
- <string>&Close</string>
- </property>
</widget>
<widget class="QPushButton" row="0" column="2">
<property name="name">
<cstring>buttonHelp</cstring>
</property>
- <property name="text">
- <string>&Help</string>
- </property>
</widget>
</grid>
</widget>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title">
- <string></string>
- </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<property name="name">
<cstring>RadioButton1</cstring>
</property>
- <property name="text">
- <string></string>
- </property>
</widget>
</hbox>
</widget>
</grid>
</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>
- </property>
- <property name="title">
- <string></string>
- </property>
- </widget>
</grid>
</widget>
</grid>
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TCollection_MapNode_HeaderFile
+#include <Handle_TCollection_MapNode.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TCollection_MapNode);
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger);
+
+class Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) : public Handle(TCollection_MapNode) {
+ public:
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)():Handle(TCollection_MapNode)() {}
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle)
+ {
+ }
+
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
+ {
+ }
+
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle)
+ {
+ Assign(aHandle.Access());
+ return *this;
+ }
+
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem)
+ {
+ Assign((Standard_Transient *)anItem);
+ return *this;
+ }
+
+ NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* operator->() const
+ {
+ return (NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger *)ControlAccess();
+ }
+
+// Standard_EXPORT ~Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)();
+
+ Standard_EXPORT static const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
# header files
salomeinclude_HEADERS = \
+ Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
Handle_NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \
NMTDS_CArray1OfIndexRange.hxx \
+ NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx \
+ NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
+ NMTDS_DataMapOfIntegerMapOfInteger.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
NMTDS_IndexedDataMapOfIntegerShape.hxx \
NMTDS_IndexedDataMapOfShapeBox.hxx \
NMTDS_IndexRange.hxx \
+ NMTDS_InterfPool.hxx \
+ NMTDS_InterfType.hxx \
NMTDS_Iterator.hxx \
+ NMTDS_IteratorCheckerSI.hxx \
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx \
NMTDS_ListIteratorOfListOfPassKey.hxx \
NMTDS_MapOfPassKeyBoolean.hxx \
NMTDS_MapOfPassKey.hxx \
NMTDS_PassKeyBoolean.hxx \
+ NMTDS_PInterfPool.hxx \
+ NMTDS_PIterator.hxx \
NMTDS_PassKey.hxx \
NMTDS_PassKeyMapHasher.hxx \
+ NMTDS_PassKeyShape.hxx \
+ NMTDS_PassKeyShapeMapHasher.hxx \
NMTDS_PShapesDataStructure.hxx \
NMTDS_ShapesDataStructure.hxx \
NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
NMTDS_StdMapNodeOfMapOfPassKey.hxx \
+ NMTDS_Tools.hxx \
NMTDS_BoxBndTree.hxx
# Libraries targets
dist_libNMTDS_la_SOURCES = \
NMTDS_CArray1OfIndexRange_0.cxx \
+ NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx \
+ NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx \
+ NMTDS_DataMapOfIntegerMapOfInteger_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
NMTDS_IndexedDataMapOfIntegerShape_0.cxx \
NMTDS_IndexedDataMapOfShapeBox_0.cxx \
NMTDS_IndexRange.cxx \
+ NMTDS_InterfPool.cxx \
NMTDS_Iterator.cxx \
+ NMTDS_IteratorCheckerSI.cxx \
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \
NMTDS_ListIteratorOfListOfPassKey_0.cxx \
NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \
NMTDS_PassKeyBoolean.cxx \
NMTDS_PassKey.cxx \
NMTDS_PassKeyMapHasher.cxx \
+ NMTDS_PassKeyShape.cxx \
+ NMTDS_PassKeyShapeMapHasher.cxx \
NMTDS_ShapesDataStructure.cxx \
NMTDS_StdMapNodeOfMapOfPassKey_0.cxx \
NMTDS_StdMapNodeOfMapOfPassKeyBoolean_0.cxx \
+ NMTDS_Tools.cxx \
NMTDS_BoxBndTree.cxx
# additionnal information to compil and link file
---Purpose:
uses
-
TCollection,
TColStd,
Bnd,
TopoDS,
TopAbs,
TopTools,
- BooleanOperations,
- BOPTColStd
+ BooleanOperations,
+ BOPTools,
+ BOPTColStd
+
is
+ enumeration InterfType is
+ TI_VV,
+ TI_VE,
+ TI_VF,
+ TI_EE,
+ TI_EF,
+ TI_FF,
+ TI_UNKNOWN
+ end InterfType;
+ --
class ShapesDataStructure;
class IndexRange;
-- Modified to Add new classes Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
class Iterator;
+
class PassKey;
class PassKeyBoolean;
class PassKeyMapHasher;
-- Contribution of Samtech www.samcef.com END
-
+ class PassKeyShape;
+ class PassKeyShapeMapHasher;
+ --modified by NIZNHY-PKV Tue Feb 6 10:40:02 2007f
+ class IteratorCheckerSI;
+ class Tools;
+ class InterfPool;
+ --modified by NIZNHY-PKV Tue Feb 6 10:40:04 2007t
pointer PShapesDataStructure to ShapesDataStructure from NMTDS;
-
+ pointer PIterator to Iterator from NMTDS;
+ pointer PInterfPool to InterfPool from NMTDS;
+
class CArray1OfIndexRange instantiates
CArray1 from BOPTColStd(IndexRange from NMTDS);
PassKeyMapHasher from NMTDS);
-- Contribution of Samtech www.samcef.com END
-
+--modified by NIZNHY-PKV Tue Oct 10 11:19:06 2006f
class IndexedDataMapOfShapeBox
instantiates IndexedDataMap from TCollection (Shape from TopoDS,
Box from Bnd,
instantiates IndexedDataMap from TCollection (Integer from Standard,
Shape from TopoDS,
MapIntegerHasher from TColStd);
+
+ class DataMapOfIntegerMapOfInteger
+ instantiates DataMap from TCollection (Integer from Standard,
+ MapOfInteger from TColStd,
+ MapIntegerHasher from TColStd);
+--modified by NIZNHY-PKV Tue Oct 10 11:19:08 2006t
end NMTDS;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMapIterator_HeaderFile
+#include <TCollection_BasicMapIterator.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger : public TCollection_BasicMapIterator {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger();
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& aMap);
+
+
+Standard_EXPORT void Initialize(const NMTDS_DataMapOfIntegerMapOfInteger& aMap) ;
+
+
+Standard_EXPORT const Standard_Integer& Key() const;
+
+
+Standard_EXPORT const TColStd_MapOfInteger& Value() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapIterator.gxx>
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TCollection_MapNode_HeaderFile
+#include <TCollection_MapNode.hxx>
+#endif
+#ifndef _TCollection_MapNodePtr_HeaderFile
+#include <TCollection_MapNodePtr.hxx>
+#endif
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger : public TCollection_MapNode {
+
+public:
+ // Methods PUBLIC
+ //
+
+NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger(const Standard_Integer& K,const TColStd_MapOfInteger& I,const TCollection_MapNodePtr& n);
+
+ Standard_Integer& Key() const;
+
+ TColStd_MapOfInteger& Value() const;
+//Standard_EXPORT ~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+Standard_Integer myKey;
+TColStd_MapOfInteger myValue;
+
+
+};
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#include <TCollection_DataMapNode.lxx>
+
+#undef TheKey
+#undef TheKey_hxx
+#undef TheItem
+#undef TheItem_hxx
+#undef Hasher
+#undef Hasher_hxx
+#undef TCollection_DataMapNode
+#undef TCollection_DataMapNode_hxx
+#undef TCollection_DataMapIterator
+#undef TCollection_DataMapIterator_hxx
+#undef Handle_TCollection_DataMapNode
+#undef TCollection_DataMapNode_Type_
+#undef TCollection_DataMap
+#undef TCollection_DataMap_hxx
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+//NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+
+
+
+Standard_EXPORT Handle_Standard_Type& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+{
+
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+ static Handle_Standard_Type _aType = new Standard_Type("NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger",
+ sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
+
+ return _aType;
+}
+
+
+// DownCast method
+// allow safe downcasting
+//
+const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)::DownCast(const Handle(Standard_Transient)& AnObject)
+{
+ Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) _anOtherObject;
+
+ if (!AnObject.IsNull()) {
+ if (AnObject->IsKind(STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger))) {
+ _anOtherObject = Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)((Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)&)AnObject);
+ }
+ }
+
+ return _anOtherObject ;
+}
+const Handle(Standard_Type)& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::DynamicType() const
+{
+ return STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) ;
+}
+//Standard_Boolean NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::IsKind(const Handle(Standard_Type)& AType) const
+//{
+// return (STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) == AType || TCollection_MapNode::IsKind(AType));
+//}
+//Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapNode.gxx>
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMap_HeaderFile
+#include <TCollection_BasicMap.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class Standard_DomainError;
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapOfIntegerMapOfInteger : public TCollection_BasicMap {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const Standard_Integer NbBuckets = 1);
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger& Assign(const NMTDS_DataMapOfIntegerMapOfInteger& Other) ;
+ NMTDS_DataMapOfIntegerMapOfInteger& operator =(const NMTDS_DataMapOfIntegerMapOfInteger& Other)
+{
+ return Assign(Other);
+}
+
+
+
+Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
+
+
+Standard_EXPORT void Clear() ;
+~NMTDS_DataMapOfIntegerMapOfInteger()
+{
+ Clear();
+}
+
+
+
+Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const TColStd_MapOfInteger& I) ;
+
+
+Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const;
+
+
+Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ;
+
+
+Standard_EXPORT const TColStd_MapOfInteger& Find(const Standard_Integer& K) const;
+ const TColStd_MapOfInteger& operator()(const Standard_Integer& K) const
+{
+ return Find(K);
+}
+
+
+
+Standard_EXPORT TColStd_MapOfInteger& ChangeFind(const Standard_Integer& K) ;
+ TColStd_MapOfInteger& operator()(const Standard_Integer& K)
+{
+ return ChangeFind(K);
+}
+
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other);
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_DomainError_HeaderFile
+#include <Standard_DomainError.hxx>
+#endif
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMap.gxx>
+
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTDS_InterfPool.cdl
+-- Created: Wed Feb 21 10:10:58 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+---Copyright: Matra Datavision 2007
+
+
+class InterfPool from NMTDS
+
+ ---Purpose:
+
+uses
+ MapOfPassKeyBoolean from NMTDS,
+ ListOfPassKeyBoolean from NMTDS,
+ PassKeyBoolean from NMTDS,
+ InterfType from NMTDS,
+ --
+ CArray1OfSSInterference from BOPTools,
+ CArray1OfESInterference from BOPTools,
+ CArray1OfVSInterference from BOPTools,
+ CArray1OfEEInterference from BOPTools,
+ CArray1OfVEInterference from BOPTools,
+ CArray1OfVVInterference from BOPTools
+
+--raises
+
+is
+ Create
+ returns InterfPool from NMTDS;
+ ---C++: alias "Standard_EXPORT virtual ~NMTDS_InterfPool();"
+
+
+ Add (me:out;
+ aPKB : PassKeyBoolean from NMTDS;
+ aType: InterfType from NMTDS)
+ returns Boolean from Standard;
+
+ Add (me:out;
+ aInd1 : Integer from Standard;
+ aInd2 : Integer from Standard;
+ aType : InterfType from NMTDS)
+ returns Boolean from Standard;
+
+ Add (me:out;
+ aInd1 : Integer from Standard;
+ aInd2 : Integer from Standard;
+ bFlag : Boolean from Standard;
+ aType : InterfType from NMTDS)
+ returns Boolean from Standard;
+
+ Contains(me;
+ aPKB : PassKeyBoolean from NMTDS)
+ returns Boolean from Standard;
+
+ Contains(me;
+ aInd1 : Integer from Standard;
+ aInd2 : Integer from Standard)
+ returns Boolean from Standard;
+
+ Get(me)
+ returns ListOfPassKeyBoolean from NMTDS;
+ ---C++: return const &
+
+ Get(me;
+ aType : InterfType from NMTDS)
+ returns ListOfPassKeyBoolean from NMTDS;
+ ---C++: return const &
+
+ Get(me;
+ aInd : Integer from Standard)
+ returns ListOfPassKeyBoolean from NMTDS;
+ ---C++: return const &
+
+ Get(me;
+ aInd : Integer from Standard;
+ aType: InterfType from NMTDS)
+ returns ListOfPassKeyBoolean from NMTDS;
+ ---C++: return const &
+
+ --
+ -- Interferences
+ --
+ SSInterferences (me:out)
+ returns CArray1OfSSInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to array Of F/F interferences
+ ---
+ ESInterferences (me:out)
+ returns CArray1OfESInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to array Of E/F interferences
+ ---
+ VSInterferences (me:out)
+ returns CArray1OfVSInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to array Of V/F interferences
+ ---
+ EEInterferences (me:out)
+ returns CArray1OfEEInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to arrray Of E/E interferences
+ ---
+ VEInterferences (me:out)
+ returns CArray1OfVEInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to arrray Of V/E interferences
+ ---
+ VVInterferences (me:out)
+ returns CArray1OfVVInterference from BOPTools;
+ ---C++: return &
+ ---Purpose:
+ --- Returns the reference to arrray Of V/V interferences
+ ---
+
+fields
+ myTable : MapOfPassKeyBoolean from NMTDS [6] is protected;
+ myList : ListOfPassKeyBoolean from NMTDS is protected;
+ myMaxInd: Integer from Standard is protected;
+ --
+ mySSInterferences : CArray1OfSSInterference from BOPTools is protected;
+ myESInterferences : CArray1OfESInterference from BOPTools is protected;
+ myVSInterferences : CArray1OfVSInterference from BOPTools is protected;
+ myEEInterferences : CArray1OfEEInterference from BOPTools is protected;
+ myVEInterferences : CArray1OfVEInterference from BOPTools is protected;
+ myVVInterferences : CArray1OfVVInterference from BOPTools is protected;
+
+end InterfPool;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTDS_.InterfPoolcxx
+// Created: Wed Feb 21 10:35:35 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTDS_InterfPool.ixx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#include <NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx>
+#include <NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx>
+
+static
+ Standard_Integer TypeToInteger(const NMTDS_InterfType aType);
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTDS_InterfPool::NMTDS_InterfPool()
+{
+ myMaxInd=6;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ NMTDS_InterfPool::~NMTDS_InterfPool()
+{
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
+ const NMTDS_InterfType aType)
+{
+ Standard_Boolean bRet;
+ Standard_Integer iType;
+ //
+ bRet=Standard_False;
+ //
+ iType=TypeToInteger(aType);
+ if (iType>-1 && iType<myMaxInd) {
+ bRet=myTable[iType].Add(aPKB);
+ }
+ return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+ const Standard_Integer aInd2,
+ const NMTDS_InterfType aType)
+{
+ NMTDS_PassKeyBoolean aPKB;
+ //
+ aPKB.SetIds(aInd1, aInd2);
+ return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+ const Standard_Integer aInd2,
+ const Standard_Boolean bFlag,
+ const NMTDS_InterfType aType)
+{
+ NMTDS_PassKeyBoolean aPKB;
+ //
+ aPKB.SetIds(aInd1, aInd2);
+ aPKB.SetFlag(bFlag);
+ return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Contains
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const
+{
+ Standard_Boolean bRet;
+ Standard_Integer i;
+ //
+ for (i=0; i<myMaxInd; ++i) {
+ bRet=myTable[i].Contains(aPKB);
+ if (bRet) {
+ break;
+ }
+ }
+ return bRet;
+}
+//=======================================================================
+//function : Contains
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
+ const Standard_Integer aInd2)const
+{
+ NMTDS_PassKeyBoolean aPKB;
+ //
+ aPKB.SetIds(aInd1, aInd2);
+ return Contains(aPKB);
+}
+//=======================================================================
+//function : Get
+//purpose :
+//=======================================================================
+ const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const
+{
+ Standard_Integer i;
+ NMTDS_ListOfPassKeyBoolean* pL;
+ //
+ pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+ pL->Clear();
+ //
+ for (i=0; i<myMaxInd; ++i) {
+ NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+ //
+ aIt.Initialize(myTable[i]);
+ for(; aIt.More(); aIt.Next()) {
+ const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+ pL->Append(aPKB);
+ }
+ }
+ return myList;
+}
+//=======================================================================
+//function : Get
+//purpose :
+//=======================================================================
+ const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const
+{
+ Standard_Integer i, n1, n2;
+ NMTDS_ListOfPassKeyBoolean* pL;
+ //
+ pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+ pL->Clear();
+ //
+ for (i=0; i<myMaxInd; ++i) {
+ NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+ //
+ aIt.Initialize(myTable[i]);
+ for(; aIt.More(); aIt.Next()) {
+ const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+ aPKB.Ids(n1, n2);
+ if(n1==aInd || n2==aInd) {
+ pL->Append(aPKB);
+ }
+ }
+ }
+ return myList;
+}
+//=======================================================================
+//function : Get
+//purpose :
+//=======================================================================
+ const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const
+{
+ Standard_Integer iType;
+ NMTDS_ListOfPassKeyBoolean* pL;
+ //
+ pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+ pL->Clear();
+ //
+ iType=TypeToInteger(aType);
+ if (iType>-1 && iType<myMaxInd) {
+ NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+ //
+ aIt.Initialize(myTable[iType]);
+ for(; aIt.More(); aIt.Next()) {
+ const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+ pL->Append(aPKB);
+ }
+ }
+ return myList;
+}
+//=======================================================================
+//function : Get
+//purpose :
+//=======================================================================
+ const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
+ const NMTDS_InterfType aType)const
+{
+ Standard_Integer n1, n2;
+ NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
+ NMTDS_ListIteratorOfListOfPassKeyBoolean aIt;
+ //
+ aLPKB=Get(aType);
+ //
+ pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+ pL->Clear();
+ //
+ aIt.Initialize (aLPKB);
+ for (; aIt.More(); aIt.Next()) {
+ const NMTDS_PassKeyBoolean& aPKB=aIt.Value();
+ aPKB.Ids(n1, n2);
+ if(n1==aInd || n2==aInd) {
+ pL->Append(aPKB);
+ }
+ }
+ return myList;
+}
+////////////////////
+//===========================================================================
+//function : SSInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfSSInterference& NMTDS_InterfPool::SSInterferences()
+{
+ return mySSInterferences;
+}
+//===========================================================================
+//function : ESInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfESInterference& NMTDS_InterfPool::ESInterferences()
+{
+ return myESInterferences;
+}
+//===========================================================================
+//function : VSInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfVSInterference& NMTDS_InterfPool::VSInterferences()
+{
+ return myVSInterferences;
+}
+//===========================================================================
+//function : EEInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfEEInterference& NMTDS_InterfPool::EEInterferences()
+{
+ return myEEInterferences;
+}
+//===========================================================================
+//function : VEInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfVEInterference& NMTDS_InterfPool::VEInterferences()
+{
+ return myVEInterferences;
+}
+//===========================================================================
+//function : VVInterferences
+//purpose :
+//===========================================================================
+ BOPTools_CArray1OfVVInterference& NMTDS_InterfPool::VVInterferences()
+{
+ return myVVInterferences;
+}
+////////////////////
+//=======================================================================
+//function : TypeToInteger
+//purpose :
+//=======================================================================
+Standard_Integer TypeToInteger(const NMTDS_InterfType aType)
+{
+ return (Standard_Integer)aType;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_InterfPool_HeaderFile
+#define _NMTDS_InterfPool_HeaderFile
+
+#ifndef _NMTDS_MapOfPassKeyBoolean_HeaderFile
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _NMTDS_InterfType_HeaderFile
+#include <NMTDS_InterfType.hxx>
+#endif
+class NMTDS_PassKeyBoolean;
+class NMTDS_ListOfPassKeyBoolean;
+class BOPTools_CArray1OfSSInterference;
+class BOPTools_CArray1OfESInterference;
+class BOPTools_CArray1OfVSInterference;
+class BOPTools_CArray1OfEEInterference;
+class BOPTools_CArray1OfVEInterference;
+class BOPTools_CArray1OfVVInterference;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_InterfPool {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTDS_InterfPool();
+Standard_EXPORT virtual ~NMTDS_InterfPool();
+
+
+Standard_EXPORT Standard_Boolean Add(const NMTDS_PassKeyBoolean& aPKB,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const Standard_Boolean bFlag,const NMTDS_InterfType aType) ;
+
+
+Standard_EXPORT Standard_Boolean Contains(const NMTDS_PassKeyBoolean& aPKB) const;
+
+
+Standard_EXPORT Standard_Boolean Contains(const Standard_Integer aInd1,const Standard_Integer aInd2) const;
+
+
+Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get() const;
+
+
+Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const NMTDS_InterfType aType) const;
+
+
+Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd) const;
+
+
+Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd,const NMTDS_InterfType aType) const;
+
+
+//! Returns the reference to array Of F/F interferences <br>
+Standard_EXPORT BOPTools_CArray1OfSSInterference& SSInterferences() ;
+
+
+//! Returns the reference to array Of E/F interferences <br>
+Standard_EXPORT BOPTools_CArray1OfESInterference& ESInterferences() ;
+
+
+//! Returns the reference to array Of V/F interferences <br>
+Standard_EXPORT BOPTools_CArray1OfVSInterference& VSInterferences() ;
+
+
+//! Returns the reference to arrray Of E/E interferences <br>
+Standard_EXPORT BOPTools_CArray1OfEEInterference& EEInterferences() ;
+
+
+//! Returns the reference to arrray Of V/E interferences <br>
+Standard_EXPORT BOPTools_CArray1OfVEInterference& VEInterferences() ;
+
+
+//! Returns the reference to arrray Of V/V interferences <br>
+Standard_EXPORT BOPTools_CArray1OfVVInterference& VVInterferences() ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+NMTDS_MapOfPassKeyBoolean myTable[6];
+NMTDS_ListOfPassKeyBoolean myList;
+Standard_Integer myMaxInd;
+BOPTools_CArray1OfSSInterference mySSInterferences;
+BOPTools_CArray1OfESInterference myESInterferences;
+BOPTools_CArray1OfVSInterference myVSInterferences;
+BOPTools_CArray1OfEEInterference myEEInterferences;
+BOPTools_CArray1OfVEInterference myVEInterferences;
+BOPTools_CArray1OfVVInterference myVVInterferences;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_InterfPool.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyBoolean_HeaderFile
+#include <NMTDS_PassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _NMTDS_InterfPool_HeaderFile
+#include <NMTDS_InterfPool.hxx>
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_InterfType_HeaderFile
+#define _NMTDS_InterfType_HeaderFile
+
+
+enum NMTDS_InterfType {
+ NMTDS_TI_VV,
+NMTDS_TI_VE,
+NMTDS_TI_VF,
+NMTDS_TI_EE,
+NMTDS_TI_EF,
+NMTDS_TI_FF,
+NMTDS_TI_UNKNOWN
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
class Iterator from NMTDS
-
+
---Purpose:
uses
ShapesDataStructure from NMTDS,
PShapesDataStructure from NMTDS,
ListOfPassKeyBoolean from NMTDS,
- ListIteratorOfListOfPassKeyBoolean from NMTDS
+ ListIteratorOfListOfPassKeyBoolean from NMTDS,
+ PassKeyBoolean from NMTDS
+
--raises
is
aIndex2:out Integer from Standard;
aWithSubShape: out Boolean from Standard);
- Prepare(me:out);
-
+ Prepare(me:out)
+ is virtual;
+
+ Intersect(me:out)
+ is virtual protected;
+
ExpectedLength(me)
returns Integer from Standard;
+ BlockLength(me)
+ returns Integer from Standard;
+
SDVertices(me)
returns DataMapOfIntegerListOfInteger from TColStd;
- ---C++:return const &
-
+ ---C++:return const &
+
+ FillMVSD(myclass;
+ aMVSD1:DataMapOfIntegerListOfInteger from TColStd;
+ aMVSD2:out DataMapOfIntegerListOfInteger from TColStd);
fields
- myPDS :PShapesDataStructure from NMTDS is protected;
+ myDS :PShapesDataStructure from NMTDS is protected;
myLists :ListOfPassKeyBoolean from NMTDS [6] is protected;
myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected;
myEmptyList:ListOfPassKeyBoolean from NMTDS is protected;
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2006 SAMTECH
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// 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
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_Iterator.ixx>
-#include <NMTDS_CArray1OfIndexRange.hxx>
-#include <NMTDS_IndexRange.hxx>
+//
#include <Bnd_Box.hxx>
-#include <TopoDS_Shape.hxx>
+//
#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_Array1OfListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <NMTDS_PassKeyBoolean.hxx>
-#include <NMTDS_MapOfPassKeyBoolean.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TColStd_ListOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
-
+//
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Shape.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
-
-static
- void ComputeBoxEx(const Standard_Integer aIx,
- NMTDS_ShapesDataStructure* pDS,
- Bnd_Box& aBoxEx);
-
-static inline
- Standard_Boolean IsValidType(const TopAbs_ShapeEnum aT);
-
-static
- Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2);
-
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_Tools.hxx>
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
//=======================================================================
//function : NMTDS_Iterator
//=======================================================================
NMTDS_Iterator::NMTDS_Iterator()
{
- myPDS=NULL;
+ myDS=NULL;
myLength=0;
}
//=======================================================================
//=======================================================================
void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS)
{
- myPDS=aDS;
+ myDS=aDS;
}
//=======================================================================
// function: DS
//=======================================================================
const NMTDS_ShapesDataStructure& NMTDS_Iterator::DS()const
{
- return *myPDS;
+ return *myDS;
}
//=======================================================================
// function: ExpectedLength
return myLength;
}
//=======================================================================
+// function: BlockLength
+// purpose:
+//=======================================================================
+ Standard_Integer NMTDS_Iterator::BlockLength() const
+{
+ Standard_Integer aNbIIs;
+ Standard_Real aCfPredict=.5;
+
+ aNbIIs=ExpectedLength();
+
+ if (aNbIIs<=1) {
+ return 1;
+ }
+ //
+ aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
+ return aNbIIs;
+}
+//=======================================================================
// function: Initialize
// purpose:
//=======================================================================
{
Standard_Integer iX;
//
- iX=TypeToInteger(aType1, aType2);
+ iX=NMTDS_Tools::TypeToInteger(aType1, aType2);
if (iX>=0) {
myIterator.Initialize(myLists[iX]);
myLength=myLists[iX].Extent();
{
return myMVSD;
}
-
//=======================================================================
// function: Prepare
// purpose:
//=======================================================================
void NMTDS_Iterator::Prepare()
+{
+ Standard_Integer i;
+ //
+ myLength=0;
+ for (i=0; i<6; ++i) {
+ myLists[i].Clear();
+ }
+ myMVSD.Clear();
+ //
+ if (myDS==NULL){
+ return;
+ }
+ Intersect();
+}
+//=======================================================================
+// function: Intersect
+// purpose:
+//=======================================================================
+ void NMTDS_Iterator::Intersect()
{
Standard_Boolean bFlag;
- Standard_Integer aNb, i, aNbB, aNbR;
+ Standard_Integer aNb, i, aNbB, aNbR, iFlag;
Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV;
TColStd_ListIteratorOfListOfInteger aIt;
TColStd_DataMapOfIntegerInteger aMII;
- TColStd_MapOfInteger aMFence;
+ //modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f
+ //TColStd_MapOfInteger aMFence;
+ TColStd_DataMapOfIntegerListOfInteger aMVSD;
+ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+ //modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t
TopTools_DataMapOfShapeInteger aMSI;
TopAbs_ShapeEnum aTi, aTj;
NMTDS_PassKeyBoolean aPKXB;
NMTDS_MapOfPassKeyBoolean aMPKXB;
NMTDS_IndexedDataMapOfShapeBox aMSB;
- Handle(Bnd_HArray1OfBox) aHAB;
- Bnd_BoundSortBox aBSB;
//
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
- if (myPDS==NULL){
- return;
- }
- //
- myLength=0;
- for (i=0; i<6; ++i) {
- myLists[i].Clear();
- }
- myMVSD.Clear();
- //
- const NMTDS_CArray1OfIndexRange& aRanges=myPDS->Ranges();
+ const NMTDS_CArray1OfIndexRange& aRanges=myDS->Ranges();
aNbR=aRanges.Extent();
//
- aNb=myPDS->NumberOfShapesOfTheObject();
+ aNb=myDS->NumberOfShapesOfTheObject();
for (i=1; i<=aNb; ++i) {
- const TopoDS_Shape& aS=myPDS->Shape(i);
+ const TopoDS_Shape& aS=myDS->Shape(i);
aTi=aS.ShapeType();
- if (IsValidType(aTi)) {
+ if (NMTDS_Tools::HasBRep(aTi)) {
Bnd_Box aBoxEx;
//
- ComputeBoxEx(i, myPDS, aBoxEx);
+ myDS->ComputeBoxEx(i, aBoxEx);
aMSI.Bind(aS, i);
aMSB.Add(aS, aBoxEx);
}
i1=aR.First();
i2=aR.Last();
for (i=i1; i<=i2; ++i) {
- const TopoDS_Shape& aSi=myPDS->Shape(i);
+ const TopoDS_Shape& aSi=myDS->Shape(i);
aTi=aSi.ShapeType();
- if (!IsValidType(aTi)){
+ if (!NMTDS_Tools::HasBRep(aTi)){
continue;
}
const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
}
//
aPKXB.SetIds(i, j);
+ //
if (aMPKXB.Add(aPKXB)) {
bFlag=Standard_False;// Bounding boxes are intersected
- const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i);
- const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j);
+ const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+ const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
if (aBoxi.IsOut(aBoxj)) {
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
}
- const TopoDS_Shape& aSj=myPDS->Shape(j);
+ const TopoDS_Shape& aSj=myDS->Shape(j);
aTj=aSj.ShapeType();
- iX=TypeToInteger(aTi, aTj);
-
+ iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+ //bFlag=(iStatus==2);
aPKXB.SetFlag(bFlag);
myLists[iX].Append(aPKXB);
//
// VSD prepare
if (iX==5) { //VV
- if (aMFence.Add(j)) {
- aLV.Append(j);
- }
+ aLV.Append(j);
}
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
// VSD treatment
aNbLV=aLV.Extent();
if (aNbLV) {
- myMVSD.Bind(i, aLV);
+ TColStd_ListOfInteger aLV1;
+ //
+ const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+ aIt.Initialize(aLV);
+ for (; aIt.More(); aIt.Next()) {
+ j=aIt.Value();
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+ iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+ if (!iFlag) {
+ aLV1.Append(j);
+ }
+ else {
+ aPKXB.SetIds(i, j);
+ aMPKXB.Remove(aPKXB);
+ }
+ }
+ aMVSD.Bind(i, aLV1);
}
}//for (i=i1; i<=i2; ++i) {
}//for (iR=1; iR<aNbR; ++iR) {
-}
-
-//=======================================================================
-// function: IsValidType
-// purpose:
-//=======================================================================
-Standard_Boolean IsValidType(const TopAbs_ShapeEnum aTi)
-{
- return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
-}
-//=======================================================================
-// function: ComputeBoxEx
-// purpose:
-//=======================================================================
- void ComputeBoxEx(const Standard_Integer aIx,
- NMTDS_ShapesDataStructure* pDS,
- Bnd_Box& aBoxEx)
-{
- Standard_Integer i, aNbS, iS;
//
- const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
- aBoxEx.Add(aBox);
//
- aNbS=pDS->NumberOfSuccessors(aIx);
- for (i=1; i<=aNbS; ++i) {
- Bnd_Box aBoxS;
- iS=pDS->GetSuccessor(aIx, i);
- ComputeBoxEx(iS, pDS, aBoxS);
- aBoxEx.Add(aBoxS);
- }
+ // Chains
+ //=================
+ myMVSD.Clear();
+ NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
}
-
//=======================================================================
-// function: TypeToInteger
-// purpose:
+//function : FillMVSD
+//purpose :
//=======================================================================
-Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ void NMTDS_Iterator::FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD,
+ TColStd_DataMapOfIntegerListOfInteger& bMVSD)
{
- Standard_Integer iRet, iT1, iT2, iX;
- //
- iRet=-1;
- iT1=(Standard_Integer)aType1;
- iT2=(Standard_Integer)aType2;
+ Standard_Boolean bFound;
+ Standard_Integer aNbVSD, iCnt, i, j, k;
+ TColStd_ListOfInteger aLV;
+ TColStd_ListIteratorOfListOfInteger aIt;
+ TColStd_MapOfInteger aMF;
+ TColStd_MapIteratorOfMapOfInteger aItMI;
+ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+ NMTDS_DataMapOfIntegerMapOfInteger aDMIMI;
+ NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger aIti, aItj;
//
- iX=iT2*10+iT1;
- switch (iX) {
- case 77:
- iRet=5; // VV
- break;
- case 76:
- case 67:
- iRet=4; // VE
- break;
- case 74:
- case 47:
- iRet=2; // VF
- break;
- case 66:
- iRet=3; // EE
- break;
- case 64:
- case 46:
- iRet=1; // EF
- break;
- case 44:
- iRet=0; // FF
- break;
- default:
- break;
+ aNbVSD=aMVSD.Extent();
+ if (!aNbVSD) {
+ return;
}
- return iRet;
-}
-
-/*
-//
- // check
- TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
- TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt2;
//
- printf(" \n");
- printf(" aMVLV.Extent()=%d\n", aMVLV.Extent());
- aIt1.Initialize(aMVLV);
- for (; aIt1.More(); aIt1.Next()) {
- i=aIt1.Key();
- printf(" i=%d (", i);
- const TColStd_ListOfInteger& aLV=aIt1.Value();
- aIt.Initialize(aLV);
+ aItVSD.Initialize(aMVSD);
+ for (; aItVSD.More(); aItVSD.Next()) {
+ TColStd_MapOfInteger aMI;
+ //
+ i=aItVSD.Key();
+ aMI.Add(i);
+ const TColStd_ListOfInteger& aLVSD=aItVSD.Value();
+ aIt.Initialize(aLVSD);
for (; aIt.More(); aIt.Next()) {
j=aIt.Value();
- printf(" %d", j);
+ aMI.Add(j);
}
- printf(")\n");
+ aDMIMI.Bind(i, aMI);
}
- //
- printf(" \n");
- printf(" aMVV.Extent()=%d\n", aMVV.Extent());
- aIt2.Initialize(aMVV);
- for (; aIt2.More(); aIt2.Next()) {
- i=aIt2.Key();
- j=aIt2.Value();
- printf(" (%d, %d)\n", i, j);
+ // i
+ aIti.Initialize(aDMIMI);
+ for (; aIti.More(); aIti.Next()) {
+ i=aIti.Key();
+ if (aMF.Contains(i)) {
+ continue;
+ }
+ aMF.Add(i);
+ //
+ //TColStd_MapOfInteger& aMIi=aDMIMI.ChangeFind(i);
+ TColStd_MapOfInteger *pMIi=(TColStd_MapOfInteger *)&aIti.Value();
+ TColStd_MapOfInteger& aMIi=*pMIi;
+ // j
+ while (1) {
+ iCnt=0;
+ aItj.Initialize(aDMIMI);
+ for (; aItj.More(); aItj.Next()) {
+ j=aItj.Key();
+ if (aMF.Contains(j)) {
+ continue;
+ }
+ //
+ //TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
+ TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
+ TColStd_MapOfInteger& aMIj=*pMj;
+ //
+ aItMI.Initialize(aMIj);
+ for (; aItMI.More(); aItMI.Next()) {
+ k=aItMI.Key();
+ bFound=aMIi.Contains(k);
+ if (bFound) {
+ break;
+ }
+ }
+ if (!bFound) {
+ continue;
+ }
+ //
+ aItMI.Initialize(aMIj);
+ for (; aItMI.More(); aItMI.Next()) {
+ k=aItMI.Key();
+ aMIi.Add(k);
+ }
+ //
+ if (aMF.Add(j)) {
+ ++iCnt;
+ }
+ } //for (; aItj.More(); aItj.Next()) {
+ if (!iCnt) {
+ break;
+ }
+ } // while (1) {
+ //
+ aLV.Clear();
+ aItMI.Initialize(aMIi);
+ for (; aItMI.More(); aItMI.Next()) {
+ k=aItMI.Key();
+ if (k!=i) {
+ aLV.Append(k);
+ }
+ }
+ bMVSD.Bind(i, aLV);
+ }// for (; aIti.More(); aIti.Next()) {
+}
+
+ /*
+ {
+ // check
+ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItX;
+ //
+ printf(" \n");
+ printf(" myMVSD.Extent()=%d\n", myMVSD.Extent());
+ aItX.Initialize(myMVSD);
+ for (; aItX.More(); aItX.Next()) {
+ i=aItX.Key();
+ printf(" i=%d (", i);
+ const TColStd_ListOfInteger& aLV=aItX.Value();
+ aIt.Initialize(aLV);
+ for (; aIt.More(); aIt.Next()) {
+ j=aIt.Value();
+ printf(" %d", j);
+ }
+ printf(")\n");
+ }
}
- printf("\n");
*/
+
Standard_EXPORT void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const;
-Standard_EXPORT void Prepare() ;
+Standard_EXPORT virtual void Prepare() ;
Standard_EXPORT Standard_Integer ExpectedLength() const;
+Standard_EXPORT Standard_Integer BlockLength() const;
+
+
Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const;
+Standard_EXPORT static void FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD1,TColStd_DataMapOfIntegerListOfInteger& aMVSD2) ;
+
+
//
+Standard_EXPORT virtual void Intersect() ;
+
+
// Fields PROTECTED
//
-NMTDS_PShapesDataStructure myPDS;
+NMTDS_PShapesDataStructure myDS;
NMTDS_ListOfPassKeyBoolean myLists[6];
NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator;
NMTDS_ListOfPassKeyBoolean myEmptyList;
--- /dev/null
+-- Copyright (C) 2007 SAMTECH
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTDS_IteratorCheckerSI.cdl
+-- Created: Tue Feb 6 10:18:27 2007
+-- Author: Peter KURNEV
+
+
+class IteratorCheckerSI from NMTDS
+ inherits Iterator from NMTDS
+
+ ---Purpose:
+
+--uses
+--raises
+
+is
+ Create
+ returns IteratorCheckerSI from NMTDS;
+ ---C++: alias "Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();"
+
+ Intersect(me:out)
+ is redefined protected;
+
+--fields
+end IteratorCheckerSI;
--- /dev/null
+// Copyright (C) 2007 SAMTECH
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTDS_IteratorChecker.cxx
+// Created: Tue Feb 6 10:37:59 2007
+// Author: Peter KURNEV
+
+
+#include <NMTDS_IteratorCheckerSI.ixx>
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+//
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+//
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_Tools.hxx>
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI()
+:
+ NMTDS_Iterator()
+{
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI()
+{
+}
+//=======================================================================
+// function: Intersect
+// purpose:
+//=======================================================================
+ void NMTDS_IteratorCheckerSI::Intersect()
+{
+ Standard_Boolean bFlag;
+ Standard_Integer aNbS, i, aNbA, aNbB, iFlag;
+ Standard_Integer aNbSD, iX, j, iDS, jB, k, aNbLV;
+ TColStd_ListIteratorOfListOfInteger aIt;
+ TColStd_DataMapOfIntegerInteger aMII;
+ TColStd_DataMapOfIntegerListOfInteger aMVSD;
+ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+ TopTools_DataMapOfShapeInteger aMSI;
+ TopAbs_ShapeEnum aTi, aTj;
+ NMTDS_PassKeyBoolean aPKXB;
+ NMTDS_MapOfPassKeyBoolean aMPKXB;
+ NMTDS_IndexedDataMapOfShapeBox aMSB;
+ NMTDS_MapOfPassKeyBoolean aMPA;//myPairsAvoid
+ //
+ NMTDS_BoxBndTreeSelector aSelector;
+ NMTDS_BoxBndTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+ //
+ aNbS=myDS->NumberOfShapesOfTheObject();
+ //
+ // myPairsAvoid, aMSI, aMSB
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aSi=myDS->Shape(i);
+ aTi=aSi.ShapeType();
+ if (NMTDS_Tools::HasBRep(aTi)) {
+ if (aTi!=TopAbs_VERTEX) {
+ TColStd_IndexedMapOfInteger aMA;
+ //
+ myDS->GetAllSuccessors(i, aMA);
+ //
+ aNbA=aMA.Extent();
+ for (j=1; j<=aNbA; ++j) {
+ iX=aMA(j);
+ aPKXB.Clear();
+ aPKXB.SetIds(i, iX);
+ aMPA.Add(aPKXB);
+ }
+ }
+ else {
+ aPKXB.Clear();
+ aPKXB.SetIds(i, i);
+ aMPA.Add(aPKXB);
+ }
+ //
+ Bnd_Box aBoxEx;
+ //
+ myDS->ComputeBoxEx(i, aBoxEx);
+ aMSI.Bind(aSi, i);
+ aMSB.Add(aSi, aBoxEx);
+ }
+ }
+ //
+ // aMII
+ aNbB=aMSB.Extent();
+ for (i=1; i<=aNbB; ++i) {
+ const TopoDS_Shape& aS=aMSB.FindKey(i);
+ const Bnd_Box& aBoxEx=aMSB(i);
+ //
+ aTreeFiller.Add(i, aBoxEx);
+ //
+ iDS=aMSI.Find(aS);
+ aMII.Bind(i, iDS);
+ }
+ //
+ aTreeFiller.Fill();
+ //
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aSi=myDS->Shape(i);
+ aTi=aSi.ShapeType();
+ if (!NMTDS_Tools::HasBRep(aTi)){
+ continue;
+ }
+ const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
+ aSelector.Clear();
+ aSelector.SetBox(aBoxEx);
+ //
+ aNbSD=aBBTree.Select(aSelector);
+ if (!aNbSD){
+ continue;
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ //
+ k=0;
+ TColStd_ListOfInteger aLV;
+ //
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ jB=aIt.Value(); // box index in MII
+ j=aMII.Find(jB); // DS index
+ //
+ aPKXB.SetIds(i, j);
+ if (aMPA.Contains(aPKXB)) {
+ continue;
+ }
+ //
+ if (aMPKXB.Add(aPKXB)) {
+ bFlag=Standard_False;// Bounding boxes are intersected
+ const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+ const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
+ if (aBoxi.IsOut(aBoxj)) {
+ bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
+ }
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ aTj=aSj.ShapeType();
+ iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+ //bFlag=(iStatus==2);
+ aPKXB.SetFlag(bFlag);
+ myLists[iX].Append(aPKXB);
+ //
+ // VSD prepare
+ if (iX==5) { //VV
+ aLV.Append(j);
+ }
+ }// if (aMPKXB.Add(aPKXB)) {
+ }// for (; aIt.More(); aIt.Next()) {
+ //
+ // VSD treatment
+ aNbLV=aLV.Extent();
+ if (aNbLV) {
+ TColStd_ListOfInteger aLV1;
+ //
+ const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+ aIt.Initialize(aLV);
+ for (; aIt.More(); aIt.Next()) {
+ j=aIt.Value();
+ const TopoDS_Shape& aSj=myDS->Shape(j);
+ const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+ iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+ if (!iFlag) {
+ aLV1.Append(j);
+ }
+ else {
+ aPKXB.SetIds(i, j);
+ aMPKXB.Remove(aPKXB);
+ }
+ }
+ aMVSD.Bind(i, aLV1);
+ }
+ }//for (i=1; i<=aNbS; ++i) {
+ //
+ //
+ // 2. Chains
+ //=================
+ myMVSD.Clear();
+ NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
+}
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#define _NMTDS_IteratorCheckerSI_HeaderFile
+
+#ifndef _NMTDS_Iterator_HeaderFile
+#include <NMTDS_Iterator.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_IteratorCheckerSI : public NMTDS_Iterator {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTDS_IteratorCheckerSI();
+Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+Standard_EXPORT virtual void Intersect() ;
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_IteratorCheckerSI.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#include <NMTDS_IteratorCheckerSI.hxx>
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#define _NMTDS_PInterfPool_HeaderFile
+
+class NMTDS_InterfPool;
+
+typedef NMTDS_InterfPool* NMTDS_PInterfPool;
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PIterator_HeaderFile
+#define _NMTDS_PIterator_HeaderFile
+
+class NMTDS_Iterator;
+
+typedef NMTDS_Iterator* NMTDS_PIterator;
+
+#endif
--- Copyright (C) 2006 SAMTECH
+-- Copyright (C) 2005 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 along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
--- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_PassKey.cdl
--- Created:
+-- Created: Mon Nov 20 12:16:13 2006
-- Author: Peter KURNEV
-- <pkv@irinox>
+
class PassKey from NMTDS
---Purpose:
uses
Shape from TopoDS,
- ListOfInteger from TColStd
-
+ IndexedMapOfInteger from TColStd,
+ ListOfInteger from TColStd
+
--raises
is
Create
returns PassKey from NMTDS;
-
- Assign(me:out;
- Other : PassKey from NMTDS)
- returns PassKey from NMTDS;
- ---C++: alias operator =
- ---C++: return &
---
+ ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKey();"
+
+ Create(Other:PassKey from NMTDS)
+ returns PassKey from NMTDS;
+ ---C++: alias "Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);"
+
+ Clear(me:out);
+
SetIds(me:out;
- aI1 :Integer from Standard;
+ aI1 :Integer from Standard);
+
+ SetIds(me:out;
+ aI1 :Integer from Standard;
aI2 :Integer from Standard);
- NbMax(me)
- returns Integer from Standard;
-
- Clear(me:out);
+ SetIds(me:out;
+ aI1 :Integer from Standard;
+ aI2 :Integer from Standard;
+ aI3 :Integer from Standard);
+
+ SetIds(me:out;
+ aI1 :Integer from Standard;
+ aI2 :Integer from Standard;
+ aI3 :Integer from Standard;
+ aI4 :Integer from Standard);
- Compute(me:out);
+ SetIds(me:out;
+ aLS :ListOfInteger from TColStd);
+
+ NbIds(me)
+ returns Integer from Standard;
IsEqual(me;
aOther:PassKey from NMTDS)
returns Boolean from Standard;
-
- Key(me)
- returns Address from Standard;
HashCode(me;
Upper : Integer from Standard)
returns Integer from Standard;
-
+ Id(me;
+ aIndex: Integer from Standard)
+ returns Integer from Standard;
+
Ids(me;
aI1 :out Integer from Standard;
aI2 :out Integer from Standard);
-
- Dump(me);
+ Dump(me;
+ aHex:Integer from Standard=0);
+
+
fields
-
myNbIds: Integer from Standard is protected;
- myNbMax: Integer from Standard is protected;
- mySum : Integer from Standard is protected;
- myIds : Integer from Standard [2] is protected;
+ mySum : Integer from Standard is protected;
+ myMap : IndexedMapOfInteger from TColStd is protected;
end PassKey;
-// Copyright (C) 2006 SAMTECH
+// Copyright (C) 2005 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTDS_PassKey.cxx
-// Created:
+//
+// File: NMTDS_Algo.cxx
+// Created: Sat Dec 04 12:39:47 2004
// Author: Peter KURNEV
-// <pkv@irinox>
+// <peter@PREFEX>
#include <NMTDS_PassKey.ixx>
#include <stdio.h>
#include <string.h>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
#ifdef WNT
#pragma warning( disable : 4101)
#endif
-static
- void SortShell(const int n, int* a);
static
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv);
//=======================================================================
NMTDS_PassKey::NMTDS_PassKey()
{
- Clear();
+ Clear();
+}
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTDS_PassKey::NMTDS_PassKey(const NMTDS_PassKey& aOther)
+{
+ myNbIds=aOther.myNbIds;
+ mySum=aOther.mySum;
+ myMap=aOther.myMap;
}
//=======================================================================
-//function :Assign
+//function :operator =
//purpose :
//=======================================================================
- NMTDS_PassKey& NMTDS_PassKey::Assign(const NMTDS_PassKey& anOther)
+ NMTDS_PassKey& NMTDS_PassKey::operator =(const NMTDS_PassKey& aOther)
{
- myNbIds=anOther.myNbIds;
- myNbMax=anOther.myNbMax;
- mySum=anOther.mySum;
- memcpy(myIds, anOther.myIds, sizeof(myIds));
+ myNbIds=aOther.myNbIds;
+ mySum=aOther.mySum;
+ myMap=aOther.myMap;
return *this;
}
//=======================================================================
+//function :~
+//purpose :
+//=======================================================================
+ NMTDS_PassKey::~NMTDS_PassKey()
+{
+}
+//=======================================================================
//function :Clear
//purpose :
//=======================================================================
void NMTDS_PassKey::Clear()
{
- Standard_Integer i;
- //
myNbIds=0;
- myNbMax=2;
mySum=0;
- for (i=0; i<myNbMax; ++i) {
- myIds[i]=0;
- }
+ myMap.Clear();
+}
+//=======================================================================
+//function :SetIds
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::SetIds(const Standard_Integer aId1)
+
+{
+ Clear();
+ myNbIds=1;
+ myMap.Add(aId1);
+ mySum=NormalizedId(aId1, myNbIds);
+}
+//=======================================================================
+//function :SetIds
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+ const Standard_Integer aId2)
+{
+ TColStd_ListOfInteger aLI;
+ //
+ aLI.Append(aId1);
+ aLI.Append(aId2);
+ SetIds(aLI);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
- void NMTDS_PassKey::SetIds(const Standard_Integer anId1,
- const Standard_Integer anId2)
+ void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+ const Standard_Integer aId2,
+ const Standard_Integer aId3)
{
- Standard_Integer aIdN1, aIdN2;
+ TColStd_ListOfInteger aLI;
//
- myNbIds=2;
- aIdN1=NormalizedId(anId1, myNbIds);
- aIdN2=NormalizedId(anId2, myNbIds);
- mySum=aIdN1+aIdN2;
+ aLI.Append(aId1);
+ aLI.Append(aId2);
+ aLI.Append(aId3);
+ SetIds(aLI);
+}
+//=======================================================================
+//function :SetIds
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+ const Standard_Integer aId2,
+ const Standard_Integer aId3,
+ const Standard_Integer aId4)
+{
+ TColStd_ListOfInteger aLI;
//
- if (anId1<anId2) {
- myIds[myNbMax-2]=anId1;
- myIds[myNbMax-1]=anId2;
- return;
- }
- myIds[myNbMax-2]=anId2;
- myIds[myNbMax-1]=anId1;
+ aLI.Append(aId1);
+ aLI.Append(aId2);
+ aLI.Append(aId3);
+ aLI.Append(aId4);
+ SetIds(aLI);
}
//=======================================================================
-//function :Ids
+//function :SetIds
//purpose :
//=======================================================================
- void NMTDS_PassKey::Ids(Standard_Integer& aId1,
- Standard_Integer& aId2)const
+ void NMTDS_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
{
- aId1=myIds[0];
- aId2=myIds[1];
+ Standard_Integer i, aId, aIdN;
+ TColStd_ListIteratorOfListOfInteger aIt;
+ //
+ Clear();
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aId=aIt.Value();
+ myMap.Add(aId);
+ }
+ myNbIds=myMap.Extent();
+ for(i=1; i<=myNbIds; ++i) {
+ aId=myMap(i);
+ aIdN=NormalizedId(aId, myNbIds);
+ mySum+=aIdN;
+ }
}
+
//=======================================================================
-//function :NbMax
+//function :NbIds
//purpose :
//=======================================================================
- Standard_Integer NMTDS_PassKey::NbMax()const
+ Standard_Integer NMTDS_PassKey::NbIds()const
{
- return myNbMax;
+ return myNbIds;
}
//=======================================================================
-//function :Compute
+//function :Id
//purpose :
//=======================================================================
- void NMTDS_PassKey::Compute()
+ Standard_Integer NMTDS_PassKey::Id(const Standard_Integer aIndex) const
{
- SortShell(myNbIds, myIds+myNbMax-myNbIds);
+ if (aIndex<1 || aIndex>myNbIds) {
+ return -1;
+ }
+ return myMap(aIndex);
}
//=======================================================================
-//function :IsEqual
+//function :Ids
//purpose :
//=======================================================================
- Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& anOther) const
+ void NMTDS_PassKey::Ids(Standard_Integer& aId1,
+ Standard_Integer& aId2) const
{
- Standard_Integer iIsEqual;
- Standard_Boolean bIsEqual;
- //
- iIsEqual=memcmp(myIds, anOther.myIds, sizeof(myIds));
- bIsEqual=Standard_False;
- if (!iIsEqual) {
- bIsEqual=!bIsEqual;
+ aId1=0;
+ aId2=0;
+ if (myNbIds>1) {
+ aId1=myMap(1);
+ aId2=myMap(2);
}
- return bIsEqual;
}
//=======================================================================
-//function :Key
+//function :IsEqual
//purpose :
//=======================================================================
- Standard_Address NMTDS_PassKey::Key()const
+ Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& aOther) const
{
- return (Standard_Address)myIds;
+ Standard_Boolean bRet;
+ Standard_Integer i, aId;
+ //
+ bRet=Standard_False;
+ //
+ if (myNbIds!=aOther.myNbIds) {
+ return bRet;
+ }
+ for (i=1; i<=myNbIds; ++i) {
+ aId=myMap(i);
+ if (!aOther.myMap.Contains(aId)) {
+ return bRet;
+ }
+ }
+ return !bRet;
}
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
- Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer Upper) const
+ Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer aUpper) const
{
- return ::HashCode(mySum, Upper);
+ return ::HashCode(mySum, aUpper);
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
- void NMTDS_PassKey::Dump()const
+ void NMTDS_PassKey::Dump(const Standard_Integer )const
{
- Standard_Integer i;
- //
- printf(" PassKey: {");
- for (i=0; i<myNbMax; ++i) {
- printf(" %d", myIds[i]);
- }
- printf(" }");
}
+
//=======================================================================
// function: NormalizedId
// purpose :
}
return aIdRet;
}
+/*
+//=========
//=======================================================================
-// function: SortShell
-// purpose :
+//function : Contains
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_PassKey::Contains(const Standard_Integer aId) const
+{
+ return myMap.Contains(aId);
+}
+//=======================================================================
+//function :Contains
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_PassKey::Contains(const NMTDS_PassKey& aOther) const
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aId;
+ //
+ bRet=Standard_False;
+ //
+ if (myNbIds<aOther.myNbIds) {
+ return bRet;
+ }
+ for (i=1; i<=aOther.myNbIds; ++i) {
+ aId=aOther.myMap(i);
+ if (!myMap.Contains(aId)) {
+ return bRet;
+ }
+ }
+ return !bRet;
+}
+//=======================================================================
+//function :Intersected
+//purpose :
//=======================================================================
-void SortShell(const int n, int* a)
+ Standard_Boolean NMTDS_PassKey::Intersected(const NMTDS_PassKey& aOther) const
{
- int x, nd, i, j, l, d=1;
+ Standard_Boolean bRet;
+ Standard_Integer i, aId;
//
- while(d<=n) {
- d*=2;
+ bRet=Standard_False;
+ //
+ for (i=1; i<=myNbIds; ++i) {
+ aId=myMap(i);
+ if (aOther.Contains(aId)) {
+ return !bRet;
+ }
+ }
+ return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::Add(const Standard_Integer aId)
+{
+ TColStd_ListOfInteger aLI;
+ aLI.Append(aId);
+ //
+ Add(aLI);
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::Add(const NMTDS_PassKey& aOther)
+{
+ Standard_Integer i, aId;
+ TColStd_ListOfInteger aLS;
+ //
+ for(i=1; i<=myNbIds; ++i) {
+ aId=myMap(i);
+ aLS.Append(aId);
+ }
+ for(i=1; i<=aOther.myNbIds; ++i) {
+ aId=aOther.myMap(i);
+ aLS.Append(aId);
+ }
+ //
+ Add(aLS);
+}
+//=======================================================================
+//function : Add
+//purpose :
+//=======================================================================
+ void NMTDS_PassKey::Add(const TColStd_ListOfInteger& aLI)
+{
+ Standard_Integer i, aId;
+ TColStd_ListOfInteger aLS;
+ TColStd_ListIteratorOfListOfInteger aIt;
+ //
+ for(i=1; i<=myNbIds; ++i) {
+ aId=myMap(i);
+ aLS.Append(aId);
+ }
+ aIt.Initialize(aLI);
+ for (; aIt.More(); aIt.Next()) {
+ aId=aIt.Value();
+ aLS.Append(aId);
}
//
- while (d) {
- d=(d-1)/2;
- //
- nd=n-d;
- for (i=0; i<nd; ++i) {
- j=i;
- m30:;
- l=j+d;
- if (a[l] < a[j]){
- x=a[j];
- a[j]=a[l];
- a[l]=x;
- j-=d;
- if (j > -1) goto m30;
- }//if (a[l] < a[j]){
- }//for (i=0; i<nd; ++i)
- }//while (1)
+ SetIds(aLS);
}
+//=========
+*/
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
-#ifndef _Standard_Address_HeaderFile
-#include <Standard_Address.hxx>
-#endif
+class TColStd_ListOfInteger;
#ifndef _Standard_HeaderFile
Standard_EXPORT NMTDS_PassKey();
+Standard_EXPORT virtual ~NMTDS_PassKey();
+
+Standard_EXPORT NMTDS_PassKey(const NMTDS_PassKey& Other);
+Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);
+
+
+Standard_EXPORT void Clear() ;
-Standard_EXPORT NMTDS_PassKey& Assign(const NMTDS_PassKey& Other) ;
- NMTDS_PassKey& operator =(const NMTDS_PassKey& Other)
-{
- return Assign(Other);
-}
+Standard_EXPORT void SetIds(const Standard_Integer aI1) ;
Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
-Standard_EXPORT Standard_Integer NbMax() const;
+Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3) ;
-Standard_EXPORT void Clear() ;
+Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3,const Standard_Integer aI4) ;
-Standard_EXPORT void Compute() ;
+Standard_EXPORT void SetIds(const TColStd_ListOfInteger& aLS) ;
-Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
+Standard_EXPORT Standard_Integer NbIds() const;
-Standard_EXPORT Standard_Address Key() const;
+Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const;
+Standard_EXPORT Standard_Integer Id(const Standard_Integer aIndex) const;
+
+
Standard_EXPORT void Ids(Standard_Integer& aI1,Standard_Integer& aI2) const;
-Standard_EXPORT void Dump() const;
+Standard_EXPORT void Dump(const Standard_Integer aHex = 0) const;
// Fields PROTECTED
//
Standard_Integer myNbIds;
-Standard_Integer myNbMax;
Standard_Integer mySum;
-Standard_Integer myIds[2];
+TColStd_IndexedMapOfInteger myMap;
private:
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#ifndef _TColStd_ListOfInteger_HeaderFile
+#include <TColStd_ListOfInteger.hxx>
+#endif
#ifndef _NMTDS_PassKey_HeaderFile
#include <NMTDS_PassKey.hxx>
#endif
is
Create
returns PassKeyBoolean from NMTDS;
-
- Assign(me:out;
- Other : PassKeyBoolean from NMTDS)
- returns PassKeyBoolean from NMTDS;
- ---C++: alias operator =
- ---C++: return &
---
+ ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();"
+
SetFlag(me:out;
aFlag: Boolean from Standard);
-
+ ---C++: alias " Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);"
+
Flag(me)
returns Boolean from Standard;
fields
-
myFlag: Boolean from Standard is protected;
end PassKeyBoolean;
#include <NMTDS_PassKeyBoolean.ixx>
//=======================================================================
-//function : NMTDS_PassKeyBoolean
+//function :
//purpose :
//=======================================================================
NMTDS_PassKeyBoolean::NMTDS_PassKeyBoolean()
{
}
//=======================================================================
-//function :Assign
+//function : ~
//purpose :
//=======================================================================
- NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::Assign(const NMTDS_PassKeyBoolean& anOther)
+ NMTDS_PassKeyBoolean::~NMTDS_PassKeyBoolean()
+{
+}
+//=======================================================================
+//function :operator =
+//purpose :
+//=======================================================================
+ NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::operator =(const NMTDS_PassKeyBoolean& anOther)
{
myFlag=anOther.myFlag;
- NMTDS_PassKey::Assign(anOther);
+ NMTDS_PassKey::operator =(anOther);
return *this;
}
//=======================================================================
Standard_EXPORT NMTDS_PassKeyBoolean();
-
-
-Standard_EXPORT NMTDS_PassKeyBoolean& Assign(const NMTDS_PassKeyBoolean& Other) ;
- NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other)
-{
- return Assign(Other);
-}
-
+Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();
Standard_EXPORT void SetFlag(const Standard_Boolean aFlag) ;
+ Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);
Standard_EXPORT Standard_Boolean Flag() const;
--- Copyright (C) 2006 SAMTECH
+-- Copyright (C) 2005 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 along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
--- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
---
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
-- File: NMTDS_PassKeyMapHasher.cdl
-- Created:
-- Author: Peter KURNEV
-// Copyright (C) 2006 SAMTECH
+// Copyright (C) 2005 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
//function : HashCode
//purpose :
//=======================================================================
- Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPKey,
+ Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPK,
const Standard_Integer Upper)
{
- return aPKey.HashCode(Upper);
+ return aPK.HashCode(Upper);
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
- Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPKey1,
- const NMTDS_PassKey& aPKey2)
+ Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPK1,
+ const NMTDS_PassKey& aPK2)
{
- return aPKey1.IsEqual(aPKey2);
+ return aPK1.IsEqual(aPK2);
}
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTDS_PassKeyShape.cdl
+-- Created:
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+
+
+class PassKeyShape from NMTDS
+
+ ---Purpose:
+
+uses
+ Shape from TopoDS,
+ ListOfShape from TopTools,
+ IndexedMapOfShape from TopTools
+
+--raises
+
+is
+ Create
+ returns PassKeyShape from NMTDS;
+ ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyShape();"
+
+ Create(Other:PassKeyShape from NMTDS)
+ returns PassKeyShape from NMTDS;
+
+ Assign(me:out;
+ Other : PassKeyShape from NMTDS)
+ returns PassKeyShape from NMTDS;
+ ---C++: alias operator =
+ ---C++: return &
+
+ SetShapes(me:out;
+ aS :Shape from TopoDS);
+
+ SetShapes(me:out;
+ aS1 :Shape from TopoDS;
+ aS2 :Shape from TopoDS);
+
+ SetShapes(me:out;
+ aS1 :Shape from TopoDS;
+ aS2 :Shape from TopoDS;
+ aS3 :Shape from TopoDS);
+
+ SetShapes(me:out;
+ aS1 :Shape from TopoDS;
+ aS2 :Shape from TopoDS;
+ aS3 :Shape from TopoDS;
+ aS4 :Shape from TopoDS);
+
+ SetShapes(me:out;
+ aLS :ListOfShape from TopTools);
+
+ Clear(me:out);
+
+
+ NbIds(me)
+ returns Integer from Standard;
+
+ IsEqual(me;
+ aOther:PassKeyShape from NMTDS)
+ returns Boolean from Standard;
+
+ HashCode(me;
+ Upper : Integer from Standard)
+ returns Integer from Standard;
+
+ Dump(me;
+ aHex:Integer from Standard=0);
+
+fields
+ myNbIds:Integer from Standard is protected;
+ mySum :Integer from Standard is protected;
+ myUpper:Integer from Standard is protected;
+ myMap :IndexedMapOfShape from TopTools is protected;
+
+end PassKeyShape;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTDS_PassKeyShape.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShape.ixx>
+
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+
+
+static
+ Standard_Integer NormalizedId(const Standard_Integer aId,
+ const Standard_Integer aDiv);
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTDS_PassKeyShape::NMTDS_PassKeyShape()
+{
+ myUpper=432123;
+}
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTDS_PassKeyShape::NMTDS_PassKeyShape(const NMTDS_PassKeyShape& aOther)
+{
+ myUpper=432123;
+ myNbIds=aOther.myNbIds;
+ mySum=aOther.mySum;
+ myMap=aOther.myMap;
+}
+//=======================================================================
+//function :~
+//purpose :
+//=======================================================================
+ NMTDS_PassKeyShape::~NMTDS_PassKeyShape()
+{
+}
+//=======================================================================
+//function :Assign
+//purpose :
+//=======================================================================
+ NMTDS_PassKeyShape& NMTDS_PassKeyShape::Assign(const NMTDS_PassKeyShape& aOther)
+{
+ myUpper=432123;
+ myNbIds=aOther.myNbIds;
+ mySum=aOther.mySum;
+ myMap=aOther.myMap;
+ return *this;
+}
+//=======================================================================
+//function :Clear
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::Clear()
+{
+ myNbIds=0;
+ mySum=0;
+ myMap.Clear();
+}
+//=======================================================================
+//function :SetShapes
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
+
+{
+ Standard_Integer aHC;
+ //
+ Clear();
+ myNbIds=1;
+ myMap.Add(aS1);
+ aHC=aS1.HashCode(myUpper);
+ mySum=NormalizedId(aHC, myNbIds);
+}
+//=======================================================================
+//function :SetShapes
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2)
+{
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aS1);
+ aLS.Append(aS2);
+ SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3)
+{
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aS1);
+ aLS.Append(aS2);
+ aLS.Append(aS3);
+ SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2,
+ const TopoDS_Shape& aS3,
+ const TopoDS_Shape& aS4)
+{
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aS1);
+ aLS.Append(aS2);
+ aLS.Append(aS3);
+ aLS.Append(aS4);
+ SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS)
+{
+ Standard_Integer i, aId, aIdN;
+ TopTools_ListIteratorOfListOfShape aIt;
+ //
+ Clear();
+ aIt.Initialize(aLS);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ myMap.Add(aS);
+ }
+ myNbIds=myMap.Extent();
+ for(i=1; i<=myNbIds; ++i) {
+ const TopoDS_Shape& aS=myMap(i);
+ aId=aS.HashCode(myUpper);
+ aIdN=NormalizedId(aId, myNbIds);
+ mySum+=aIdN;
+ }
+}
+//=======================================================================
+//function :NbIds
+//purpose :
+//=======================================================================
+ Standard_Integer NMTDS_PassKeyShape::NbIds()const
+{
+ return myNbIds;
+}
+//=======================================================================
+//function :IsEqual
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_PassKeyShape::IsEqual(const NMTDS_PassKeyShape& aOther) const
+{
+ Standard_Boolean bRet;
+ Standard_Integer i;
+ //
+ bRet=Standard_False;
+ //
+ if (myNbIds!=aOther.myNbIds) {
+ return bRet;
+ }
+ for (i=1; i<=myNbIds; ++i) {
+ const TopoDS_Shape& aS=myMap(i);
+ if (!aOther.myMap.Contains(aS)) {
+ return bRet;
+ }
+ }
+ return !bRet;
+}
+//=======================================================================
+//function : HashCode
+//purpose :
+//=======================================================================
+ Standard_Integer NMTDS_PassKeyShape::HashCode(const Standard_Integer aUpper) const
+{
+ return ::HashCode(mySum, aUpper);
+}
+//=======================================================================
+//function : Dump
+//purpose :
+//=======================================================================
+ void NMTDS_PassKeyShape::Dump(const Standard_Integer)const
+{
+}
+//=======================================================================
+// function: NormalizedId
+// purpose :
+//=======================================================================
+Standard_Integer NormalizedId(const Standard_Integer aId,
+ const Standard_Integer aDiv)
+{
+ Standard_Integer aMax, aTresh, aIdRet;
+ //
+ aIdRet=aId;
+ aMax=::IntegerLast();
+ aTresh=aMax/aDiv;
+ if (aId>aTresh) {
+ aIdRet=aId%aTresh;
+ }
+ return aIdRet;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#define _NMTDS_PassKeyShape_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopTools_IndexedMapOfShape_HeaderFile
+#include <TopTools_IndexedMapOfShape.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Shape;
+class TopTools_ListOfShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShape {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTDS_PassKeyShape();
+Standard_EXPORT virtual ~NMTDS_PassKeyShape();
+
+
+Standard_EXPORT NMTDS_PassKeyShape(const NMTDS_PassKeyShape& Other);
+
+
+Standard_EXPORT NMTDS_PassKeyShape& Assign(const NMTDS_PassKeyShape& Other) ;
+ NMTDS_PassKeyShape& operator =(const NMTDS_PassKeyShape& Other)
+{
+ return Assign(Other);
+}
+
+
+
+Standard_EXPORT void SetShapes(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
+
+
+Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
+
+
+Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
+
+
+Standard_EXPORT void SetShapes(const TopTools_ListOfShape& aLS) ;
+
+
+Standard_EXPORT void Clear() ;
+
+
+Standard_EXPORT Standard_Integer NbIds() const;
+
+
+Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aOther) const;
+
+
+Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const;
+
+
+Standard_EXPORT void Dump(const Standard_Integer aHex = 0) const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myNbIds;
+Standard_Integer mySum;
+Standard_Integer myUpper;
+TopTools_IndexedMapOfShape myMap;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_PassKeyShape.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_ListOfShape_HeaderFile
+#include <TopTools_ListOfShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTDS_PassKeyMapHasher.cdl
+-- Created:
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+
+
+class PassKeyShapeMapHasher from NMTDS
+
+ ---Purpose:
+
+uses
+ PassKeyShape from NMTDS
+
+--raises
+
+is
+ HashCode(myclass;
+ aPKey : PassKeyShape from NMTDS;
+ Upper : Integer from Standard)
+ returns Integer from Standard;
+
+
+ IsEqual(myclass;
+ aPKey1 : PassKeyShape from NMTDS;
+ aPKey2 : PassKeyShape from NMTDS)
+ returns Boolean from Standard;
+
+end PassKeyShapeMapHasher;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTDS_PassKeyMapHasher.cxx
+// Created:
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShapeMapHasher.ixx>
+
+//=======================================================================
+//function : HashCode
+//purpose :
+//=======================================================================
+ Standard_Integer NMTDS_PassKeyShapeMapHasher::HashCode(const NMTDS_PassKeyShape& aPK,
+ const Standard_Integer Upper)
+{
+ return aPK.HashCode(Upper);
+}
+//=======================================================================
+//function :IsEqual
+//purpose :
+//=======================================================================
+ Standard_Boolean NMTDS_PassKeyShapeMapHasher::IsEqual(const NMTDS_PassKeyShape& aPK1,
+ const NMTDS_PassKeyShape& aPK2)
+{
+ return aPK1.IsEqual(aPK2);
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#define _NMTDS_PassKeyShapeMapHasher_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class NMTDS_PassKeyShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShapeMapHasher {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT static Standard_Integer HashCode(const NMTDS_PassKeyShape& aPKey,const Standard_Integer Upper) ;
+
+
+Standard_EXPORT static Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aPKey1,const NMTDS_PassKeyShape& aPKey2) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_PassKeyShapeMapHasher.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#include <NMTDS_PassKeyShapeMapHasher.hxx>
+#endif
---Purpose:
-uses
- Shape from TopoDS,
+uses
+ Box from Bnd,
+ IndexedMapOfInteger from TColStd,
+ Shape from TopoDS,
IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations,
CArray1OfIndexRange from NMTDS,
IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS
aMS :out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations);
-- Contribution of Samtech www.samcef.com END
+ GetAllSuccessors(me;
+ anIndex:Integer from Standard;
+ aScrs :out IndexedMapOfInteger from TColStd);
+
+ ComputeBoxEx(me;
+ anIndex:Integer from Standard;
+ aBox:out Box from Bnd);
+
fields
myCompositeShape: Shape from TopoDS is protected;
myRanges : CArray1OfIndexRange from NMTDS is protected;
#include <NMTDS_ShapesDataStructure.ixx>
-
-#include <TColStd_MapOfInteger.hxx>
-
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
-
-#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
#include <NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <NMTDS_IndexRange.hxx>
+//
+#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <NMTDS_Tools.hxx>
+
+
+static
+ void ComputeBoxExS(const Standard_Integer aIx,
+ const NMTDS_ShapesDataStructure* pDS,
+ Bnd_Box& aBoxEx);
+static
+ void GetAllSuccessorsS(const Standard_Integer nS,
+ const NMTDS_ShapesDataStructure* myDS,
+ TColStd_IndexedMapOfInteger& aMA);
//===========================================================================
//function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
}
//modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t
}
- //
aNbS=aMSA.Extent();
//
// Fill myRanges
// Contribution of Samtech www.samcef.com BEGIN
//
// Fill the table
+
//aShift=0;
//for (i=0; i<2; ++i) {
// if (i) {
// InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift);
// }
//}
-
+
aShift=0;
for (j=1; j<=aNbS; ++j) {
const TopoDS_Shape& aSx=aMSA.FindKey(j);
// Contribution of Samtech www.samcef.com END
return aIndex;
}
+
+//=======================================================================
+//function : ComputeBoxEx
+//purpose :
+//=======================================================================
+ void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
+ Bnd_Box& aBoxEx)const
+{
+ ComputeBoxExS(aIx, this, aBoxEx);
+}
+//=======================================================================
+//function : GetAllSuccessors
+//purpose :
+//=======================================================================
+ void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
+ TColStd_IndexedMapOfInteger& aMA)const
+{
+ GetAllSuccessorsS(nS, this, aMA);
+}
+//=======================================================================
+//function : GetAllSuccessorsS
+//purpose :
+//=======================================================================
+void GetAllSuccessorsS(const Standard_Integer nS,
+ const NMTDS_ShapesDataStructure* myDS,
+ TColStd_IndexedMapOfInteger& aMA)
+{
+ TopAbs_ShapeEnum aT;
+ Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
+ Standard_Address xSuccessors;
+ //
+ const TopoDS_Shape& aS=myDS->Shape(nS);
+ aT=aS.ShapeType();
+ if(NMTDS_Tools::HasBRep(aT)) {
+ aMA.Add(nS);
+ //
+ if (aT==TopAbs_VERTEX) {
+ return;
+ }
+ }
+ //
+ myDS->GetSuccessors(nS, xSuccessors, aNbSuccessors);
+ pSuccessors=(Standard_Integer*)xSuccessors;
+ for (i=0; i<aNbSuccessors; ++i) {
+ nSx=pSuccessors[i];
+ GetAllSuccessorsS(nSx, myDS, aMA);
+ }
+}
+//=======================================================================
+// function: ComputeBoxExS
+// purpose:
+//=======================================================================
+ void ComputeBoxExS(const Standard_Integer aIx,
+ const NMTDS_ShapesDataStructure* pDS,
+ Bnd_Box& aBoxEx)
+{
+ Standard_Integer i, aNbS, iS;
+ //
+ const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
+ aBoxEx.Add(aBox);
+ //
+ aNbS=pDS->NumberOfSuccessors(aIx);
+ for (i=1; i<=aNbS; ++i) {
+ Bnd_Box aBoxS;
+ iS=pDS->GetSuccessor(aIx, i);
+ ComputeBoxExS(iS, pDS, aBoxS);
+ aBoxEx.Add(aBoxS);
+ }
+}
class TopoDS_Shape;
class NMTDS_CArray1OfIndexRange;
class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors;
+class TColStd_IndexedMapOfInteger;
+class Bnd_Box;
#ifndef _Standard_HeaderFile
Standard_EXPORT void FillSubshapes(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
+Standard_EXPORT void GetAllSuccessors(const Standard_Integer anIndex,TColStd_IndexedMapOfInteger& aScrs) const;
+
+
+Standard_EXPORT void ComputeBoxEx(const Standard_Integer anIndex,Bnd_Box& aBox) const;
+
+
#ifndef _BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors_HeaderFile
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
#endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
+#ifndef _Bnd_Box_HeaderFile
+#include <Bnd_Box.hxx>
+#endif
#ifndef _NMTDS_ShapesDataStructure_HeaderFile
#include <NMTDS_ShapesDataStructure.hxx>
#endif
--- /dev/null
+-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTDS_Tools.cdl
+-- Created: Tue Feb 20 14:56:14 2007
+-- Author: Peter KURNEV
+-- <pkv@irinox>
+---Copyright: Matra Datavision 2007
+
+
+class Tools from NMTDS
+
+ ---Purpose:
+
+uses
+ ShapeEnum from TopAbs,
+ Vertex from TopoDS,
+ Shape from TopoDS,
+ IndexedDataMapOfShapeShape from TopTools
+
+--raises
+
+is
+ TypeToInteger(myclass;
+ aT1: ShapeEnum from TopAbs;
+ aT2: ShapeEnum from TopAbs)
+ returns Integer from Standard;
+
+ HasBRep(myclass;
+ aT: ShapeEnum from TopAbs)
+ returns Boolean from Standard;
+
+ ComputeVV(myclass;
+ aV1:Vertex from TopoDS;
+ aV2:Vertex from TopoDS)
+ returns Integer from Standard;
+
+ CopyShape(myclass;
+ aS:Shape from TopoDS;
+ aSC:out Shape from TopoDS);
+
+ CopyShape(myclass;
+ aS:Shape from TopoDS;
+ aSC :out Shape from TopoDS;
+ aMSS :out IndexedDataMapOfShapeShape from TopTools);
+--fields
+
+end Tools;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTDS_Tools.cxx
+// Created: Tue Feb 20 14:57:28 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTDS_Tools.ixx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_Pnt.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <BRep_Builder.hxx>
+
+void CopySource(const TopoDS_Shape& aS,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC);
+
+//=======================================================================
+//function : CopyShape
+//purpose :
+//=======================================================================
+ void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
+ TopoDS_Shape& aSC)
+{
+ TopTools_IndexedDataMapOfShapeShape aMapSS;
+ //
+ CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopyShape
+//purpose :
+//=======================================================================
+ void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
+ TopoDS_Shape& aSC,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS)
+{
+ CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopySource
+//purpose :
+//=======================================================================
+void CopySource(const TopoDS_Shape& aS,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC)
+{
+ Standard_Boolean bFree;
+ TopAbs_ShapeEnum aT;
+ TopoDS_Iterator aIt;
+ BRep_Builder BB;
+ //
+ aT=aS.ShapeType();
+ //
+ if (aMapSS.Contains(aS)) {
+ aSC=aMapSS.ChangeFromKey(aS);
+ aSC.Orientation(aS.Orientation());
+ return;
+ }
+ else {
+ aSC=aS.EmptyCopied();
+ aMapSS.Add(aS, aSC);
+ }
+ //
+ bFree=aSC.Free();
+ aSC.Free(Standard_True);
+ aIt.Initialize(aS);
+ for (; aIt.More(); aIt.Next()) {
+ TopoDS_Shape aSCx;
+ //
+ const TopoDS_Shape& aSx=aIt.Value();
+ //
+ CopySource (aSx, aMapSS, aSCx);
+ //
+ aSCx.Orientation(aSx.Orientation());
+ BB.Add(aSC, aSCx);
+ }
+ aSC.Free(bFree);
+}
+//=======================================================================
+// function: ComputeVV
+// purpose:
+//=======================================================================
+ Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
+ const TopoDS_Vertex& aV2)
+{
+ Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
+ gp_Pnt aP1, aP2;
+ //
+ aTolV1=BRep_Tool::Tolerance(aV1);
+ aTolV2=BRep_Tool::Tolerance(aV2);
+ aTolSum=aTolV1+aTolV2;
+ aTolSum2=aTolSum*aTolSum;
+ //
+ aP1=BRep_Tool::Pnt(aV1);
+ aP2=BRep_Tool::Pnt(aV2);
+ //
+ aD2=aP1.SquareDistance(aP2);
+ if (aD2>aTolSum2) {
+ return -1;
+ }
+ return 0;
+}
+//=======================================================================
+// function: HasBRep
+// purpose:
+//=======================================================================
+ Standard_Boolean NMTDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
+{
+ return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
+}
+//=======================================================================
+//function : TypeToInteger
+//purpose :
+//=======================================================================
+ Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2)
+{
+ Standard_Integer iRet, iT1, iT2, iX;
+ //
+ iRet=-1;
+ iT1=(Standard_Integer)aType1;
+ iT2=(Standard_Integer)aType2;
+ //
+ iX=iT2*10+iT1;
+ switch (iX) {
+ case 77:
+ iRet=5; // VV
+ break;
+ case 76:
+ case 67:
+ iRet=4; // VE
+ break;
+ case 74:
+ case 47:
+ iRet=2; // VF
+ break;
+ case 66:
+ iRet=3; // EE
+ break;
+ case 64:
+ case 46:
+ iRet=1; // EF
+ break;
+ case 44:
+ iRet=0; // FF
+ break;
+ default:
+ break;
+ }
+ return iRet;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_Tools_HeaderFile
+#define _NMTDS_Tools_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Vertex;
+class TopoDS_Shape;
+class TopTools_IndexedDataMapOfShapeShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_Tools {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT static Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aT1,const TopAbs_ShapeEnum aT2) ;
+
+
+Standard_EXPORT static Standard_Boolean HasBRep(const TopAbs_ShapeEnum aT) ;
+
+
+Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& aV1,const TopoDS_Vertex& aV2) ;
+
+
+Standard_EXPORT static void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC) ;
+
+
+Standard_EXPORT static void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC,TopTools_IndexedDataMapOfShapeShape& aMSS) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+ // Fields PROTECTED
+ //
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_Tools.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Vertex_HeaderFile
+#include <TopoDS_Vertex.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#endif
+#ifndef _NMTDS_Tools_HeaderFile
+#include <NMTDS_Tools.hxx>
+#endif
Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \
Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \
+ NMTTools_CheckerSI.hxx \
NMTTools_CommonBlockAPI.hxx \
NMTTools_CommonBlock.hxx \
NMTTools_CommonBlockPool.hxx \
NMTTools_CoupleOfShape.hxx \
NMTTools_DEProcessor.hxx \
- NMTTools_DSFiller.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
NMTTools_ListOfCommonBlock.hxx \
NMTTools_ListOfCoupleOfShape.hxx \
NMTTools_PaveFiller.hxx \
- NMTTools_PCurveMaker.hxx \
- NMTTools_PDSFiller.hxx \
NMTTools_PPaveFiller.hxx \
NMTTools_Tools.hxx \
Handle_NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock.hxx \
lib_LTLIBRARIES = libNMTTools.la
dist_libNMTTools_la_SOURCES = \
+ NMTTools_CheckerSI.cxx \
+ NMTTools_CheckerSI_1.cxx \
NMTTools_CommonBlockAPI.cxx \
NMTTools_CommonBlock.cxx \
NMTTools_CommonBlockPool_0.cxx \
NMTTools_CoupleOfShape.cxx \
NMTTools_DEProcessor.cxx \
- NMTTools_DSFiller.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger_0.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape_0.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock_0.cxx \
NMTTools_PaveFiller_8.cxx \
NMTTools_PaveFiller_9.cxx \
NMTTools_PaveFiller.cxx \
- NMTTools_PCurveMaker.cxx \
NMTTools_Tools.cxx \
NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock_0.cxx \
NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock_0.cxx \
NMTDS
is
- class IteratorOfCoupleOfShape;
- class DSFiller;
+ --class IteratorOfCoupleOfShape;
+ --class DSFiller;
class PaveFiller;
class Tools;
class CommonBlock;
class CommonBlockAPI;
- class PCurveMaker;
+ --class PCurveMaker;
class DEProcessor;
- class CoupleOfShape;
-
+ class CoupleOfShape;
+ --modified by NIZNHY-PKV Mon Feb 19 11:39:24 2007f
+ class CheckerSI;
+ --modified by NIZNHY-PKV Mon Feb 19 11:39:27 2007t
+
pointer PPaveFiller to PaveFiller from NMTTools;
- pointer PDSFiller to DSFiller from NMTTools;
+ --pointer PDSFiller to DSFiller from NMTTools;
class ListOfCommonBlock instantiates
List from TCollection(CommonBlock from NMTTools);
--- /dev/null
+-- Copyright (C) 2006 SAMTECH
+--
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either
+-- version 2.1 of the License.
+--
+-- This library is distributed in the hope that it will be useful
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public
+-- License along with this library; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File: NMTTools_CheckerSI.cdl
+-- Created: Mon Feb 19 11:23:55 2007
+-- Author: Peter KURNEV
+
+
+class CheckerSI from NMTTools
+ inherits PaveFiller from NMTTools
+ ---Purpose:
+
+uses
+ ShapeEnum from TopAbs
+
+--raises
+
+is
+
+ Create
+ returns CheckerSI from NMTTools;
+ ---C++: alias "Standard_EXPORT virtual ~NMTTools_CheckerSI();"
+
+ Perform (me:out)
+ is redefined;
+
+ Init (me:out)
+ is redefined protected;
+
+ Clear (me:out)
+ is redefined protected;
+
+ PreparePaveBlocks (me:out;
+ nE:Integer from Standard)
+ is redefined protected;
+
+ PreparePaveBlocks (me:out;
+ aType1: ShapeEnum from TopAbs;
+ aType2: ShapeEnum from TopAbs)
+ is redefined protected;
+
+ StopStatus(me)
+ returns Integer from Standard;
+
+
+fields
+ myStopStatus: Integer from Standard is protected;
+
+end CheckerSI;
--- /dev/null
+// Copyright (C) 2006 SAMTECH
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTTools_CheckerSI.cxx
+// Created: Mon Feb 19 11:32:08 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+#include <NMTDS_InterfPool.hxx>
+#include <NMTTools_DEProcessor.hxx>
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+ NMTTools_CheckerSI::NMTTools_CheckerSI()
+:
+ NMTTools_PaveFiller()
+{
+ myStopStatus=0;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+ NMTTools_CheckerSI::~NMTTools_CheckerSI()
+{
+}
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+ void NMTTools_CheckerSI::Clear()
+{
+ NMTTools_PaveFiller::Clear();
+}
+//=======================================================================
+//function : StopStatus
+//purpose :
+//=======================================================================
+ Standard_Integer NMTTools_CheckerSI::StopStatus()const
+{
+ return myStopStatus;
+}
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+ void NMTTools_CheckerSI::Init()
+{
+ myIsDone=Standard_False;
+ if (myCompositeShape.IsNull()) {
+ return;
+ }
+ //
+ Clear();
+ // 1.
+ myDS=new NMTDS_ShapesDataStructure;
+ myDS->SetCompositeShape(myCompositeShape);
+ myDS->Init();
+ //
+ // 2.
+ myDSIt=new NMTDS_IteratorCheckerSI;
+ myDSIt->SetDS(myDS);
+ myDSIt->Prepare();
+ //
+ // 4.
+ myNbSources=myDS->NumberOfShapesOfTheObject()+
+ myDS->NumberOfShapesOfTheTool();
+ myNbEdges=myDS->NbEdges();
+ // 5
+ myIP=new NMTDS_InterfPool;
+}
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+ void NMTTools_CheckerSI::Perform()
+{
+ myIsDone=Standard_False;
+ myStopStatus=0;
+ //
+ Init();
+ //1.VV
+ //
+ PerformVV();
+ //
+ // 2.VE
+ myPavePool.Resize (myNbEdges);
+
+ PrepareEdges();
+ //
+ PerformVE();
+ //
+ // 3.VF
+ PerformVF();
+ //
+ // 4.EE
+ myCommonBlockPool.Resize (myNbEdges);
+ mySplitShapesPool.Resize (myNbEdges);
+ myPavePoolNew .Resize (myNbEdges);
+ //
+ PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
+ if (myStopStatus) {
+ return;
+ }
+ PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
+ if (myStopStatus) {
+ return;
+ }
+ //
+ PerformEE();
+ //
+ RefinePavePool ();
+ if (myStopStatus) {
+ return;
+ }
+ //
+ myPavePoolNew.Destroy();
+ myPavePoolNew.Resize (myNbEdges);
+ //
+ // 5.EF
+ PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
+ if (myStopStatus) {
+ return;
+ }
+ //
+ PerformEF();
+ //
+ RefinePavePool();
+ if (myStopStatus) {
+ return;
+ }
+ //
+ myPavePoolNew.Destroy();
+ //
+ MakeSplitEdges();
+ //
+ UpdateCommonBlocks();
+ //
+ // 6. FF
+ PerformFF ();
+ //
+ MakeBlocks();
+ //
+ MakePCurves();
+ //
+ // 7. Postprocessing
+ UpdatePaveBlocks();
+ //
+ NMTTools_DEProcessor aDEP(*this);
+ aDEP.Do();
+ //
+ MakeAloneVertices();
+ //
+ myIsDone=Standard_True;
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#define _NMTTools_CheckerSI_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTTools_CheckerSI : public NMTTools_PaveFiller {
+
+public:
+
+ void* operator new(size_t,void* anAddress)
+ {
+ return anAddress;
+ }
+ void* operator new(size_t size)
+ {
+ return Standard::Allocate(size);
+ }
+ void operator delete(void *anAddress)
+ {
+ if (anAddress) Standard::Free((Standard_Address&)anAddress);
+ }
+ // Methods PUBLIC
+ //
+
+
+Standard_EXPORT NMTTools_CheckerSI();
+Standard_EXPORT virtual ~NMTTools_CheckerSI();
+
+
+Standard_EXPORT virtual void Perform() ;
+
+
+Standard_EXPORT Standard_Integer StopStatus() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ //
+
+
+Standard_EXPORT virtual void Init() ;
+
+
+Standard_EXPORT virtual void Clear() ;
+
+
+Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer nE) ;
+
+
+Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ;
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myStopStatus;
+
+
+private:
+
+ // Methods PRIVATE
+ //
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTTools_CheckerSI.jxx>
+
+
+
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#include <NMTTools_CheckerSI.hxx>
+#endif
--- /dev/null
+// Copyright (C) 2006 SAMTECH
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File: NMTTools_CheckerSI.cxx
+// Created: Mon Feb 19 11:32:08 2007
+// Author: Peter KURNEV
+// <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+
+#include <NMTDS_InterfPool.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+#include <BOPTools_PaveSet.hxx>
+#include <BOPTools_PaveBlockIterator.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <IntTools_Range.hxx>
+#include <BOPTools_Pave.hxx>
+#include <IntTools_ShrunkRange.hxx>
+#include <BOPTColStd_Failure.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <Geom_Curve.hxx>
+#include <gp_Pnt.hxx>
+
+
+
+static
+ Standard_Boolean IsValid(const TopoDS_Edge& aE,
+ const TopoDS_Vertex& aV,
+ const Standard_Real aTV1,
+ const Standard_Real aTV2);
+
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose:
+//=======================================================================
+ void NMTTools_CheckerSI::PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2)
+{
+ NMTTools_PaveFiller::PreparePaveBlocks(aType1, aType2);
+}
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose:
+//=======================================================================
+ void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
+{
+ myIsDone=Standard_False;
+ //
+ char buf[32]={"SR"};
+ Standard_Boolean bIsValid;
+ Standard_Integer nV1, nV2, iErr;
+ Standard_Real aT1, aT2;
+ TopoDS_Edge aE;
+ TopoDS_Vertex aV1, aV2;
+ //
+ BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
+ // Edge
+ aE=TopoDS::Edge(myDS->Shape(nE));
+ if (BRep_Tool::Degenerated(aE)) {
+ myIsDone=Standard_True;
+ return;
+ }
+ //
+ BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+
+ BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+ for (; aPBIt.More(); aPBIt.Next()) {
+ BOPTools_PaveBlock& aPB=aPBIt.Value();
+ const IntTools_Range& aRange=aPB.Range();
+ //
+ const BOPTools_Pave& aPave1=aPB.Pave1();
+ nV1=aPave1.Index();
+ aV1=TopoDS::Vertex(myDS->Shape(nV1));
+ aT1=aPave1.Param();
+ //
+ const BOPTools_Pave& aPave2=aPB.Pave2();
+ nV2=aPave2.Index();
+ aV2=TopoDS::Vertex(myDS->Shape(nV2));
+ aT2=aPave2.Param();
+ //
+ bIsValid=Standard_True;
+ if (nV1==nV2) {
+ bIsValid=IsValid(aE, aV1, aT1, aT2);
+ if (!bIsValid) {
+ //printf(" pb SR: nV nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+ myStopStatus=1;
+ }
+ }
+ //
+ IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+ iErr=aSR.ErrorStatus();
+ if (!aSR.IsDone()) {
+ //printf(" pb SR: Done nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+ aSR.SetShrunkRange(aRange);
+ //throw BOPTColStd_Failure(buf) ;
+ }
+ else if (iErr!=6) {
+ CorrectShrunkRanges (0, aPave1, aSR);
+ CorrectShrunkRanges (1, aPave2, aSR);
+ }
+ aPB.SetShrunkRange(aSR);
+ aLPB.Append(aPB);
+ } //for (; aPBIt.More(); aPBIt.Next())
+ myIsDone=Standard_True;
+}
+
+//=======================================================================
+//function : IsValid
+//purpose :
+//=======================================================================
+Standard_Boolean IsValid(const TopoDS_Edge& aE,
+ const TopoDS_Vertex& aV,
+ const Standard_Real aTV1,
+ const Standard_Real aTV2)
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aNbP, aNbP1;
+ Standard_Real aTolV2, aTC1, aTC2, dT, aTC, aD2;
+ Handle(Geom_Curve) aC;
+ gp_Pnt aPV, aPC;
+ //
+ bRet=Standard_False;
+ aTolV2=BRep_Tool::Tolerance(aV);
+ aTolV2=aTolV2*aTolV2;
+ aPV=BRep_Tool::Pnt(aV);
+ aC=BRep_Tool::Curve(aE, aTC1, aTC2);
+ aNbP=7;
+ aNbP1=aNbP-1;
+ dT=(aTV2-aTV1)/aNbP1;
+ //
+ for (i=1; i<aNbP-1 && !bRet ; ++i) {
+ aTC=aTV1+dT*i;
+ aC->D0(aTC, aPC);
+ aD2=aPV.SquareDistance(aPC);
+ bRet=aD2>aTolV2;
+ }
+ return bRet;
+}
#include <BOPTools_PavePool.hxx>
#include <BOPTools_PaveSet.hxx>
#include <BOPTools_Tools3D.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_SplitShapesPool.hxx>
#include <ElCLib.hxx>
#include <gp_Lin2d.hxx>
-
+#include <NMTDS_InterfPool.hxx>
//=======================================================================
// function: NMTTools_DEProcessor::NMTTools_DEProcessor
void NMTTools_DEProcessor::DoPaves()
{
- Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB;
+ Standard_Integer i, aNbE, nED, nVD, aNbLPB, nFD;
//
nFD=0;
aNbE=myDEMap.Extent();
TColStd_ListIteratorOfListOfInteger anIt(nLF);
for (; anIt.More(); anIt.Next()) {
nFD=anIt.Value();
- //
+
BOPTools_ListOfPaveBlock aLPB;
FindPaveBlocks(nED, nVD, nFD, aLPB);
- //modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f
- //
+ // xxf
aNbLPB=aLPB.Extent();
if (!aNbLPB) {
continue;
}
- //modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t
+ //xxt
FillPaveSet (nED, nVD, nFD, aLPB);
}
//
BOPTools_ListIteratorOfListOfPaveBlock anIt;
Standard_Integer i, aNb, nF2, nV;
//
- BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+ //BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=(myFiller->IP())->SSInterferences();
//
aNb=aFFs.Extent();
for (i=1; i<=aNb; ++i) {
---Purpose:
uses
- -- Modified to add new definitions Thu Sep 14 14:35:18 2006
- -- Contribution of Samtech www.samcef.com BEGIN
- ListOfInteger from TColStd,
- -- Contribution of Samtech www.samcef.com END
DataMapOfIntegerInteger from TColStd,
Pnt from gp,
ShapeEnum from TopAbs,
Vertex from TopoDS,
Face from TopoDS,
+ Shape from TopoDS,
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
Edge from TopoDS,
- ListOfShape from TopTools,
+ ListOfShape from TopTools,
+ DataMapOfShapeShape from TopTools,
+ ListOfInteger from TColStd,
-- Contribution of Samtech www.samcef.com END
Context from IntTools,
IndexedDataMapOfShapeInteger from BooleanOperations,
- InterferencePool from BOPTools,
- PInterferencePool from BOPTools,
+ --InterferencePool from BOPTools,
+ --PInterferencePool from BOPTools,
PavePool from BOPTools,
PaveBlock from BOPTools,
ListOfPaveBlock from BOPTools,
CommonBlockPool from NMTTools,
CommonBlock from NMTTools,
ListOfCommonBlock from NMTTools,
- -- Modified to add new definitions Thu Sep 14 14:35:18 2006
- -- Contribution of Samtech www.samcef.com BEGIN
- IndexedDataMapOfIndexedMapOfInteger from NMTTools,
- -- Contribution of Samtech www.samcef.com END
+
ShapesDataStructure from NMTDS,
+
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
PShapesDataStructure from NMTDS,
- Iterator from NMTDS
+ Iterator from NMTDS,
+ IndexedDataMapOfIndexedMapOfInteger from NMTTools,
-- Contribution of Samtech www.samcef.com END
+
+ PIterator from NMTDS,
+ PInterfPool from NMTDS
--raises
is
Create
- returns PaveFiller from NMTTools;
+ returns PaveFiller from NMTTools;
+ ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller();"
- Create(aIP:InterferencePool from BOPTools)
- returns PaveFiller from NMTTools;
+ -- Create(aIP:InterferencePool from BOPTools)
+ -- returns PaveFiller from NMTTools;
- Destroy (me: in out)
- is virtual;
- ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
+ -- Destroy (me: in out)
+ --is virtual;
+ -- -C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
--
-- Selectors/Modifiers
- SetInterferencePool(me:out;
- aIP:InterferencePool from BOPTools);
-
- InterfPool(me:out)
- returns PInterferencePool from BOPTools;
+ --SetInterferencePool(me:out;
+ -- aIP:PInterferencePool from BOPTools);
+
+ SetCompositeShape (me:out;
+ aS: Shape from TopoDS);
+
+ CompositeShape(me)
+ returns Shape from TopoDS;
+ ---C++: return const&
+
+ --InterfPool(me:out)
+ --returns PInterferencePool from BOPTools;
+
+ --SetDS(me:out;
+ -- aDS:PShapesDataStructure from NMTDS);
+
+ DS(me:out)
+ returns PShapesDataStructure from NMTDS;
+
+ --SetDSIt(me:out;
+ -- aIt:PIterator from NMTDS);
+
+ DSIt(me:out)
+ returns PIterator from NMTDS;
+
+ IP(me:out)
+ returns PInterfPool from NMTDS;
--
-- Perform the algo
-- Modified to add new method Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
- Init (me:out);
+ Init (me:out)
+ is virtual protected;
-- Contribution of Samtech www.samcef.com END
+ Clear (me:out)
+ is virtual protected;
+
Perform (me:out)
is virtual;
PerformVV (me:out)
- is virtual ;
+ is virtual protected;
PerformVE (me:out)
is virtual protected;
anE:Integer from Standard)
is virtual protected;
- PerformNewVertices (me:out)
- is virtual ;
+ --PerformNewVertices (me:out)
+ --is virtual;
PrepareEdges (me:out)
is virtual protected;
- SortTypes (me;
- anInd1:in out Integer from Standard;
- anInd2:in out Integer from Standard)
- is protected;
+ --SortTypes (me;
+ -- anInd1:in out Integer from Standard;
+ -- anInd2:in out Integer from Standard)
+ -- is protected;
- ExpectedPoolLength(me)
- returns Integer from Standard
- is protected;
+ --ExpectedPoolLength(me)
+ -- returns Integer from Standard
+ --is protected;
--
-- Query section
IsDone(me)
returns Boolean from Standard;
- DS(me:out)
- returns PShapesDataStructure from NMTDS;
-
Context(me)
returns Context from IntTools;
---C++:return const &
nV: Integer from Standard)
returns Integer from Standard;
- IsSuccesstorsComputed (me;
+ IsSuccessorsComputed (me;
iF1:Integer from Standard;
iF2:Integer from Standard)
returns Boolean from Standard
aLSE :out ListOfShape from TopTools);
-- Contribution of Samtech www.samcef.com END
+ FuseVertices(me;
+ aC:Shape from TopoDS;
+ aDMVV: out DataMapOfShapeShape from TopTools);
+
fields
- myIntrPool : PInterferencePool from BOPTools is protected;
+ --myIntrPool : PInterferencePool from BOPTools is protected;
myDS : PShapesDataStructure from NMTDS is protected;
myIsDone : Boolean from Standard is protected;
myNbSources : Integer from Standard is protected;
myNbEdges : Integer from Standard is protected;
- -- Modified to add new field Thu Sep 14 14:35:18 2006
- -- Contribution of Samtech www.samcef.com BEGIN
- myDSIt : Iterator from NMTDS is protected;
- -- Contribution of Samtech www.samcef.com END
-
myPavePool : PavePool from BOPTools is protected;
myPavePoolNew : PavePool from BOPTools is protected;
myCommonBlockPool : CommonBlockPool from NMTTools is protected;
myContext : Context from IntTools is protected;
mySectionAttribute : SSIntersectionAttribute from BOPTools is protected;
myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;
- --
- myVSD : DataMapOfIntegerInteger from TColStd is protected;
- --
+ --modified by NIZNHY-PKV Wed Oct 11 11:06:50 2006f
+ myVSD : DataMapOfIntegerInteger from TColStd is protected;
+ myDSIt : PIterator from NMTDS is protected;
+ myCompositeShape : Shape from TopoDS is protected;
+ myIP : PInterfPool from NMTDS is protected;
+ --modified by NIZNHY-PKV Wed Oct 11 11:06:55 2006t
end PaveFiller;
#include <BOPTColStd_Failure.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DEProcessor.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
-//
//=======================================================================
// function: NMTTools_PaveFiller::NMTTools_PaveFiller
// purpose:
//=======================================================================
NMTTools_PaveFiller::NMTTools_PaveFiller()
{
- myIntrPool=NULL;
myDS=NULL;
+ myDSIt=NULL;
myIsDone=Standard_False;
myNbSources=0;
myNbEdges=0;
+ myIP=NULL;
}
//=======================================================================
-// function:NMTTools_PaveFiller::NMTTools_PaveFiller
+// function: ~
// purpose:
//=======================================================================
- NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP)
+ NMTTools_PaveFiller::~NMTTools_PaveFiller()
{
- SetInterferencePool(aIP);
+ Clear();
}
//=======================================================================
-// function: Destroy
+// function: Clear
// purpose:
//=======================================================================
- void NMTTools_PaveFiller::Destroy()
+ void NMTTools_PaveFiller::Clear()
{
+ if (myDSIt) {
+ delete myDSIt;
+ }
+ if (myDS) {
+ delete myDS;
+ }
+ myDSIt=NULL;
+ myDS=NULL;
+
+ if (myIP) {
+ delete myIP;
+ }
+ myIP=NULL;
}
//=======================================================================
-// function: SetInterferencePool
+// function: SetCompositeShape
// purpose:
//=======================================================================
- void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP)
+ void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
{
- myIsDone=Standard_False;
- //
- myIntrPool=(BOPTools_InterferencePool*)&aIP;
- myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS();
- myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool();
- myNbEdges=myDS->NbEdges();
+ myCompositeShape=aS;
}
//=======================================================================
-// function: InterfPool
+// function: CompositeShape
// purpose:
//=======================================================================
- BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool()
+ const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
{
- return myIntrPool;
+ return myCompositeShape;
}
//=======================================================================
-// function:IsDone
+// function: DS
// purpose:
//=======================================================================
- Standard_Boolean NMTTools_PaveFiller::IsDone() const
+ NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
{
- return myIsDone;
+ return myDS;
}
//=======================================================================
-// function: DS
+// function: DSIt
// purpose:
//=======================================================================
- NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
+ NMTDS_PIterator NMTTools_PaveFiller::DSIt()
{
- return myDS;
+ return myDSIt;
+}
+//=======================================================================
+// function: IP
+// purpose:
+//=======================================================================
+ NMTDS_PInterfPool NMTTools_PaveFiller::IP()
+{
+ return myIP;
+}
+//=======================================================================
+// function:IsDone
+// purpose:
+//=======================================================================
+ Standard_Boolean NMTTools_PaveFiller::IsDone() const
+{
+ return myIsDone;
}
//=======================================================================
// function: Context
{
return mySplitShapesPool;
}
-
//=======================================================================
// function: ChangeSplitShapesPool
// purpose:
//=======================================================================
void NMTTools_PaveFiller::Init()
{
- myDSIt.SetDS(myDS);
- // Modified Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
- myDSIt.Prepare();
- // Contribution of Samtech www.samcef.com END
+ myIsDone=Standard_False;
+ if (myCompositeShape.IsNull()) {
+ return;
+ }
+ //
+ Clear();
+ // 1.
+ myDS=new NMTDS_ShapesDataStructure;
+ myDS->SetCompositeShape(myCompositeShape);
+ myDS->Init();
+ //
+ // 2.
+ myDSIt=new NMTDS_Iterator;
+ myDSIt->SetDS(myDS);
+ myDSIt->Prepare();
+ //
+ // 3.
+ myNbSources=myDS->NumberOfShapesOfTheObject()+
+ myDS->NumberOfShapesOfTheTool();
+ myNbEdges=myDS->NbEdges();
+ //
+ // 4
+ myIP=new NMTDS_InterfPool;
}
//=======================================================================
{
myIsDone=Standard_False;
//
+ //----------------
try {
// 0.
// Modified Thu Sep 14 14:35:18 2006
//1.VV
//
PerformVV();
- PerformNewVertices();
//
// 2.VE
myPavePool.Resize (myNbEdges);
//
// 5.EF
PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
-
PerformEF();
//
RefinePavePool();
#ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile
-#ifndef _BOPTools_PInterferencePool_HeaderFile
-#include <BOPTools_PInterferencePool.hxx>
-#endif
#ifndef _NMTDS_PShapesDataStructure_HeaderFile
#include <NMTDS_PShapesDataStructure.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
-#ifndef _NMTDS_Iterator_HeaderFile
-#include <NMTDS_Iterator.hxx>
-#endif
#ifndef _BOPTools_PavePool_HeaderFile
#include <BOPTools_PavePool.hxx>
#endif
#ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
#include <TColStd_DataMapOfIntegerInteger.hxx>
#endif
+#ifndef _NMTDS_PIterator_HeaderFile
+#include <NMTDS_PIterator.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#include <NMTDS_PInterfPool.hxx>
+#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
-class BOPTools_InterferencePool;
+class TopoDS_Shape;
class BOPTools_Pave;
class IntTools_ShrunkRange;
class IntTools_Context;
class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
class TopTools_ListOfShape;
class TopoDS_Edge;
+class TopTools_DataMapOfShapeShape;
#ifndef _Standard_HeaderFile
Standard_EXPORT NMTTools_PaveFiller();
+Standard_EXPORT virtual ~NMTTools_PaveFiller();
-Standard_EXPORT NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP);
+Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ;
-Standard_EXPORT virtual void Destroy() ;
-Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}
+Standard_EXPORT const TopoDS_Shape& CompositeShape() const;
-Standard_EXPORT void SetInterferencePool(const BOPTools_InterferencePool& aIP) ;
+Standard_EXPORT NMTDS_PShapesDataStructure DS() ;
-Standard_EXPORT BOPTools_PInterferencePool InterfPool() ;
+Standard_EXPORT NMTDS_PIterator DSIt() ;
-Standard_EXPORT void Init() ;
+Standard_EXPORT NMTDS_PInterfPool IP() ;
Standard_EXPORT virtual void Perform() ;
-Standard_EXPORT virtual void PerformVV() ;
-
-
-Standard_EXPORT virtual void PerformNewVertices() ;
-
-
Standard_EXPORT Standard_Boolean IsDone() const;
-Standard_EXPORT NMTDS_PShapesDataStructure DS() ;
-
-
Standard_EXPORT const IntTools_Context& Context() const;
Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ;
+Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const;
+
+
//
+Standard_EXPORT virtual void Init() ;
+
+
+Standard_EXPORT virtual void Clear() ;
+
+
+Standard_EXPORT virtual void PerformVV() ;
+
+
Standard_EXPORT virtual void PerformVE() ;
Standard_EXPORT virtual void PrepareEdges() ;
-Standard_EXPORT void SortTypes(Standard_Integer& anInd1,Standard_Integer& anInd2) const;
-
-
-Standard_EXPORT Standard_Integer ExpectedPoolLength() const;
-
-
-Standard_EXPORT Standard_Boolean IsSuccesstorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
+Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const;
// Fields PROTECTED
//
-BOPTools_PInterferencePool myIntrPool;
NMTDS_PShapesDataStructure myDS;
Standard_Boolean myIsDone;
Standard_Integer myNbSources;
Standard_Integer myNbEdges;
-NMTDS_Iterator myDSIt;
BOPTools_PavePool myPavePool;
BOPTools_PavePool myPavePoolNew;
NMTTools_CommonBlockPool myCommonBlockPool;
BOPTools_SSIntersectionAttribute mySectionAttribute;
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
TColStd_DataMapOfIntegerInteger myVSD;
+NMTDS_PIterator myDSIt;
+TopoDS_Shape myCompositeShape;
+NMTDS_PInterfPool myIP;
private:
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#ifndef _BOPTools_InterferencePool_HeaderFile
-#include <BOPTools_InterferencePool.hxx>
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
#endif
#ifndef _BOPTools_Pave_HeaderFile
#include <BOPTools_Pave.hxx>
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
+#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
+#include <TopTools_DataMapOfShapeShape.hxx>
+#endif
#ifndef _NMTTools_PaveFiller_HeaderFile
#include <NMTTools_PaveFiller.hxx>
#endif
// Copyright (C) 2005 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
+// 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
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: NMTTools_PaveFiller_1.cxx
-// Created: Mon Dec 8 11:47:55 2003
+// File: NMTTools_PaveFiller_0.cxx
+// Created: Mon Dec 8 11:45:51 2003
// Author: Peter KURNEV
// <pkv@irinox>
+
#include <NMTTools_PaveFiller.ixx>
+#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopAbs_ShapeEnum.hxx>
-#include <BOPTools_ListOfCoupleOfInteger.hxx>
+
+#include <NMTDS_InterfPool.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <BooleanOperations_OnceExplorer.hxx>
+#include <NMTDS_Iterator.hxx>
//=======================================================================
-//function : SortTypes
-//purpose :
+// function:IsSuccesstorsComputed
+// purpose:
//=======================================================================
- void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
- Standard_Integer& theWith)const
-{
- Standard_Boolean aReverseFlag=Standard_True;
-
- TopAbs_ShapeEnum aType1= myDS->GetShapeType(theWhat),
- aType2= myDS->GetShapeType(theWith);
-
- if (aType1==aType2)
- return;
-
- if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE){
- aReverseFlag=Standard_False;
+ Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
+ const Standard_Integer aN2)const
+{
+ Standard_Boolean bComputed;
+ Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
+ TopAbs_ShapeEnum aType;
+ TColStd_IndexedMapOfInteger aMSuc;
+ //
+ n1=aN1;
+ n2=aN2;
+ aType=myDS->GetShapeType(aN1);
+ if (aType!=TopAbs_VERTEX) {
+ ntmp=n1;
+ n1=n2;
+ n2=ntmp;
}
-
- if (aType1==TopAbs_VERTEX &&
- (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
- aReverseFlag=Standard_False;
+ //
+ myDS->GetAllSuccessors(n2, aMSuc);
+ aNbS=aMSuc.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ nSuc=aMSuc(i);
+ bComputed=myIP->Contains(n1, nSuc);
+ if (bComputed) {
+ break;
+ }
}
-
- Standard_Integer aWhat, aWith;
- aWhat=(aReverseFlag) ? theWith : theWhat;
- aWith=(aReverseFlag) ? theWhat : theWith;
-
- theWhat=aWhat;
- theWith=aWith;
+ return bComputed;
}
+/*
//=======================================================================
// function: ExpectedPoolLength
// purpose:
// Contribution of Samtech www.samcef.com BEGIN
//const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
//aNbIIs=aLC.Extent();
- aNbIIs=myDSIt.ExpectedLength();
+ aNbIIs=myDSIt->ExpectedLength();
// Contribution of Samtech www.samcef.com END
//
if (aNbIIs==1) {
return aNbIIs;
}
+*/
+/*
//=======================================================================
-// function:IsSuccesstorsComputed
-// purpose:
+//function : SortTypes
+//purpose :
//=======================================================================
- Standard_Boolean NMTTools_PaveFiller::IsSuccesstorsComputed(const Standard_Integer aN1,
- const Standard_Integer aN2)const
-{
- Standard_Integer nSuc, n1, n2;
-
- BooleanOperations_OnceExplorer aExp(*myDS);
- TopAbs_ShapeEnum aType=myDS->GetShapeType(aN1);
-
- n1=aN1;
- n2=aN2;
-
- if (aType!=TopAbs_VERTEX) {
- Standard_Integer ntmp=n1;
- n1=n2;
- n2=ntmp;
+ void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
+ Standard_Integer& theWith)const
+{
+ Standard_Integer aWhat, aWith;
+ Standard_Boolean aReverseFlag;
+ TopAbs_ShapeEnum aType1, aType2;
+ //
+ aType1= myDS->GetShapeType(theWhat),
+ aType2= myDS->GetShapeType(theWith);
+ //
+ if (aType1==aType2) {
+ return;
}
-
- aType=myDS->GetShapeType(n2);
- if (aType==TopAbs_EDGE) {
- aExp.Init(n2, TopAbs_VERTEX);
- for (; aExp.More(); aExp.Next()) {
- nSuc=aExp.Current();
- if (myIntrPool->IsComputed(n1, nSuc)) {
- return Standard_True;
- }
- }
- return Standard_False;
+ //
+ aReverseFlag=Standard_True;
+ if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
+ aReverseFlag=Standard_False;
}
-
- else if (aType==TopAbs_FACE) {
- aExp.Init(n2, TopAbs_VERTEX);
- for (; aExp.More(); aExp.Next()) {
- nSuc=aExp.Current();
- if (myIntrPool->IsComputed(n1, nSuc)) {
- return Standard_True;
- }
- }
-
- aExp.Init(n2, TopAbs_EDGE);
- for (; aExp.More(); aExp.Next()) {
- nSuc=aExp.Current();
- if (myIntrPool->IsComputed(n1, nSuc)) {
- return Standard_True;
- }
- }
- return Standard_False;
+ if (aType1==TopAbs_VERTEX &&
+ (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
+ aReverseFlag=Standard_False;
}
-
- return Standard_False;
+ //
+ aWhat=(aReverseFlag) ? theWith : theWhat;
+ aWith=(aReverseFlag) ? theWhat : theWith;
+ //
+ theWhat=aWhat;
+ theWith=aWith;
}
+*/
// Created: Mon Dec 8 11:47:55 2003
// Author: Peter KURNEV
// <pkv@irinox>
+
#include <NMTTools_PaveFiller.ixx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-
+
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_ListOfShape.hxx>
#include <IntTools_Tools.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
-#include <BOPTools_VVInterference.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+
#include <NMTTools_Tools.hxx>
//=======================================================================
{
myIsDone=Standard_False;
//
- Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD;
- Standard_Integer nVnew;
+ Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
- TColStd_ListIteratorOfListOfInteger aIt;
+ TColStd_ListIteratorOfListOfInteger aItX, aItY;
+ TColStd_ListOfInteger aLIX;
TopTools_ListOfShape aLV;
TopoDS_Vertex aVnew;
- TopoDS_Shape aS;
//
myVSD.Clear();
//
- BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
- //
- // BlockLength correction
- aNbVVs=ExpectedPoolLength();
- aBlockLength=aVVs.BlockLength();
- if (aNbVVs > aBlockLength) {
- aVVs.SetBlockLength(aNbVVs);
- }
- //
- const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
+ const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
aNbVSD=aMVSD.Extent();
if (!aNbVSD) {
return;
}
//
+ BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
+ //
+ // BlockLength correction
+ myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+ aNbVVs=myDSIt->BlockLength();
+ aBL=aVVs.BlockLength();
+ if (aNbVVs > aBL) {
+ aVVs.SetBlockLength(aNbVVs);
+ }
+ //
aIt1.Initialize(aMVSD);
for (; aIt1.More(); aIt1.Next()) {
aLV.Clear();
//
- aWhat=aIt1.Key();
+ n1=aIt1.Key();
const TColStd_ListOfInteger& aLIV=aIt1.Value();
//
// new vertex
- aIt.Initialize(aLIV);
- for (; aIt.More(); aIt.Next()) {
- aWith=aIt.Value();
- aS=myDS->Shape(aWith);
- aLV.Append(aS);
+ const TopoDS_Shape& aS1=myDS->Shape(n1);
+ aLV.Append(aS1);
+ aItX.Initialize(aLIV);
+ for (; aItX.More(); aItX.Next()) {
+ n2=aItX.Value();
+ const TopoDS_Shape& aS2=myDS->Shape(n2);
+ aLV.Append(aS2);
}
- aS=myDS->Shape(aWhat);
- aLV.Append(aS);
//
NMTTools_Tools::MakeNewVertex(aLV, aVnew);
//
nVnew=myDS->NumberOfInsertedShapes();
myDS->SetState (nVnew, BooleanOperations_ON);
//
+ // myVSD, aLIX
+ aLIX.Clear();
+ aLIX.Append(n1);
+ myVSD.Bind(n1, nVnew);
+ //
+ aItX.Initialize(aLIV);
+ for (; aItX.More(); aItX.Next()) {
+ n2=aItX.Value();
+ aLIX.Append(n2);
+ myVSD.Bind(n2, nVnew);
+ }
+ //
// interferences
- aIt.Initialize(aLIV);
- for (; aIt.More(); aIt.Next()) {
- aWith=aIt.Value();
- BOPTools_VVInterference aVV(aWhat, aWith);
- aVV.SetNewShape(nVnew);
- anIndexIn=aVVs.Append(aVV);
- myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
- //
- // to find SD-Vertices
- myVSD.Bind(aWith, nVnew);
+ aItX.Initialize(aLIX);
+ for (i=0; aItX.More(); aItX.Next(), ++i) {
+ aItY.Initialize(aLIX);
+ for (j=0; aItY.More(); aItY.Next(), ++j) {
+ if (j>i) {
+ n1=aItX.Value();
+ n2=aItY.Value();
+ myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
+ //
+ BOPTools_VVInterference aVV(n1, n2);
+ aVV.SetNewShape(nVnew);
+ aVVs.Append(aVV);
+ }
+ }
}
- myVSD.Bind(aWhat, nVnew);
}//for (; aIt1.More(); aIt1.Next()) {
myIsDone=Standard_True;
}
//=======================================================================
-// function: PerformNewVertices
-// purpose:
-//=======================================================================
- void NMTTools_PaveFiller::PerformNewVertices()
-{
-}
-//=======================================================================
// function: FindSDVertex
// purpose:
//=======================================================================
}
return nVSD;
}
+/*
+//=======================================================================
+// function: PerformNewVertices
+// purpose:
+//=======================================================================
+ void NMTTools_PaveFiller::PerformNewVertices()
+{
+}
+*/
// Copyright (C) 2005 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
+// 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
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <BOPTools_VEInterference.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
+#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
#include <BOPTools_IndexedMapOfCoupleOfInteger.hxx>
#include <BOPTools_CoupleOfInteger.hxx>
#include <BooleanOperations_OnceExplorer.hxx>
-//
+
static
Standard_Boolean Contains(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END
+
+//=======================================================================
+// function: PerformVE
+// purpose:
+//=======================================================================
+ void NMTTools_PaveFiller::PerformVE()
+{
+ myIsDone=Standard_False;
+ //
+ Standard_Boolean bJustAdd;
+ Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
+ Standard_Real aT;
+ TopoDS_Vertex aV1;
+ TopoDS_Edge aE2;
+ BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
+ BOPTools_CoupleOfInteger aCouple;
+ //
+ BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
+ //
+ myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
+ //
+ // BlockLength correction
+ aNbVEs=myDSIt->BlockLength();
+ aBlockLength=aVEs.BlockLength();
+ if (aNbVEs > aBlockLength) {
+ aVEs.SetBlockLength(aNbVEs);
+ }
+ //
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bJustAdd);
+ if (!IsSuccessorsComputed(n1, n2)) {
+ anIndexIn=0;
+ aWhat=n1; // Vertex
+ aWith=n2; // Edge
+ if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
+ aWhat=n2;
+ aWith=n1;
+ }
+ //
+ if(bJustAdd) {
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+ continue;
+ }
+ // Edge
+ aE2=TopoDS::Edge(myDS->Shape(aWith));
+ if (BRep_Tool::Degenerated(aE2)){
+ continue;
+ }
+ // Vertex
+ nV1=aWhat;
+ aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+ //
+ iSDV=FindSDVertex(aWhat);
+ if (iSDV) {
+ nV1=iSDV;
+ aV1=TopoDS::Vertex(myDS->Shape(nV1));
+ // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
+ // Contribution of Samtech www.samcef.com BEGIN
+ Standard_Integer nVE, iSDVE, iRet;
+ //
+ BooleanOperations_OnceExplorer aExp(*myDS);
+ iRet=0;
+ aExp.Init(aWith, TopAbs_VERTEX);
+ for (; aExp.More(); aExp.Next()) {
+ nVE=aExp.Current();
+ iSDVE=FindSDVertex(nVE);
+ if (iSDVE==iSDV) {
+ iRet=1;
+ break;
+ }
+ }
+ if (iRet) {
+ continue;
+ }
+ }
+ else {
+ if (Contains(aE2, aV1)) {
+ continue;
+ }
+ // Contribution of Samtech www.samcef.com END
+ }
+ //
+ aFlag=myContext.ComputeVE (aV1, aE2, aT);
+ //
+ if (!aFlag) {
+ // Add Interference to the Pool
+ BOPTools_VEInterference anInterf (aWhat, aWith, aT);
+ anIndexIn=aVEs.Append(anInterf);
+ //
+ // Add Pave to the Edge's myPavePool
+ aCouple.SetCouple(nV1, aWith);
+ if (!aSnareMap.Contains(aCouple)){
+ aSnareMap.Add(aCouple);
+ //
+ BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
+ aPave.SetInterference(anIndexIn);
+ BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
+ aPaveSet.Append(aPave);
+ }
+ //
+ // State for the Vertex in DS;
+ myDS->SetState (aWhat, BooleanOperations_ON);
+ // Insert Vertex in Interference Object
+ BOPTools_VEInterference& aVE=aVEs(anIndexIn);
+ aVE.SetNewShape(aWhat);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
+ }
+ // qqt
+ }
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+ }
+ }
+ myIsDone=Standard_True;
+}
//=======================================================================
// function: PrepareEdges
// purpose:
}
}
}
-//=======================================================================
-// function: PerformVE
-// purpose:
-//=======================================================================
- void NMTTools_PaveFiller::PerformVE()
-{
- myIsDone=Standard_False;
- //
- Standard_Boolean bJustAddInterference;
- Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
- Standard_Real aT;
- TopoDS_Vertex aV1;
- TopoDS_Edge aE2;
- BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
- BOPTools_CoupleOfInteger aCouple;
- //
- BOPTools_CArray1OfVEInterference& aVEs=myIntrPool->VEInterferences();
- //
- myDSIt.Initialize (TopAbs_VERTEX, TopAbs_EDGE);
- //
- // BlockLength correction
- aNbVEs=ExpectedPoolLength();
- aBlockLength=aVEs.BlockLength();
- if (aNbVEs > aBlockLength) {
- aVEs.SetBlockLength(aNbVEs);
- }
- //
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, bJustAddInterference);
- //
- if (! myIntrPool->IsComputed(n1, n2)) {
- if (! IsSuccesstorsComputed(n1, n2)) {
- anIndexIn=0;
- aWhat=n1; // Vertex
- aWith=n2; // Edge
- SortTypes(aWhat, aWith);
- //
- if(bJustAddInterference) {
- myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
- continue;
- }
- // Edge
- aE2=TopoDS::Edge(myDS->Shape(aWith));
- if (BRep_Tool::Degenerated(aE2)){
- continue;
- }
- // Vertex
- nV1=aWhat;
- aV1=TopoDS::Vertex(myDS->Shape(aWhat));
- //
- iSDV=FindSDVertex(aWhat);
- if (iSDV) {
- nV1=iSDV;
- aV1=TopoDS::Vertex(myDS->Shape(nV1));
- // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
- Standard_Integer nVE, iSDVE, iRet;
- //
- BooleanOperations_OnceExplorer aExp(*myDS);
- iRet=0;
- aExp.Init(aWith, TopAbs_VERTEX);
- for (; aExp.More(); aExp.Next()) {
- nVE=aExp.Current();
- iSDVE=FindSDVertex(nVE);
- if (iSDVE==iSDV) {
- iRet=1;
- break;
- }
- }
- if (iRet) {
- continue;
- }
- }
- else {
- if (Contains(aE2, aV1)) {
- continue;
- }
- // Contribution of Samtech www.samcef.com END
- }
- //
- aFlag=myContext.ComputeVE (aV1, aE2, aT);
- //
- if (!aFlag) {
- // Add Interference to the Pool
- BOPTools_VEInterference anInterf (aWhat, aWith, aT);
- anIndexIn=aVEs.Append(anInterf);
- //
- // Add Pave to the Edge's myPavePool
- aCouple.SetCouple(nV1, aWith);
- if (!aSnareMap.Contains(aCouple)){
- aSnareMap.Add(aCouple);
- //
- BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
- aPave.SetInterference(anIndexIn);
- BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
- aPaveSet.Append(aPave);
- }
- //
- // State for the Vertex in DS;
- myDS->SetState (aWhat, BooleanOperations_ON);
- // Insert Vertex in Interference Object
- BOPTools_VEInterference& aVE=aVEs(anIndexIn);
- aVE.SetNewShape(aWhat);
- }
- myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
- }
- }
- }
- myIsDone=Standard_True;
-}
+
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
//=======================================================================
// Copyright (C) 2005 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
+// 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
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
+#include <TopExp_Explorer.hxx>
+
#include <BOPTools_VSInterference.hxx>
#include <BOPTools_CArray1OfVSInterference.hxx>
+#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
-#include <TopExp_Explorer.hxx>
+#include <NMTDS_InterfPool.hxx>
+
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
{
myIsDone=Standard_False;
//
- Standard_Boolean aJustAddInterference;
+ Standard_Boolean aJustAdd;
Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
Standard_Real aU, aV;
TopoDS_Vertex aV1;
TopoDS_Face aF2;
//
- BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
+ BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
//
// V/E Interferences
- myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
+ myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
//
// BlockLength correction
- aNbVSs=ExpectedPoolLength();
+ aNbVSs=myDSIt->BlockLength();
aBlockLength=aVSs.BlockLength();
if (aNbVSs > aBlockLength) {
aVSs.SetBlockLength(aNbVSs);
}
//
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, aJustAddInterference);
- //
- if (! myIntrPool->IsComputed(n1, n2)) {
- if (! IsSuccesstorsComputed(n1, n2)) {
- anIndexIn=0;
- aWhat=n1; // Vertex
- aWith=n2; // Face
- SortTypes(aWhat, aWith);
- //
- iSDV=FindSDVertex(aWhat);
- //
- if(aJustAddInterference) {
- myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
- continue;
- }
- //
- aV1=TopoDS::Vertex(myDS->Shape(aWhat));
- if (iSDV) {
- aV1=TopoDS::Vertex(myDS->Shape(iSDV));
- }
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, aJustAdd);
+ if (! IsSuccessorsComputed(n1, n2)) {
+ anIndexIn=0;
+ aWhat=n1; // Vertex
+ aWith=n2; // Face
+ if (myDS->GetShapeType(n1)==TopAbs_FACE) {
+ aWhat=n2;
+ aWith=n1;
+ }
+ //
+ iSDV=FindSDVertex(aWhat);
//
- aF2=TopoDS::Face(myDS->Shape(aWith));
+ if(aJustAdd) {
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+ continue;
+ }
+ //
+ aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+ if (iSDV) {
+ aV1=TopoDS::Vertex(myDS->Shape(iSDV));
+ }
//
- // Modified Thu Sep 14 14:35:18 2006
- // Contribution of Samtech www.samcef.com BEGIN
- if (Contains(aF2, aV1)) {
- continue;
- }
- // Contribution of Samtech www.samcef.com END
+ aF2=TopoDS::Face(myDS->Shape(aWith));
+ //
+ // Modified Thu Sep 14 14:35:18 2006
+ // Contribution of Samtech www.samcef.com BEGIN
+ if (Contains(aF2, aV1)) {
+ continue;
+ }
+ // Contribution of Samtech www.samcef.com END
+ //
+ aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+ //
+ if (!aFlag) {
//
- aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+ // Add Interference to the Pool
+ BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
+ anIndexIn=aVSs.Append(anInterf);
//
- if (!aFlag) {
- //
- // Add Interference to the Pool
- BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
- anIndexIn=aVSs.Append(anInterf);
- //
- // SetState for Vertex in DS;
- myDS->SetState (aWhat, BooleanOperations_ON);
- // Insert Vertex in Interference Object
- BOPTools_VSInterference& aVS=aVSs(anIndexIn);
- aVS.SetNewShape(aWhat);
+ // SetState for Vertex in DS;
+ myDS->SetState (aWhat, BooleanOperations_ON);
+ // Insert Vertex in Interference Object
+ BOPTools_VSInterference& aVS=aVSs(anIndexIn);
+ aVS.SetNewShape(aWhat);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
}
- myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+ // qqt
}
+ //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
}
}
myIsDone=Standard_True;
#include <stdio.h>
#include <Precision.hxx>
+#include <gp_XYZ.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
+#include <BRepBndLib.hxx>
-#include <Bnd_Box.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <BOPTColStd_Failure.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Range.hxx>
#include <BOPTools_ListIteratorOfListOfPave.hxx>
#include <BOPTools_SequenceOfPaveBlock.hxx>
-#include <BOPTColStd_Dump.hxx>
-#include <BOPTColStd_Failure.hxx>
-
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
#include <BooleanOperations_KindOfInterference.hxx>
+#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_InterfPool.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <BOPTools_VSInterference.hxx>
// Contribution of Samtech www.samcef.com END
//
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopTools_DataMapOfShapeListOfShape.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <gp_XYZ.hxx>
-#include <gp_Pnt.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <TColStd_MapOfInteger.hxx>
//
-#include <NMTDS_BoxBndTree.hxx>
-#include <NCollection_UBTreeFiller.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
static
BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
//
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
+ //
+ myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
//
// BlockLength correction
- aNbVEs=ExpectedPoolLength();
+ aNbVEs=myDSIt->BlockLength();
aBlockLength=aEEs.BlockLength();
if (aNbVEs > aBlockLength) {
aEEs.SetBlockLength(aNbVEs);
}
//
- myDSIt.Initialize(TopAbs_EDGE, TopAbs_EDGE);
- //
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, bJustAdd);
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bJustAdd);
anIndexIn = 0;
//
- if (myIntrPool->IsComputed(n1, n2)) {
- continue;
- }
+ //if (myIntrPool->IsComputed(n1, n2)) {
+ // continue;
+ //}
//
nE1=n1;
nE2=n2;
- SortTypes(nE1, nE2);
//
if(bJustAdd) {
- myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
+ //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
continue;
}
//
bIsOnPave2=IsOnPave(aT2, aR2, aTol);
//
if(bIsOnPave1 || bIsOnPave2) {
- myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
- continue;
+ continue;
}
//
BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
//
+ //modified by NIZNHY-PKV Mon Jun 19 11:40:09 2007f
+ {
+ Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
+ Standard_Real aTolVx, aTolVnew, aD2, aDT2;
+ TColStd_MapOfInteger aMV;
+ gp_Pnt aPnew, aPx;
+ //
+ iFound=0;
+ j=-1;
+ nV11=aPB1.Pave1().Index();
+ nV12=aPB1.Pave2().Index();
+ nV21=aPB2.Pave1().Index();
+ nV22=aPB2.Pave2().Index();
+ aMV.Add(nV11);
+ aMV.Add(nV12);
+ //
+ if (aMV.Contains(nV21)) {
+ ++j;
+ nVS[j]=nV21;
+ }
+ if (aMV.Contains(nV22)) {
+ ++j;
+ nVS[j]=nV22;
+ }
+ //
+ aTolVnew=BRep_Tool::Tolerance(aNewVertex);
+ aPnew=BRep_Tool::Pnt(aNewVertex);
+ //
+ for (k=0; k<=j; ++k) {
+ const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
+ aTolVx=BRep_Tool::Tolerance(aVx);
+ aPx=BRep_Tool::Pnt(aVx);
+ aD2=aPnew.SquareDistance(aPx);
+ //
+ aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
+ //
+ if (aD2<aDT2) {
+ iFound=1;
+ break;
+ }
+ }
+ //
+ if (iFound) {
+ continue;
+ }
+ }
+ //modified by NIZNHY-PKV Mon Jun 19 11:40:16 2007t
+ //
// Add Interference to the Pool
BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
//
anIndexIn=aEEs.Append(anInterf);
- myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+ }
+ // qqt
//
// Collect
aMapVI.Add(aNewVertex, anIndexIn);
aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
//
if (aNbComPrt2>1 || !aCoinsideFlag) {
- myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+ //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
break;
}
//
aMapPB.Add(aPB2);
aMapCB.Add(aPB2, aMapPB);
}
+ // qqf
+ {
+ myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+ }
+ // qqt
}
break;
default:
TColStd_MapOfInteger aMFence;
BOPTools_Pave aPave;
//
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
aNb=aMapVI.Extent();
if (!aNb) { // no new vertices, no new problems
//...
aNbIP=aMIPC.Extent();
if (!aNbIP) {
- //modified by NIZNHY-PKV Tue Jan 9 14:26:09 2007f
aMIPC.Add(i);
- //continue;
- //modified by NIZNHY-PKV Tue Jan 9 14:26:12 2007t
}
//
aIt1.Initialize(aMIPC);
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
BOPTools_Pave aPave;
//
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
// one new vertex case is treated in usual way
//
{
myIsDone=Standard_False;
//
- Standard_Boolean Ok1, Ok2, Ok3;
- Ok1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ;
- Ok2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ;
- Ok3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ;
- if (!Ok1 && !Ok2 && !Ok3) {
- // error: Type mismatch
+ Standard_Boolean bOk1, bOk2, bOk3, bFlag;
+ Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
+ TColStd_MapOfInteger aMap;
+
+ bOk1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ;
+ bOk2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ;
+ bOk3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ;
+ if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
return;
}
//
- Standard_Boolean aFlag = Standard_False;
- Standard_Integer n1, n2, nE1, nE2, aNbSplits;
- TColStd_MapOfInteger aMap;
- //
- myDSIt.Initialize(aType1, aType2);
+ aNb=bOk2 ? 2 : 1;
//
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, aFlag);
- nE1=n1;
- nE2=n2;
- SortTypes(nE1, nE2);
+ myDSIt->Initialize(aType1, aType2);
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bFlag);
//
- if (aType1==TopAbs_EDGE) {
- BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
- aNbSplits=aLPB1.Extent();
- if (!aNbSplits) {
- if (!aMap.Contains(nE1)) {
- aMap.Add(nE1);
- PreparePaveBlocks(nE1);
- //
- if (!myIsDone) {
- return;
- }
- }
- }
+ nE[0]=n1;
+ nE[1]=n2;
+ if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
+ nE[0]=n2;
+ nE[1]=n1;
}
//
- if (aType2==TopAbs_EDGE) {
- BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
- aNbSplits=aLPB2.Extent();
+ for (i=0; i<aNb; ++i) {
+ BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
+ aNbSplits=aLPB.Extent();
if (!aNbSplits) {
- if (!aMap.Contains(nE2)) {
- aMap.Add(nE2);
- PreparePaveBlocks(nE2);
- //
+ if (aMap.Add(nE[i])) {
+ PreparePaveBlocks(nE[i]);
if (!myIsDone) {
return;
}
}
}
- }// if (aType2==TopAbs_EDGE)
+ }
}// for (; myDSIt.More(); myDSIt.Next())
-
myIsDone=Standard_True;
}
//=======================================================================
void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
{
myIsDone=Standard_False;
-
- Standard_Integer nV1, nV2;
-
+ //
+ char buf[512];
+ Standard_Integer nV1, nV2, iErr;
TopoDS_Edge aE;
TopoDS_Vertex aV1, aV2;
-
- // SplitShapesPool
+ //
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
// Edge
aE=TopoDS::Edge(myDS->Shape(nE));
+ if (BRep_Tool::Degenerated(aE)) {
+ myIsDone=Standard_True;
+ return;
+ }
//
- if (!BRep_Tool::Degenerated(aE)){
+ BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+
+ BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+ for (; aPBIt.More(); aPBIt.Next()) {
+ BOPTools_PaveBlock& aPB=aPBIt.Value();
+ const IntTools_Range& aRange=aPB.Range();
//
- BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
-
- BOPTools_PaveBlockIterator aPBIt(nE, aPS);
- for (; aPBIt.More(); aPBIt.Next()) {
- BOPTools_PaveBlock& aPB=aPBIt.Value();
-
- const IntTools_Range& aRange=aPB.Range();
-
- const BOPTools_Pave& aPave1=aPB.Pave1();
- nV1=aPave1.Index();
- aV1=TopoDS::Vertex(myDS->GetShape(nV1));
-
- const BOPTools_Pave& aPave2=aPB.Pave2();
- nV2=aPave2.Index();
- aV2=TopoDS::Vertex(myDS->GetShape(nV2));
- //
- // ShrunkRange
- IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
- //
- Standard_Integer anErrorStatus;
- anErrorStatus=aSR.ErrorStatus();
-
- char buf[512];
- if (!aSR.IsDone()) {
- sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
- BOPTColStd_Dump::PrintMessage(buf);
- sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
- throw
- BOPTColStd_Failure(buf) ;
- }
- //
- if (anErrorStatus==6) {
- sprintf(buf,
- "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
- BOPTColStd_Dump::PrintMessage(buf);
- }
- else {
- // Check left paves and correct ShrunkRange if it is necessary
- CorrectShrunkRanges (0, aPave1, aSR);
- CorrectShrunkRanges (1, aPave2, aSR);
- }
- //
- aPB.SetShrunkRange(aSR);
- aLPB.Append(aPB);
- } //for (; aPBIt1.More(); aPBIt1.Next())
- }
+ const BOPTools_Pave& aPave1=aPB.Pave1();
+ nV1=aPave1.Index();
+ aV1=TopoDS::Vertex(myDS->GetShape(nV1));
+ //
+ const BOPTools_Pave& aPave2=aPB.Pave2();
+ nV2=aPave2.Index();
+ aV2=TopoDS::Vertex(myDS->GetShape(nV2));
+ //
+ // ShrunkRange
+ IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+ iErr=aSR.ErrorStatus();
+ if (!aSR.IsDone()) {
+ sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
+ BOPTColStd_Dump::PrintMessage(buf);
+ sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
+ throw
+ BOPTColStd_Failure(buf) ;
+ }
+ //
+ if (iErr==6) {
+ sprintf(buf,
+ "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
+ BOPTColStd_Dump::PrintMessage(buf);
+ }
+ else {
+ // Check left paves and correct ShrunkRange if it is necessary
+ CorrectShrunkRanges (0, aPave1, aSR);
+ CorrectShrunkRanges (1, aPave2, aSR);
+ }
+ //
+ aPB.SetShrunkRange(aSR);
+ aLPB.Append(aPB);
+ } //for (; aPBIt.More(); aPBIt.Next())
myIsDone=Standard_True;
}
//=======================================================================
return;
}
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
const IntTools_CommonPrt& aCP=aEE.CommonPrt();
const TopoDS_Edge& aE1=aCP.Edge1();
tNV=tV+aCoeff*(tNV-tV);
aNewRange.SetFirst(tNV);
aNewRange.SetLast (aSR.Last());
-
- if(aNewRange.First() > aNewRange.Last()) {
+ //modified by NIZNHY-PKV Tue Jan 23 14:07:55 2007f
+ //if(aNewRange.First() > aNewRange.Last()) {
+ if(aNewRange.First() < aNewRange.Last()) {
+ //modified by NIZNHY-PKV Tue Jan 23 14:08:02 2007t
aShrunkRange.SetShrunkRange(aNewRange);
}
}
TColStd_ListOfInteger aLFI;
TColStd_ListIteratorOfListOfInteger aItLFI;
//
- BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+ BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
+ BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
aNbS=myDS->NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {
}
}
// Contribution of Samtech www.samcef.com END
-/*
-//=======================================================================
-// function:EENewVertices
-// purpose:
-//=======================================================================
- void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
-{
- Standard_Integer aNb, i, j, aNewShape, aNbEdges, aNbIEE, aNbVV, aNbSimple;
- Standard_Integer aWhat, aWith, i1, i2, nE1, nE2, nE, nV, aFlag;
- Standard_Real aT;
- TopoDS_Compound aCompound;
- BRep_Builder aBB;
- NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEE;
- BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
- BOPTools_Pave aPave;
- TopoDS_Vertex aNewVertex;
- TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
- //
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
- //
- aNb=aMapVI.Extent();
- //
- if (!aNb) { // no new vertices, no new problems
- return;
- }
- //
- // 0.
- if (aNb==1) {
- aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
- EENewVertices(aNewVertex, aMapVI);
- return;
- }
- //
- // 1. Make compound from new vertices
- aBB.MakeCompound(aCompound);
- for (i=1; i<=aNb; ++i) {
- const TopoDS_Shape& aV=aMapVI.FindKey(i);
- aBB.Add(aCompound, aV);
- }
- //
- // 2. VV intersection between these vertices
- // using the auxiliary Filler
- NMTDS_ShapesDataStructure tDS;
- //
- tDS.SetCompositeShape(aCompound);
- tDS.Init();
- //
- BOPTools_InterferencePool tInterfPool(tDS);
- NMTTools_PaveFiller tPaveFiller(tInterfPool);
- //
- tPaveFiller.Init();
- //
- tPaveFiller.PerformVV();
- tPaveFiller.PerformNewVertices();
- //
- const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
- //
- // 3. Separate Comlex and Simple new vertices
- aNbVV=aVVInterfs.Extent();
- for (i=1; i<=aNbVV; ++i) {
- const BOPTools_VVInterference& aVV=aVVInterfs(i);
- aVV.Indices(aWhat, aWith);
- const TopoDS_Shape& aV1=tDS.Shape(aWhat);
- const TopoDS_Shape& aV2=tDS.Shape(aWith);
- aMNVComplex.Add(aV1);
- aMNVComplex.Add(aV2);
- }
- //
- for (i=1; i<=aNb; ++i) {
- const TopoDS_Shape& aV=aMapVI.FindKey(i);
- if (!aMNVComplex.Contains(aV)) {
- aMNVSimple.Add(aV);
- }
- }
- //
- // 4. Treat Simple new Vertices
- aNbSimple=aMNVSimple.Extent();
- for (i=1; i<=aNbSimple; ++i) {
- const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
- EENewVertices(aV, aMapVI);
- }
- //
- // 3. Fill Maps : NewVertex-edges (aMNVE)
- // NewVertex-interferences (aMNVIEE)
- for (i=1; i<=aNbVV; ++i) {
- const BOPTools_VVInterference& aVV=aVVInterfs(i);
- aNewShape=aVV.NewShape();
- if (!aNewShape) {
- continue;
- }
- //
- if (!aMNVE.Contains(aNewShape)) {
- TColStd_IndexedMapOfInteger aMx;
- aMNVE.Add(aNewShape, aMx);
- }
- if (!aMNVIEE.Contains(aNewShape)) {
- TColStd_IndexedMapOfInteger aMx;
- aMNVIEE.Add(aNewShape, aMx);
- }
- //
- TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
- TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.ChangeFromKey(aNewShape);
- //
- aVV.Indices(aWhat, aWith);
- //aWhat
- const TopoDS_Shape& aV1=tDS.Shape(aWhat);
- i1=aMapVI.FindFromKey(aV1);
- const BOPTools_EEInterference& aEE1=aEEs(i1);
- aEE1.Indices(nE1, nE2);
- aME.Add(nE1);
- aME.Add(nE2);
- aMIEE.Add(i1);
- //aWith
- const TopoDS_Shape& aV2=tDS.Shape(aWith);
- i2=aMapVI.FindFromKey(aV2);
- const BOPTools_EEInterference& aEE2=aEEs(i2);
- aEE2.Indices(nE1, nE2);
- aME.Add(nE1);
- aME.Add(nE2);
- aMIEE.Add(i2);
- //
- //printf(" VV: (%d, %d) -> %d\n", aWhat, aWith, aNewShape);
- }
- //
- // 4. Process new vertices
- aNb=aMNVE.Extent();
- for (i=1; i<=aNb; ++i) { // xx
- //
- // new Vertex
- nV=aMNVE.FindKey(i);
- aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
- //
- // Insert New Vertex in DS;
- myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
- aNewShape=myDS->NumberOfInsertedShapes();
- myDS->SetState (aNewShape, BooleanOperations_ON);
- //
- // Update index of NewShape in EE interferences
- const TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.FindFromKey(nV);//(i);
- aNbIEE=aMIEE.Extent();
- for (j=1; j<=aNbIEE; ++j) {
- i1=aMIEE(j);
- BOPTools_EEInterference& aEE1=aEEs(i1);
- aEE1.SetNewShape(aNewShape);
- }
- //
- // Update Paves on edges
- const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
- aNbEdges=aME.Extent();
- for (j=1; j<=aNbEdges; ++j) {
- nE=aME(j);
- const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
- //
- aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
- //
- if (!aFlag) {
- aPave.SetInterference(-1);
- aPave.SetType (BooleanOperations_EdgeEdge);
- aPave.SetIndex(aNewShape);
- aPave.SetParam(aT);
- //
- BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
- aPaveSet.Append(aPave);
- }
- }
- }// for (i=1; i<=aNb; ++i) {// xx
-}
-//=======================================================================
-// function:EENewVertices
-// purpose:
-//=======================================================================
- void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
- const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
-{
- Standard_Integer i, aNewShape, nE1, nE2;
- Standard_Real aT1, aT2;
- BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
- BOPTools_Pave aPave;
- //
- BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
- //
- // one new vertex case is treated in usual way
- //
- // Insert New Vertex in DS;
- myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
- aNewShape=myDS->NumberOfInsertedShapes();
- myDS->SetState (aNewShape, BooleanOperations_ON);
- // Insert New Vertex in EE Interference
- i=aMapVI.FindFromKey(aNewVertex);
- BOPTools_EEInterference& aEEInterf= aEEs(i);
- aEEInterf.SetNewShape(aNewShape);
- // Extact interference info
- aEEInterf.Indices(nE1, nE2);
- const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
- VertexParameters(aCPart, aT1, aT2);
- //
- // Add Paves to the myPavePoolNew
- aPave.SetInterference(i);
- aPave.SetType (BooleanOperations_EdgeEdge);
- aPave.SetIndex(aNewShape);
- // Pave for edge nE1
- aPave.SetParam(aT1);
- BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
- aPaveSet1.Append(aPave);
- // Pave for edge nE2
- aPave.SetParam(aT2);
- BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
- aPaveSet2.Append(aPave);
-}
-*/
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
+#include <TopExp.hxx>
+
#include <TopTools_IndexedMapOfShape.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ESInterference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_CArray1OfESInterference.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_IMapOfPaveBlock.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopExp.hxx>
+
static
void VertexParameter(const IntTools_CommonPrt& aCPart,
BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
BOPTools_IMapOfPaveBlock aIMPBx;
//
- BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+ BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
- myDSIt.Initialize(TopAbs_EDGE, TopAbs_FACE);
+ myDSIt->Initialize(TopAbs_EDGE, TopAbs_FACE);
//
// BlockLength correction
- aNbEFs=ExpectedPoolLength();
+ aNbEFs=myDSIt->BlockLength();
aBlockLength=aEFs.BlockLength();
if (aNbEFs > aBlockLength) {
aEFs.SetBlockLength(aNbEFs);
}
//
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, bJustAdd);
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bJustAdd);
anIndexIn = 0;
//
- if (myIntrPool->IsComputed(n1, n2)) {
- continue;
- }
+ //if (myIntrPool->IsComputed(n1, n2)) {
+ // continue;
+ //}
//
nE=n1;
- nF=n2;
- SortTypes(nE, nF);
+ nF=n2;
+ if (myDS->GetShapeType(n2)==TopAbs_EDGE) {
+ nE=n2;
+ nF=n1;
+ }
+ //SortTypes(nE, nF);
//
// all Common Blocks for face nF
//XXX
NMTTools_CommonBlockAPI aCBAPIF(aLCBF);
//XXX
if(bJustAdd) {
- myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+ //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
continue;
}
// Edge
//
aMapVI.Add(aNewVertex, anIndexIn);
aIMPBx.Add(aPB);
+ // qqf
+ {
+ myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+ }
+ // qqt
//
}// if (!nVF)
}// if (!bIsOnPave1 && !bIsOnPave2)
- myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+ //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
}// case TopAbs_VERTEX:
break;
//
//
aCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
if (!aCoinsideFlag) {
- myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+ //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
break;
}
//
aMapF.Add(nF);
aMapCB.Add(aPB, aMapF);
}
- //modified by NIZNHY-PKV Fri Jan 23 14:13:08 2004 f
aIMPBx.Add(aPB);
- //modified by NIZNHY-PKV Fri Jan 23 14:13:10 2004 t
+ // qqf
+ {
+ myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+ }
+ // qqt
}// case TopAbs_EDGE:
break;
void NMTTools_PaveFiller::EFNewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
{
Standard_Integer i, j, aNb, aNewShape, aFlag, iX, aNbVV, aNbSimple;
- Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges;
+ Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges, iTmp;
Standard_Real aT;
TopoDS_Compound aCompound;
TopoDS_Vertex aNewVertex;
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
//
- BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+ BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
aNb=aMapVI.Extent();
//
//
// 2. VV intersection between these vertices
// using the auxiliary Filler
- NMTDS_ShapesDataStructure tDS;
- //
- tDS.SetCompositeShape(aCompound);
- tDS.Init();
- //
- BOPTools_InterferencePool tInterfPool(tDS);
- NMTTools_PaveFiller tPaveFiller(tInterfPool);
+ NMTTools_PaveFiller tPF;
//
- tPaveFiller.Init();
+ tPF.SetCompositeShape(aCompound);
//
- tPaveFiller.PerformVV();
- tPaveFiller.PerformNewVertices();
+ tPF.Init();
+ tPF.PerformVV();
+ //tPF.PerformNewVertices(); qq
//
- const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+ NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+ //const BOPTools_InterferencePool& tInterfPool=*(tPF.InterfPool());
+ NMTDS_InterfPool& tInterfPool=*(tPF.IP());
+ //const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+ BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterferences();
//
// 3. Separate Comlex and Simple new vertices
aNbVV=aVVInterfs.Extent();
iX=aMapVI.FindFromKey(aV1);
const BOPTools_ESInterference& aEF1=aEFs(iX);
aEF1.Indices(nE, nF);
- SortTypes(nE, nF);
+ //SortTypes(nE, nF);
+ if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+ iTmp=nE;
+ nE=nF;
+ nF=iTmp;
+ }
aME.Add(nE);
aMIEF.Add(iX);
//aWith
iX=aMapVI.FindFromKey(aV2);
const BOPTools_ESInterference& aEF2=aEFs(iX);
aEF2.Indices(nE, nF);
- SortTypes(nE, nF);
+ //SortTypes(nE, nF);
+ if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+ iTmp=nE;
+ nE=nF;
+ nF=iTmp;
+ }
aME.Add(nE);
aMIEF.Add(iX);
}
BOPTools_Pave aPave;
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
//
- BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+ BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
// Insert New Vertex in DS;
myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
aEFInterf.SetNewShape(aNewShape);
// Extract interference info
aEFInterf.Indices(nE, nF);
- SortTypes(nE, nF);
+ //SortTypes(nE, nF);
+ if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+ nE=nF;
+ }
const IntTools_CommonPrt& aCPart=aEFInterf.CommonPrt();
VertexParameter(aCPart, aT);
//
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <Geom2d_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
-
+#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2d_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
+
#include <BndLib_Add3dCurve.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
#include <TopExp.hxx>
+#include <BRepLib.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
#include <IntTools_SequenceOfCurves.hxx>
#include <IntTools_FaceFace.hxx>
#include <IntTools_Tools.hxx>
+#include <IntTools_ShrunkRange.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
-#include <BOPTools_ListIteratorOfListOfInterference.hxx>
-#include <BOPTools_CArray1OfInterferenceLine.hxx>
-#include <BOPTools_InterferenceLine.hxx>
-#include <BOPTools_ListOfInterference.hxx>
-#include <BOPTools_Interference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+//#include <BOPTools_ListIteratorOfListOfInterference.hxx>
+//#include <BOPTools_CArray1OfInterferenceLine.hxx>
+//#include <BOPTools_InterferenceLine.hxx>
+//#include <BOPTools_ListOfInterference.hxx>
+//#include <BOPTools_Interference.hxx>
+
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_PaveBlockIterator.hxx>
#include <BOPTools_Tools2D.hxx>
+#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_Tools.hxx>
#include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
-#include <Geom2d_Curve.hxx>
-#include <NMTTools_Tools.hxx>
-#include <BRepLib.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-//
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TColStd_ListOfInteger.hxx>
-////
#include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
#include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <NMTTools_MapOfPaveBlock.hxx>
-//
-#include <IntTools_ShrunkRange.hxx>
-
-static
- Standard_Boolean IsPairFound(const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_InterferencePool* myIntrPool,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
-
-static
- void FMapWhat(const Standard_Integer nF,
- BOPTools_InterferencePool* myIntrPool,
- TColStd_IndexedMapOfInteger& aMapWhat);
-static
- void FMapWith(const Standard_Integer nF,
- BOPTools_InterferencePool* myIntrPool,
- TColStd_IndexedMapOfInteger& aMapWith);
-static
- Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
- const TColStd_IndexedMapOfInteger& aMapWith);
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
TopTools_ListOfShape& aLS);
// Contribution of Samtech www.samcef.com END
+//modified by NIZNHY-PKV Mon Dec 4 12:56:04 2006f
static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
IntTools_Context& aCtx);
+//modified by NIZNHY-PKV Mon Dec 4 12:56:08 2006t
//=======================================================================
// function: PerformFF
{
myIsDone=Standard_False;
//
- Standard_Boolean bIsFound, bJustAdd, bIsComputed;
+ Standard_Boolean bJustAdd;//, bIsComputed, bIsFound;
Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
Standard_Integer aNbCurves, aNbPoints;
IntTools_SequenceOfCurves aCvs;
BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
//
- BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
// F/F Interferences [BooleanOperations_SurfaceSurface]
- myDSIt.Initialize(TopAbs_FACE, TopAbs_FACE);
+ myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
//
// BlockLength correction
- aNbFFs=ExpectedPoolLength();
+ aNbFFs=myDSIt->BlockLength();
aBlockLength=aFFs.BlockLength();
if (aNbFFs > aBlockLength) {
aFFs.SetBlockLength(aNbFFs);
}
//
- for (; myDSIt.More(); myDSIt.Next()) {
- myDSIt.Current(n1, n2, bJustAdd);
+ for (; myDSIt->More(); myDSIt->Next()) {
+ myDSIt->Current(n1, n2, bJustAdd);
//
- bIsComputed=myIntrPool->IsComputed(n1, n2);
- if (bIsComputed) {
- continue;
- }
+ //bIsComputed=myIntrPool->IsComputed(n1, n2);
+ //if (bIsComputed) {
+ // continue;
+ //}
//
nF1 = n2;
nF2 = n1;
aPnts.Clear();
aCvs.Clear();
//
+ /*
bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
- //
if (bJustAdd) {
if (!bIsFound) {
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
continue;
}
+ */
//
const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
//
bIsDone=aFF.IsDone();
//
+
if (!bIsDone) {
+ /*
if (!bIsFound) {
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
anIndexIn=aFFs.Append(anInterf);
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
+ */
continue;
}
//
if (!aNbCurves && !aNbPoints) {
BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
anIndexIn=aFFs.Append(anInterf);
- myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+ //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
continue;
}
//
{
BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
anIndexIn=aFFs.Append(anInterf);
- myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+ //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
//
}// for (; myDSIt.More(); myDSIt.Next())
Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
// Contribution of Samtech www.samcef.com END
//
- Standard_Boolean bIsMicroEdge;
+ Standard_Boolean bIsMicroEdge, bHasES;
Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
Standard_Integer nV1, nV2, j, aNbCurves;
Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
//
- BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNbFFs=aFFs.Extent();
//
//
// 1. Produce Section Edges from intersection curves
// between each pair of faces
- //
aNbFFs=aFFs.Extent();
//
for (i=1; i<=aNbFFs; ++i) {
-
BOPTools_SSInterference& aFFi=aFFs(i);
//
// Faces
}
//
// Pave Blocks on Curves
+ bHasES=Standard_False;
for (j=1; j<=aNbCurves; ++j) {
BOPTools_Curve& aBC=aSCvs(j);
const IntTools_Curve& aIC= aBC.Curve();
nV2=aPBNew.Pave2().Index();
aT1=aPBNew.Pave1().Param();
aT2=aPBNew.Pave2().Param();
- // ???
+ //
if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
- continue;// mkk ft
+ continue;// mkk ft ???
}
//
// 1
-
bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
if (bIsExistingPaveBlock) {
continue;
//
BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
//
- // use_01 f
- //
NMTTools_Tools::UpdateEdge (aES, aTolR3D);
bIsMicroEdge=IsMicroEdge(aES, myContext);
if (bIsMicroEdge) {
continue;
}
//
- //use_01 t
- //
- // SKL/PartC5 f
+
{
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
//
NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
- //SKL/PartC5 t
}
//
aMEPB.Add(aES, aPBNew);
aMapEI.Add(aES, i);
- }
-
+ //
+ bHasES=Standard_True;
+ }// for (; aPBIter.More(); aPBIter.Next())
} // end of for (j=1; j<=aNbCurves; ++j)
+ // qqf
+ if (bHasES) {
+ myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+ }
+ // qqt
}// for (i=1; i<=aNbFFs; ++i)
//=============================================================
//
//
//
// 2. Intersect SE using auxiliary Filler
- NMTDS_ShapesDataStructure tDS;
- //
- tDS.SetCompositeShape(aCompound);
- tDS.Init();
+ NMTTools_PaveFiller tPF;
//
- BOPTools_InterferencePool tIP(tDS);
- NMTTools_PaveFiller tPF(tIP);
+ tPF.SetCompositeShape(aCompound);
//
// 2.1.VV
tPF.Init();
tPF.PerformVV();
- tPF.PerformNewVertices();
+ //tPF.PerformNewVertices(); qq
//
// 2.2.VE
tPF.myPavePool.Resize (tPF.myNbEdges);
BOPTools_ListIteratorOfListOfPaveBlock aIt;
BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
//
+ const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
//
aF2FWD=aF2;
aF2FWD.Orientation(TopAbs_FORWARD);
//
- // SKL/PartC5 f
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
NMTTools_Tools::UpdateEdge (aEx, aTolEx);
- //SKL/PartC5 t
} //if (aCBAPI.IsCommonBlock(aPB))
//
// new SE
{
Standard_Integer i, aNb, nF1, nF2, nE;
Standard_Integer aNbCB, aNbF, nSp, nF;
+ TopAbs_ShapeEnum aType;
TopoDS_Face aF1FWD, aF2FWD;
TColStd_ListIteratorOfListOfInteger aItF;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
NMTTools_ListIteratorOfListOfCommonBlock aItCB;
- TopAbs_ShapeEnum aType;
//
- BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNb=aFFs.Extent();
for (i=1; i<=aNb; i++) {
BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
}
- }
+ }
//
//modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
// Check common blocks between edges and faces
}
}
/////////////
-//=======================================================================
-// function: IsPairFound
-// purpose:
-//=======================================================================
-Standard_Boolean IsPairFound(const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPTools_InterferencePool* myIntrPool,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
- BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
-{
- Standard_Boolean bIsFound;
- //
- if (!aMapWhat.Contains(nF1)) {
- TColStd_IndexedMapOfInteger aMWhat;
- FMapWhat(nF1, myIntrPool, aMWhat);
- aMapWhat.Add(nF1, aMWhat);
- }
- //
- if (!aMapWith.Contains(nF2)) {
- TColStd_IndexedMapOfInteger aMWith;
- FMapWith(nF2, myIntrPool, aMWith);
- aMapWith.Add(nF2, aMWith);
- }
- //
- const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
- const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
- //
- bIsFound=IsFound(aMWht, aMWit);
- //
- return bIsFound;
-}
-//=======================================================================
-// function: FMapWhat
-// purpose:
-//=======================================================================
-void FMapWhat(const Standard_Integer nF,
- BOPTools_InterferencePool* myIntrPool,
- TColStd_IndexedMapOfInteger& aMapWhat)
-
-{
- Standard_Integer nE, nV;
-
-
- BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
- BooleanOperations_OnceExplorer aExp(*myDS);
- //
- // What
- aMapWhat.Add(nF);
- aExp.Init(nF, TopAbs_VERTEX);
- for (; aExp.More(); aExp.Next()) {
- nV=aExp.Current();
- aMapWhat.Add(nV);
- }
- //
- aExp.Init(nF, TopAbs_EDGE);
- for (; aExp.More(); aExp.Next()) {
- nE=aExp.Current();
- aMapWhat.Add(nE);
- }
-}
-//=======================================================================
-// function: FMapWith
-// purpose:
-//=======================================================================
-void FMapWith(const Standard_Integer nF,
- BOPTools_InterferencePool* myIntrPool,
- TColStd_IndexedMapOfInteger& aMapWith)
-{
- TColStd_IndexedMapOfInteger aMapWhat;
-
- FMapWhat(nF, myIntrPool, aMapWhat);
- //
- // With
- Standard_Integer i, aNb, anIndex, aWhat, aWith;
- BOPTools_ListIteratorOfListOfInterference anIt;
-
- const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
- aNb=aMapWhat.Extent();
- for (i=1; i<=aNb; i++) {
- aWhat=aMapWhat(i);
-
- const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
-
- const BOPTools_ListOfInterference& aLI=aWithLine.List();
- anIt.Initialize(aLI);
- for (; anIt.More(); anIt.Next()) {
- const BOPTools_Interference& anIntf=anIt.Value();
- anIndex=anIntf.Index();
- if (anIndex) {
- aWith=anIntf.With();
- aMapWith.Add(aWith);
- }
- }
- }
-}
-//=======================================================================
-// function: IsFound
-// purpose:
-//=======================================================================
-Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
- const TColStd_IndexedMapOfInteger& aMapWith)
-{
- Standard_Boolean bFlag=Standard_False;
- Standard_Integer i, aNb, aWhat;
-
- aNb=aMapWhat.Extent();
- for (i=1; i<=aNb; i++) {
- aWhat=aMapWhat(i);
- if (aMapWith.Contains(aWhat)) {
- return !bFlag;
- }
- }
- return bFlag;
-}
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
//=======================================================================
//
// Contribution of Samtech www.samcef.com END
-// use_01 f
+//modified by NIZNHY-PKV Mon Dec 4 12:30:38 2006f use_01
//=======================================================================
//function : IsMicroEdge
//purpose :
//
return bRet;
}
-// use_01 t
+//modified by NIZNHY-PKV Mon Dec 4 12:55:50 2006t
+/*
+static
+ Standard_Boolean IsPairFound(const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_InterferencePool* myIntrPool,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
+
+static
+ void FMapWhat(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWhat);
+static
+ void FMapWith(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWith);
+static
+ Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+ const TColStd_IndexedMapOfInteger& aMapWith);
+
+//=======================================================================
+// function: IsPairFound
+// purpose:
+//=======================================================================
+Standard_Boolean IsPairFound(const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPTools_InterferencePool* myIntrPool,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+ BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
+{
+ Standard_Boolean bIsFound;
+ //
+ if (!aMapWhat.Contains(nF1)) {
+ TColStd_IndexedMapOfInteger aMWhat;
+ FMapWhat(nF1, myIntrPool, aMWhat);
+ aMapWhat.Add(nF1, aMWhat);
+ }
+ //
+ if (!aMapWith.Contains(nF2)) {
+ TColStd_IndexedMapOfInteger aMWith;
+ FMapWith(nF2, myIntrPool, aMWith);
+ aMapWith.Add(nF2, aMWith);
+ }
+ //
+ const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
+ const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
+ //
+ bIsFound=IsFound(aMWht, aMWit);
+ //
+ return bIsFound;
+}
+//=======================================================================
+// function: FMapWhat
+// purpose:
+//=======================================================================
+void FMapWhat(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWhat)
+
+{
+ Standard_Integer nE, nV;
+ //
+ BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
+ BooleanOperations_OnceExplorer aExp(*myDS);
+ //
+ // What
+ aMapWhat.Add(nF);
+ aExp.Init(nF, TopAbs_VERTEX);
+ for (; aExp.More(); aExp.Next()) {
+ nV=aExp.Current();
+ aMapWhat.Add(nV);
+ }
+ //
+ aExp.Init(nF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ nE=aExp.Current();
+ aMapWhat.Add(nE);
+ }
+}
+//=======================================================================
+// function: FMapWith
+// purpose:
+//=======================================================================
+void FMapWith(const Standard_Integer nF,
+ BOPTools_InterferencePool* myIntrPool,
+ TColStd_IndexedMapOfInteger& aMapWith)
+{
+ TColStd_IndexedMapOfInteger aMapWhat;
+
+ FMapWhat(nF, myIntrPool, aMapWhat);
+ //
+ // With
+ Standard_Integer i, aNb, anIndex, aWhat, aWith;
+ BOPTools_ListIteratorOfListOfInterference anIt;
+
+ const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
+
+ aNb=aMapWhat.Extent();
+ for (i=1; i<=aNb; i++) {
+ aWhat=aMapWhat(i);
+
+ const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
+
+ const BOPTools_ListOfInterference& aLI=aWithLine.List();
+ anIt.Initialize(aLI);
+ for (; anIt.More(); anIt.Next()) {
+ const BOPTools_Interference& anIntf=anIt.Value();
+ anIndex=anIntf.Index();
+ if (anIndex) {
+ aWith=anIntf.With();
+ aMapWith.Add(aWith);
+ }
+ }
+ }
+}
+//=======================================================================
+// function: IsFound
+// purpose:
+//=======================================================================
+Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+ const TColStd_IndexedMapOfInteger& aMapWith)
+{
+ Standard_Boolean bFlag=Standard_False;
+ Standard_Integer i, aNb, aWhat;
+
+ aNb=aMapWhat.Extent();
+ for (i=1; i<=aNb; i++) {
+ aWhat=aMapWhat(i);
+ if (aMapWith.Contains(aWhat)) {
+ return !bFlag;
+ }
+ }
+ return bFlag;
+}
+*/
#include <NMTTools_PaveFiller.ixx>
+#include <Bnd_HArray1OfBox.hxx>
+#include <Bnd_BoundSortBox.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+#include <TopAbs_Orientation.hxx>
+
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
-#include <NMTDS_ShapesDataStructure.hxx>
-#include <TopAbs_Orientation.hxx>
-#include <BOPTools_ListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_PaveBlock.hxx>
-#include <BOPTools_Pave.hxx>
-#include <BOPTools_Tools.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapOfIntegerShape.hxx>
+
+#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
-#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <BOPTools_SSInterference.hxx>
-#include <BOPTools_CArray1OfSSInterference.hxx>
+
#include <TopExp_Explorer.hxx>
-#include <TopoDS_Shape.hxx>
#include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
//
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
-#include <BOPTools_Tools.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
+
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+
+#include <BOPTools_SSInterference.hxx>
+#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_VVInterference.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TopTools_DataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <BOPTools_Tools.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <BOPTools_Pave.hxx>
+#include <BOPTools_Tools.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
static
BOPTools_Pave aPave1, aPave2;
BOPTools_PaveBlock aPB;
//
- BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNbFFs=aFFs.Extent();
for (i=1; i<=aNbFFs; ++i) {
//
myAloneVertices.Clear();
//
- BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+ BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
// 1. Collect alone vertices from FFs
aNbV=0;
}
}
}
+ // qqf
+ {
+ Standard_Integer aNbF, aNbAV, nF, k;
+ NMTTools_IndexedDataMapOfIndexedMapOfInteger aMAVF;
+ //
+ aNbF=myAloneVertices.Extent();
+ if (aNbF<2) {
+ return;
+ }
+ //
+ // 1. fill map Alone Vertex/Face -> aMAVF
+ for (i=1; i<=aNbF; ++i) {
+ nF=myAloneVertices.FindKey(i);
+ const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
+ aNbAV=aMAV.Extent();
+ for(j=1; j<=aNbAV; ++j) {
+ nV=aMAV(j);
+ if (aMAVF.Contains(nV)) {
+ TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
+ aMF.Add(nF);
+ }
+ else{
+ TColStd_IndexedMapOfInteger aMF;
+ aMF.Add(nF);
+ aMAVF.Add(nV, aMF);
+ }
+ }
+ }
+ //
+ // 2 Obtain pairs of faces
+ aNbAV=aMAVF.Extent();
+ for (i=1; i<=aNbAV; ++i) {
+ const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
+ aNbF=aMF.Extent();
+ for(j=1; j<aNbF; ++j) {
+ nF1=aMF(j);
+ for(k=j+1; k<=aNbF; ++k) {
+ nF2=aMF(k);
+ myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+ }
+ }
+ }
+ }
+ // qqt
}
//=======================================================================
// function: AloneVertices
// function: FuseVertices
// purpose:
//=======================================================================
-void FuseVertices(const TopoDS_Shape& aCompound,
- TopTools_DataMapOfShapeShape& aDMVV)
+ void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound,
+ TopTools_DataMapOfShapeShape& aDMVV)const
{
Standard_Integer i, aNbVV, n1, n2, nX;
- NMTDS_ShapesDataStructure tDS;
- //
- tDS.SetCompositeShape(aCompound);
- tDS.Init();
+ NMTTools_PaveFiller tPF;
//
- BOPTools_InterferencePool tInterfPool(tDS);
- NMTTools_PaveFiller tPaveFiller(tInterfPool);
+ tPF.SetCompositeShape(aCompound);
//
- tPaveFiller.Init();
+ tPF.Init();
//
- tPaveFiller.PerformVV();
- tPaveFiller.PerformNewVertices();
+ tPF.PerformVV();
+ //tPF.PerformNewVertices(); //qq
//
- const BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterfs();
+ NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+ NMTDS_InterfPool& tInterfPool=*(tPF.IP());
+ BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterferences();
//
aNbVV=aVVt.Extent();
for (i=1; i<=aNbVV; ++i) {
// Compute default deflection
Bnd_Box B;
BRepBndLib::Add(myShape, B);
+ if ( B.IsVoid() ) return; // NPAL15983 (Bug when displaying empty groups)
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
deflection = MAX3( aXmax-aXmin , aYmax-aYmin , aZmax-aZmin) * 0.001 *4;
double SpecificStep1 = 0.1;
double SpecificStep2 = 0.01;
/* min, max, myStep and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, 3);
- GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue( 100.0 );
GroupPoints->SpinBox_DY->SetValue( 1.0 );
double SpecificStep = 10.0;
QMap< int, DlgRef_SpinBox* >::iterator anIter;
for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter )
- anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, 3 );
+ anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY );
setHelpFileName("chamfer.htm");
// File : OperationGUI_ClippingDlg.cxx
// Author : Michael Zorin
// Module : GEOM
-// $Header:
+// $Header$
#include "OperationGUI_ClippingDlg.h"
#include "DlgRef_SpinBox.h"
#include <V3d_View.hxx>
#include <V3d.hxx>
-//#include <V3d_Plane.hxx>
-
// QT Includes
#include <qapplication.h>
#include <qgroupbox.h>
Layout1->addWidget( GroupArguments, 2, 0 );
/* Initialisations */
- SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
- SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
+ SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
+ SpinBox_Far->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY );
/* signals and slots connections */
connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
if( !aVTKFrame )
return;
-
+
TextLabelNear->setText( tr( "Near" ) );
TextLabelFar->setText( tr( "Far" ) );
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return;
}
-
+
// Find the plane equation for the camera view plane
double vn[3];
anActiveCamera->GetViewPlaneNormal(vn);
double position[3];
anActiveCamera->GetPosition(position);
-
+
vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
-
+
double center[3];
center[0] = (bounds[0] + bounds[1])/2.0;
center[1] = (bounds[2] + bounds[3])/2.0;
center[2] = (bounds[4] + bounds[5])/2.0;
-
+
double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-
+
double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
-
+
vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-
+
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
-
+
return;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
- double depth, thickness;
+ double depth, thickness;
int ztype= view3d->ZClipping(depth, thickness);
SpinBox_Near->SetValue(depth);
SpinBox_Far->SetValue(thickness);
SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return false;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
if( !aVTKFrame )
return false;
-
+
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return false;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return false;
}
-
+
vtkFloatingPointType range[2] = { SpinBox_Near->GetValue(), SpinBox_Far->GetValue() };
if (range[0] < 0.0) range[0] = 0.0;
anActiveCamera->SetClippingRange( range );
-
+
return true;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
OCCViewer_ViewWindow* aOCCFrame = dynamic_cast<OCCViewer_ViewWindow*>( anActiveWindow );
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-
+
double depth = SpinBox_Near->GetValue();
double thickness = SpinBox_Far->GetValue();
int aType = TypeCB->currentItem();
-
+
view3d->SetZClippingType(V3d_TypeOfZclipping(aType));
view3d->SetZClippingDepth(depth);
view3d->SetZClippingWidth(thickness);
SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return;
-
+
if ( anActiveWindow->getViewManager()->getType() == SVTK_Viewer::Type() )
{
SVTK_ViewWindow* aVTKFrame = dynamic_cast<SVTK_ViewWindow*>( anActiveWindow );
vtkRenderer* aRenderer = aVTKFrame->getRenderer();
if(!aRenderer) return;
-
+
vtkCamera* anActiveCamera = aRenderer->GetActiveCamera();
if( anActiveCamera == NULL ){
MESSAGE("Trying to reset clipping range of non-existant camera");
return;
}
-
+
// Find the plane equation for the camera view plane
double vn[3];
anActiveCamera->GetViewPlaneNormal(vn);
double position[3];
anActiveCamera->GetPosition(position);
-
+
vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
-
+
double center[3];
center[0] = (bounds[0] + bounds[1])/2.0;
center[1] = (bounds[2] + bounds[3])/2.0;
center[2] = (bounds[4] + bounds[5])/2.0;
-
+
double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-
+
double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
-
+
vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
-
+
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
-
+
return;
}
else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() )
TextLabelNear->setText( tr( "Depth" ) );
TextLabelFar->setText( tr( "Thickness" ) );
-
+
Handle(V3d_View) view3d = ((OCCViewer_ViewPort3d*)aOCCFrame->getViewPort())->getView();
-
+
view3d->SetZClippingType(V3d_TypeOfZclipping(0));
view3d->ZFitAll();
- double depth, thickness;
+ double depth, thickness;
int ztype= view3d->ZClipping(depth, thickness);
SpinBox_Near->SetValue(0);
SpinBox_Far->SetValue(1000);
/***************************************************************/
double SpecificStep = 10.0;
- Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
- Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
- Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3);
+ Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+ Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
+ Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
setHelpFileName("fillet.htm");
RadioButton3->close(TRUE);
// Full partition (contains half-space partition)
- GroupPoints = new DlgRef_2Sel1List_QTD(this, "GroupPoints");
+ GroupPoints = new DlgRef_2Sel1List1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupPoints->PushButton2->setPixmap(image2);
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->radioButton4->setText(tr("GEOM_KEEP_NONLIMIT_SHAPES"));
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE"));
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE"));
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX"));
+ GroupPoints->radioButton4->setChecked(FALSE);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
+ connect(GroupPoints->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
+
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
myListKeepInside.length(0);
myListRemoveInside.length(0);
myListMaterials.length(0);
-
+
switch (constructorId)
{
case 0: /*Full partition */
resize(0, 0);
GroupPoints->TextLabel3->show();
GroupPoints->ComboBox1->show();
-
GroupPoints->ComboBox1->setCurrentItem(0);
+ GroupPoints->radioButton4->show();
break;
}
case 1: /*Half-space partition */
GroupPoints->TextLabel3->hide();
GroupPoints->ComboBox1->hide();
GroupPoints->TextLabel2->setText(tr("GEOM_PLANE"));
+ GroupPoints->radioButton4->hide();
resize(0, 0);
break;
}
int aLimit = GetLimit();
int aConstructorId = getConstructorId();
- if (aConstructorId == 1)
+ int aKeepNonlimitShapes = 0;
+ if (aConstructorId == 1) {
aLimit = GEOM::SHAPE;
+ }
+ else {
+ if(GroupPoints->radioButton4->isChecked()) {
+ aKeepNonlimitShapes = 1;
+ }
+ else {
+ aKeepNonlimitShapes = 0;
+ }
+ }
if (isValid( msg )) {
anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
MakePartition(myListShapes, myListTools,
myListKeepInside, myListRemoveInside,
- aLimit, false, myListMaterials);
+ aLimit, false, myListMaterials, aKeepNonlimitShapes);
res = true;
}
#define DIALOGBOX_PARTITION_H
#include "GEOMBase_Skeleton.h"
-#include "DlgRef_2Sel1List_QTD.h"
+#include "DlgRef_2Sel1List1Check_QTD.h"
//=================================================================================
// class : OperationGUI_PartitionDlg
GEOM::ListOfGO myListRemoveInside;
GEOM::ListOfGO myListKeepInside;
- DlgRef_2Sel1List_QTD* GroupPoints;
+ DlgRef_2Sel1List1Check_QTD* GroupPoints;
private slots:
void ClickOnOk();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double initValue = 200.0;
GroupDimensions->SpinBox_DX->SetValue(initValue);
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
double aRadius1(100.0), aRadius2(0.0), aHeight(300.0);
GroupPoints->SpinBox_DX->SetValue(aRadius1);
/* min, max, step and decimals for spin boxes & initial values */
/* First constructor : radius */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* First constructor : algebric height */
- GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* Second constructor : radius */
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
/* Second constructor : algebric height */
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
GroupPoints->SpinBox_DY->SetValue(300.0);
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
GroupDimensions->SpinBox_DX->SetValue(100.0);
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "utilities.h"
-using namespace std;
-
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
-// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
+// purpose : Constructs a PrimitiveGUI_TorusDlg 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.
//=================================================================================
PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
- QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV")));
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ")));
- QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_PV")));
+ QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_DXYZ")));
+ QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
setCaption(tr("GEOM_TORUS_TITLE"));
Layout1->addWidget(GroupDimensions, 2, 0);
/***************************************************************/
- setHelpFileName("turus.htm");
-
+ setHelpFileName("turus.htm");
+
Init();
}
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
-
+
myPoint = myDir = GEOM::GEOM_Object::_nil();
/* Get setting of step value from file configuration */
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(300.0);
GroupPoints->SpinBox_DY->SetValue(100.0);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupDimensions->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
- connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
-
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupPoints->SpinBox_DY, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
+ connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
+ GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
initName( tr( "GEOM_TORUS" ) );
ConstructorsClicked(0);
}
//=================================================================================
void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
{
- disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
-
- switch(constructorId)
- {
- case 0 :
- {
- globalSelection( GEOM_LINE );
-
- GroupDimensions->hide();
- resize(0, 0);
- GroupPoints->show();
-
- myEditCurrentArgument = GroupPoints->LineEdit1;
- GroupPoints->LineEdit1->setText(tr(""));
- GroupPoints->LineEdit2->setText(tr(""));
- myPoint = myDir = GEOM::GEOM_Object::_nil();
-
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- break ;
- }
- case 1 :
- {
- GroupPoints->hide();
- resize( 0, 0 );
- GroupDimensions->show();
-
- break ;
- }
+ disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+ switch (constructorId)
+ {
+ case 0:
+ {
+ globalSelection( GEOM_POINT );
+
+ GroupDimensions->hide();
+ resize(0, 0);
+ GroupPoints->show();
+
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->LineEdit1->setText(tr(""));
+ GroupPoints->LineEdit2->setText(tr(""));
+ myPoint = myDir = GEOM::GEOM_Object::_nil();
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ SelectionIntoArgument();
+
+ break;
+ }
+ case 1:
+ {
+ GroupPoints->hide();
+ resize(0, 0);
+ GroupDimensions->show();
+
+ break;
}
+ }
+
displayPreview();
}
return false;
initName();
- ConstructorsClicked( getConstructorId() );
return true;
}
-//=======================================================================
-// function : ClickOnCancel()
-// purpose :
-//=======================================================================
-void PrimitiveGUI_TorusDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
{
if ( getConstructorId() != 0 )
return;
-
+
myEditCurrentArgument->setText("");
-
- if(IObjectCount() != 1)
- {
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
- myPoint = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
- myDir = GEOM::GEOM_Object::_nil();
- return;
- }
-
-
+
+ if (IObjectCount() != 1)
+ {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
+ myPoint = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ myDir = GEOM::GEOM_Object::_nil();
+ return;
+ }
+
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if(!testResult || CORBA::is_nil( aSelectedObject ))
+
+ if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
-
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2)
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myDir = aSelectedObject;
-
+
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
displayPreview();
}
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose :
+//=================================================================================
+void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
+{
+ QLineEdit* send = (QLineEdit*)sender();
+ if (send == GroupPoints->LineEdit1 ||
+ send == GroupPoints->LineEdit2)
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
+}
+
+
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
- if(send == GroupPoints->PushButton1) {
+
+ if (send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_POINT );
}
- else if(send == GroupPoints->PushButton2) {
+ else if (send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_LINE );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::LineEditReturnPressed()
-{
- QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 ||
- send == GroupPoints->LineEdit2)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
-}
-
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
void PrimitiveGUI_TorusDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+
ConstructorsClicked( getConstructorId() );
}
}
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void PrimitiveGUI_TorusDlg::DeactivateActiveDialog()
-{
- GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
//=================================================================================
// function : ValueChangedInSpinBox
// purpose :
bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
- {
- case 0 :
+ switch ( getConstructorId() )
{
- if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir )){
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
- res = true;
+ case 0:
+ {
+ if (!CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ))
+ {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2());
+ res = true;
+ }
+ break;
}
- break;
- }
- case 1 :
+ case 1:
{
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeTorusRR(getRadius1(), getRadius2());
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeTorusRR(getRadius1(), getRadius2());
res = true;
break;
}
}
-//=================================================================================
-// function : closeEvent
-// purpose :
-//=================================================================================
-void PrimitiveGUI_TorusDlg::closeEvent( QCloseEvent* e )
-{
- GEOMBase_Skeleton::closeEvent( e );
-}
-
-
//=================================================================================
// function : getRadius1()
// purpose :
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual void closeEvent( QCloseEvent* e );
-
private:
void Init();
void enterEvent(QEvent* e);
+
double getRadius1() const;
double getRadius2() const;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_2Spin* GroupDimensions;
- private slots:
+private slots:
void ClickOnOk();
bool ClickOnApply();
- void ClickOnCancel();
+
void ActivateThisDialog();
- void DeactivateActiveDialog();
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
bool aResult = false;
objects.clear();
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
+ {
+ case 0:
+ {
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+ ( getOperation() )->MakeGlueFaces( myObject, myTolEdt2->value(), true );
+ aResult = !anObj->_is_nil();
+ if ( aResult )
+ objects.push_back( anObj._retn() );
+ break;
+ }
+ case 1:
{
- case 0 :
+ if ( IsPreview() )
{
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
- ( getOperation() )->MakeGlueFaces( myObject, myTolEdt2->value() );
- aResult = !anObj->_is_nil();
- if ( aResult )
- objects.push_back( anObj._retn() );
- break;
- }
- case 1 :
- if ( IsPreview() )
- {
- // if this method is used for displaying preview then we must detect glue faces only
- ObjectList::iterator anIter;
- for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
- objects.push_back( GEOM::GEOM_Object::_duplicate( *anIter ) );
- return myTmpObjs.size() ? true : false;
- } // IsPreview
-
- // Make glue face by list.
- // Iterate through myTmpObjs and verifies where each object is currently selected or not.
- QMap<QString, char> selected;
-
- // Get names of selected objects
- SALOME_ListIteratorOfListIO it ( selectedIO() );
- for (; it.More(); it.Next())
- selected.insert( it.Value()->getName(), 0 );
-
- // Iterate through result and select objects with names from selection
- // ObjectList toRemoveFromEnggine;
- ObjectList toGlue;
+ // if this method is used for displaying preview then we must detect glue faces only
ObjectList::iterator anIter;
- for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
- {
- if ( selected.contains( myGeomGUI->getApp()->orb()->object_to_string(*anIter) ) )
- toGlue.push_back(*anIter);
- }
-
- // make glue faces
- GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
- aListForGlue->length( toGlue.size() );
- ObjectList::iterator anIter3 = toGlue.begin();
- for ( int i = 0; anIter3 != toGlue.end(); ++anIter3, ++i )
- aListForGlue[ i ] = *anIter3;
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
- ( getOperation() )->MakeGlueFacesByList( myObject, myTolEdt2->value(), aListForGlue );
-
- aResult = !anObj->_is_nil();
-
- if ( aResult )
- objects.push_back( anObj._retn() );
-
- // Remove from engine useless objects
- clearTemporary();
-
- updateButtonState();
-
+ for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+ objects.push_back( GEOM::GEOM_Object::_duplicate( *anIter ) );
+ return myTmpObjs.size() ? true : false;
+ } // IsPreview
+
+ // Make glue face by list.
+ // Iterate through myTmpObjs and verifies where each object is currently selected or not.
+ QMap<QString, char> selected;
+
+ // Get names of selected objects
+ SALOME_ListIteratorOfListIO it ( selectedIO() );
+ for (; it.More(); it.Next())
+ selected.insert( it.Value()->getName(), 0 );
+
+ // Iterate through result and select objects with names from selection
+ // ObjectList toRemoveFromEnggine;
+ ObjectList toGlue;
+ ObjectList::iterator anIter;
+ for (anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter)
+ {
+ if ( selected.contains( myGeomGUI->getApp()->orb()->object_to_string(*anIter) ) )
+ toGlue.push_back(*anIter);
+ }
+
+ // make glue faces
+ GEOM::ListOfGO_var aListForGlue = new GEOM::ListOfGO();
+ aListForGlue->length( toGlue.size() );
+ ObjectList::iterator anIter3 = toGlue.begin();
+ for ( int i = 0; anIter3 != toGlue.end(); ++anIter3, ++i )
+ aListForGlue[ i ] = *anIter3;
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow
+ ( getOperation() )->MakeGlueFacesByList( myObject, myTolEdt2->value(), aListForGlue, true );
+
+ aResult = !anObj->_is_nil();
+
+ if ( aResult )
+ objects.push_back( anObj._retn() );
+
+ // Remove from engine useless objects
+ clearTemporary();
+
+ updateButtonState();
+
break;
- } // case
+ } // case 1
+ } // switch
return aResult;
}
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
-// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_MultiRotationDlg 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.
double SpecificStep1 = 5;
double SpecificStep2 = 1;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
GroupPoints->SpinBox_DX->SetValue(myNbTimes1);
- GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, 3);
- GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
- GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 3);
+ GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
+ GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep2, 10);
GroupDimensions->SpinBox_DX1->SetValue(myAng);
GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1);
GroupDimensions->SpinBox_DX2->SetValue(myStep);
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY2, SLOT(SetStep(double)));
connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_MULTIROTATION" ) );
GroupDimensions->SpinBox_DY2->SetValue(myNbTimes2);
break;
- }
+ }
}
myEditCurrentArgument->setFocus();
{
if ( !onAccept() )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_ALLSHAPES );
void TransformationGUI_MultiRotationDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
+ if(send == GroupPoints->LineEdit1 || send == GroupDimensions->LineEdit1 ||
send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2)
{
- myEditCurrentArgument = send;
+ myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
}
void TransformationGUI_MultiRotationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
+
ConstructorsClicked( getConstructorId() );
}
myStep = newValue;
else if(send == GroupDimensions->SpinBox_DY2)
myNbTimes2 = (int)newValue;
-
+
displayPreview();
}
bool TransformationGUI_MultiRotationDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0 :
{
break;
}
}
-
+
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
-// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_MultiTranslationDlg 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.
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
-
+
double SpecificStep = 1;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
GroupPoints->SpinBox_DX->SetValue(myStepU);
GroupPoints->SpinBox_DY->SetValue(myNbTimesU);
- GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
- GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 3);
+ GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
+ GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, MAX_NUMBER, SpecificStep, 10);
GroupDimensions->SpinBox_DX1->SetValue(myStepU);
GroupDimensions->SpinBox_DY1->SetValue(myNbTimesU);
GroupDimensions->SpinBox_DX2->SetValue(myStepV);
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
connect(GroupDimensions->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(ReverseStepV()));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-
initName( tr( "GEOM_MULTITRANSLATION" ) );
ConstructorsClicked( 0 );
}
void TransformationGUI_MultiTranslationDlg::ConstructorsClicked(int constructorId)
{
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-
+
myStepU = myStepV = 50.0;
myNbTimesU = myNbTimesV = 2;
break;
}
}
-
+
myEditCurrentArgument->setFocus();
myBase = myVectorU = GEOM::GEOM_Object::_nil();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
{
if ( !onAccept() )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
-
- if(IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
+
+ if (IObjectCount() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit1)
myBase = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit2)
myVectorU = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupDimensions->LineEdit3)
+ else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
myVectorV = GEOM::GEOM_Object::_nil();
return;
}
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
return;
- if(myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1)
- myBase = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupDimensions->LineEdit2)
+ if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit1)
+ myBase = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 ||
+ myEditCurrentArgument == GroupDimensions->LineEdit2)
myVectorU = aSelectedObject;
- else if(myEditCurrentArgument == GroupDimensions->LineEdit3)
+ else if (myEditCurrentArgument == GroupDimensions->LineEdit3)
myVectorV = aSelectedObject;
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument = GroupDimensions->LineEdit3;
globalSelection( GEOM_LINE );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
send == GroupPoints->LineEdit2 || send == GroupDimensions->LineEdit2 ||
send == GroupDimensions->LineEdit3)
{
- myEditCurrentArgument = send;
+ myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
}
void TransformationGUI_MultiTranslationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
break;
}
}
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::ReverseStepU()
{
myStepU = -myStepU;
-
+
int aConstructorId = getConstructorId();
if(aConstructorId == 0)
GroupPoints->SpinBox_DX->SetValue(myStepU);
else if(aConstructorId == 1)
GroupDimensions->SpinBox_DX1->SetValue(myStepU);
-
+
displayPreview();
}
void TransformationGUI_MultiTranslationDlg::ReverseStepV()
{
myStepV = -myStepV;
-
+
GroupDimensions->SpinBox_DX2->SetValue(myStepV);
-
+
displayPreview();
}
bool TransformationGUI_MultiTranslationDlg::isValid( QString& msg )
{
int aConstructorId = getConstructorId();
-
+
if(aConstructorId == 0)
return !(myBase->_is_nil() || myVectorU->_is_nil());
else if(aConstructorId == 1)
return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil());
- return 0;
+ return 0;
}
//=================================================================================
bool TransformationGUI_MultiTranslationDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
case 0 :
{
break;
}
}
-
+
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_OffsetDlg()
-// purpose : Constructs a TransformationGUI_OffsetDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_OffsetDlg 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.
RadioButton1->setPixmap(image0);
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
-
+
GroupPoints = new DlgRef_1Sel1Spin1Check(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->CheckButton1->hide();
GroupPoints->PushButton1->setPixmap(image1);
-
+
Layout1->addWidget(GroupPoints, 2, 0);
-
+
/***************************************************************/
- setHelpFileName("offset_surface.htm");
-
+ setHelpFileName("offset_surface.htm");
+
Init();
}
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
TransformationGUI_OffsetDlg::~TransformationGUI_OffsetDlg()
-{
+{
/* no need to delete child widgets, Qt does it all for us */
}
// purpose :
//=================================================================================
void TransformationGUI_OffsetDlg::Init()
-{
+{
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setReadOnly( true );
-
+
/* Get setting of step value from file configuration */
double step = 1;
-
+
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox_DX->setPrecision(5);
- //@ GroupPoints->SpinBox_DX->setDblPrecision(1e-05);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(1e-05);
-
+
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
+
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-
+
initName( tr( "GEOM_OFFSET" ) );
globalSelection( GEOM_ALLSHAPES );
-
}
{
if ( !onAccept( GroupPoints->CheckButton1->isChecked() ) )
return false;
-
+
initName();
return true;
}
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
if (!myObjects.length())
return;
-
+
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_OffsetDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1)
{
myEditCurrentArgument = GroupPoints->LineEdit1;
void TransformationGUI_OffsetDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1;
bool TransformationGUI_OffsetDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
-
-
+
if (GroupPoints->CheckButton1->isChecked() || IsPreview())
for (int i = 0; i < myObjects.length(); i++)
- {
-
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShapeCopy( myObjects[i], GetOffset() );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ OffsetShapeCopy( myObjects[i], GetOffset() );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
else
for (int i = 0; i < myObjects.length(); i++)
- {
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->OffsetShape( myObjects[i], GetOffset() );
- if ( !anObj->_is_nil() )
- objects.push_back( anObj._retn() );
- }
-
+ {
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ OffsetShape( myObjects[i], GetOffset() );
+ if ( !anObj->_is_nil() )
+ objects.push_back( anObj._retn() );
+ }
+
res = true;
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_RotationDlg()
-// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_RotationDlg 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.
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
+
double anAngle = 0;
double SpecificStep = 5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(anAngle);
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
-
+
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton5, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
+
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
-
+
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit2->clear();
-
+
myAxis = myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-
+
initName( tr( "GEOM_ROTATION" ) );
ConstructorsClicked( 0 );
}
void TransformationGUI_RotationDlg::ConstructorsClicked(int constructorId)
{
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-
+
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
switch (constructorId)
{
case 0: /* rotation an object angle and axis */
- {
+ {
GroupPoints->ShowRows(2,3,false);
resize(0,0);
GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
GroupPoints->LineEdit5->clear();
myCentPoint = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
break;
- }
+ }
}
-
+
myEditCurrentArgument->setFocus();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
{
if ( !onAccept( GroupPoints->CheckButton1->isChecked()) )
return false;
-
+
initName();
ConstructorsClicked( getConstructorId() );
return true;
{
myEditCurrentArgument->setText("");
QString aName;
-
+
if(myEditCurrentArgument == GroupPoints->LineEdit1)
{
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
if (!myObjects.length())
return;
}
- else
+ else
{
if(IObjectCount() != 1)
{
aName = GEOMBase::GetName( aSelectedObject );
}
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_RotationDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
// purpose :
//=================================================================================
void TransformationGUI_RotationDlg::LineEditReturnPressed()
-{
+{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2)
void TransformationGUI_RotationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
{
switch (getConstructorId())
{
- case 0:
+ case 0:
{
return !(myObjects.length() == 0 || myAxis->_is_nil());
break;
}
- case 1:
+ case 1:
{
return !(myObjects.length() == 0 || myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil() );
break;
bool toCreateCopy = IsPreview() || GroupPoints->CheckButton1->isChecked();
GEOM::GEOM_Object_var anObj;
-
- switch ( getConstructorId() )
+
+ switch ( getConstructorId() )
{
case 0 :
{
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateCopy( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ Rotate( myObjects[i], myAxis, GetAngle() * PI180 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateThreePointsCopy( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ RotateThreePoints( myObjects[i], myCentPoint, myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
break;
}
}
-
+
return res;
}
//=================================================================================
// class : TransformationGUI_ScaleDlg()
-// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_ScaleDlg 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.
double aFactor = 2.0;
double SpecificStep = 0.5;
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(aFactor);
-
+
// Activate Create a Copy mode
GroupPoints->CheckButton1->setChecked(true);
CreateCopyModeChanged(true);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
+
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
+
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
setHelpFileName("scale_transform.htm");
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
TransformationGUI_ScaleDlg::~TransformationGUI_ScaleDlg()
-{
+{
/* no need to delete child widgets, Qt does it all for us */
}
{
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit2->clear();
-
+
myPoint = GEOM::GEOM_Object::_nil();
-
+
initName( tr( "GEOM_SCALE" ) );
}
aName = GEOMBase::GetName( myPoint );
}
myEditCurrentArgument->setText( aName );
-
+
displayPreview();
}
void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
-
+
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection( GEOM_POINT );
}
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
void TransformationGUI_ScaleDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
globalSelection();
GroupPoints->LineEdit1->setFocus();
bool TransformationGUI_ScaleDlg::execute( ObjectList& objects )
{
bool res = false;
-
+
GEOM::GEOM_Object_var anObj;
if (GroupPoints->CheckButton1->isChecked() || IsPreview())
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ ScaleShapeCopy( myObjects[i], myPoint, GetFactor() );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->ScaleShape( myObjects[i], myPoint, GetFactor() );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ ScaleShape( myObjects[i], myPoint, GetFactor() );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
res = true;
-
+
return res;
}
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
-#include <qcheckbox.h>
#include <qlabel.h>
+#include <qcheckbox.h>
#include "GEOMImpl_Types.hxx"
//=================================================================================
// class : TransformationGUI_TranslationDlg()
-// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the
+// purpose : Constructs a TransformationGUI_TranslationDlg 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.
//=================================================================================
TransformationGUI_TranslationDlg::TransformationGUI_TranslationDlg
(GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSLATION_DXYZ")));
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
-
+
setHelpFileName("translation.htm");
-
+
Init();
}
GroupPoints->LineEdit1->setReadOnly(true);
GroupPoints->LineEdit2->setReadOnly(true);
GroupPoints->LineEdit3->setReadOnly(true);
-
+
myVector = myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
-
+
// Activate Create a Copy mode
GroupPoints->CheckBox1->setChecked(true);
CreateCopyModeChanged(true);
-
+
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
-
+
/* min, max, step and decimals for spin boxes & initial values */
- GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
- GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
-
+ GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+
GroupPoints->SpinBox1->SetValue(0.0);
GroupPoints->SpinBox2->SetValue(0.0);
GroupPoints->SpinBox3->SetValue(0.0);
-
+
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupPoints->SpinBox1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->SpinBox2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->SpinBox3, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
-
+
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox1, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox2, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox3, SLOT(SetStep(double)));
-
+
connect(GroupPoints->CheckBox1, SIGNAL(toggled(bool)), this, SLOT(CreateCopyModeChanged(bool)));
-
- connect(myGeomGUI->getApp()->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_TRANSLATION" ) );
ConstructorsClicked( 0 );
//=================================================================================
void TransformationGUI_TranslationDlg::ConstructorsClicked(int constructorId)
{
+ erasePreview();
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-
+
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection();
switch (constructorId)
{
case 0: /* translation an object by dx, dy, dz */
- {
+ {
GroupPoints->ShowRows(1,2,false);
resize(0,0);
GroupPoints->ShowRows(3,5,true);
GroupPoints->LineEdit3->clear();
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
break;
- }
+ }
case 2: /* translation an object by vector */
{
GroupPoints->ShowRows(2,5,false);
break;
}
}
-
+
myEditCurrentArgument->setFocus();
- connect(myGeomGUI->getApp()->selectionMgr(),
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
{
if ( !onAccept(GroupPoints->CheckBox1->isChecked()) )
return false;
-
+
initName();
- ConstructorsClicked( getConstructorId() );
return true;
}
{
myEditCurrentArgument->setText("");
QString aName;
-
- if(myEditCurrentArgument == GroupPoints->LineEdit1)
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
+ {
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
+
+ if (aNbSel < 1)
{
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aName);
-
- if(aNbSel < 1)
- {
- myObjects.length(0);
- return;
- }
- GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
- if (!myObjects.length())
- return;
+ myObjects.length(0);
+ return;
}
+ GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), myObjects);
+ if (!myObjects.length())
+ return;
+ }
else
- {
- if (IObjectCount() != 1) {
- if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
- myPoint1 = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
- myVector = GEOM::GEOM_Object::_nil();
- else if(myEditCurrentArgument == GroupPoints->LineEdit3)
- myPoint2 = GEOM::GEOM_Object::_nil();
- return;
- }
-
- Standard_Boolean testResult = Standard_False;;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
-
- if (!testResult || CORBA::is_nil( aSelectedObject ))
- return;
-
- if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
- myPoint1 = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
- myVector = aSelectedObject;
- else if(myEditCurrentArgument == GroupPoints->LineEdit3)
- myPoint2 = aSelectedObject;
-
- aName = GEOMBase::GetName( aSelectedObject );
+ {
+ if (IObjectCount() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
+ myPoint1 = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
+ myVector = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit3)
+ myPoint2 = GEOM::GEOM_Object::_nil();
+ return;
}
-
+
+ Standard_Boolean testResult = Standard_False;
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult);
+
+ if (!testResult || CORBA::is_nil( aSelectedObject ))
+ return;
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
+ myPoint1 = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
+ myVector = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit3)
+ myPoint2 = aSelectedObject;
+
+ aName = GEOMBase::GetName( aSelectedObject );
+ }
+
myEditCurrentArgument->setText( aName );
-
displayPreview();
}
void TransformationGUI_TranslationDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if(send == GroupPoints->LineEdit1)
- {
- myEditCurrentArgument = send;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ if (send == GroupPoints->LineEdit1)
+ {
+ myEditCurrentArgument = send;
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
// purpose :
//=================================================================================
void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
-{
+{
QPushButton* send = (QPushButton*)sender();
-
- if(send == GroupPoints->PushButton1)
- {
- myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection();
- }
- else if (send == GroupPoints->PushButton2)
- {
- myEditCurrentArgument = GroupPoints->LineEdit2;
- getConstructorId() == 1 ? globalSelection( GEOM_POINT ) :
- globalSelection( GEOM_LINE );
- }
- else if (send == GroupPoints->PushButton3)
- {
- myEditCurrentArgument = GroupPoints->LineEdit3;
- globalSelection( GEOM_POINT );
- }
-
+
+ if (send == GroupPoints->PushButton1) {
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ globalSelection();
+ }
+ else if (send == GroupPoints->PushButton2) {
+ myEditCurrentArgument = GroupPoints->LineEdit2;
+ getConstructorId() == 1 ? globalSelection( GEOM_POINT ) :
+ globalSelection( GEOM_LINE );
+ }
+ else if (send == GroupPoints->PushButton3) {
+ myEditCurrentArgument = GroupPoints->LineEdit3;
+ globalSelection( GEOM_POINT );
+ }
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
void TransformationGUI_TranslationDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(myGeomGUI->getApp()->selectionMgr(),
+
+ connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked( getConstructorId() );
//=================================================================================
void TransformationGUI_TranslationDlg::enterEvent(QEvent* e)
{
- if(!GroupConstructors->isEnabled())
+ if (!GroupConstructors->isEnabled())
ActivateThisDialog();
}
//=================================================================================
GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation()
{
- return myGeomGUI->GetGeomGen()->GetITransformOperations( getStudyId() );
+ return getGeomEngine()->GetITransformOperations( getStudyId() );
}
bool TransformationGUI_TranslationDlg::isValid( QString& msg )
{
int aConstructorId = getConstructorId();
-
+
switch (aConstructorId)
{
- case 0:
+ case 0:
{
return !(myObjects.length() == 0 );
break;
}
- case 1:
+ case 1:
{
return !(myObjects.length() == 0 || myPoint1->_is_nil() || myPoint2->_is_nil() );
break;
}
- case 2:
+ case 2:
{
return !(myObjects.length() == 0 || myVector->_is_nil());
break;
- }
+ }
default: return false;
}
}
{
bool res = false;
bool toCreateCopy = IsPreview() || GroupPoints->CheckBox1->isChecked();
-
+
GEOM::GEOM_Object_var anObj;
- switch ( getConstructorId() )
+ switch ( getConstructorId() )
{
- case 0 :
+ case 0:
{
double dx = GroupPoints->SpinBox1->GetValue();
double dy = GroupPoints->SpinBox2->GetValue();
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZ( myObjects[i], dx, dy, dz );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateDXDYDZ( myObjects[i], dx, dy, dz );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
res = true;
break;
}
- case 1 :
+ case 1:
{
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
if (toCreateCopy)
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVectorCopy( myObjects[i], myVector );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateVectorCopy( myObjects[i], myVector );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else
for (int i = 0; i < myObjects.length(); i++)
{
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateVector( myObjects[i], myVector );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateVector( myObjects[i], myVector );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
break;
}
}
-
- return res;
-}
-
-//=================================================================================
-// function : closeEvent
-// purpose :
-//=================================================================================
-void TransformationGUI_TranslationDlg::closeEvent( QCloseEvent* e )
-{
- // myGeomGUI->SetState( -1 );
- GEOMBase_Skeleton::closeEvent( e );
+ return res;
}
virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects );
- virtual void closeEvent( QCloseEvent* e );
-
-private :
+private:
void Init();
void enterEvent(QEvent* e);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
- void ValueChangedInSpinBox();
void ConstructorsClicked(int constructorId);
+ void ValueChangedInSpinBox();
void CreateCopyModeChanged(bool isCreateCopy);
};