boolean GetFreeBoundary (in GEOM_Object theObject,
out ListOfGO theClosedWires,
out ListOfGO theOpenWires);
+
+ /*!
+ * Change orientation of the given object.
+ * \param theObject Shape to be processed.
+ * \return New GEOM_Object, containing processed shape.
+ */
+ GEOM_Object ChangeOrientation (in GEOM_Object theObject);
+ GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject);
+
};
/*!
msgid "ICON_DLG_SUPRESS_HOLE_FACE_SHELL"
msgstr "supressHolesOnFaceShell.png"
+#ChangeOrientationDlg
+msgid "ICON_DLG_CHANGE_ORIENTATION"
+msgstr "change_orientation.png"
+
#MultiTranslationDlg
msgid "ICON_DLG_MULTITRANSLATION_SIMPLE"
msgstr "multitranslationsimple.png"
msgid "ICON_DLG_SEWING"
msgstr "sewing.png"
+#ChangeOrientationDlg
+msgid "ICON_DLG_CHANGE_ORIENTATION"
+msgstr "change_orientation.png"
+
#PipeDlg
msgid "ICON_DLG_PIPE"
msgstr "pipe.png"
msgid "ICO_CHECK_FREE_FACES"
msgstr "free_faces.png"
+msgid "ICO_CHANGE_ORIENTATION"
+msgstr "change_orientation.png"
+
msgid "ICO_POINT_COORDS"
msgstr "point_coord.png"
msgid "GEOM_FREE_FACES"
msgstr "Free faces"
+msgid "GEOM_CHANGE_ORIENTATION_TITLE"
+msgstr "Change orientation"
+
+msgid "GEOM_CHANGE_ORIENTATION"
+msgstr "Objects to change orientation"
+
msgid "GEOM_BY_PARAMETER"
msgstr "By parameter"
msgid "SUPRESS_FACE_NEW_OBJ_NAME"
msgstr "SupressFaces"
+msgid "CHANGE_ORIENTATION_NEW_OBJ_NAME"
+msgstr "Invert"
+
msgid "NON_GEOM_OBJECTS_SELECTED"
msgstr "There are objects selected which do not belong to %1 component."
msgid "STB_CHECK_FREE_FACES"
msgstr "Check free faces"
+msgid "TOP_CHANGE_ORIENTATION"
+msgstr "Change orientation"
+
+msgid "MEN_CHANGE_ORIENTATION"
+msgstr "Change orientation"
+
+msgid "STB_CHANGE_ORIENTATION"
+msgstr "Change orientation"
+
msgid "MEN_MEASURES"
msgstr "Measures"
id == 608 || // MENU REPAIR - ADD POINT ON EDGE
id == 609 || // MENU REPAIR - FREE BOUNDARIES
id == 610 || // MENU REPAIR - FREE FACES
+ id == 611 || // MENU REPAIR - CHANGE ORIENTATION
id == 602 ) { // MENU REPAIR - GLUE FACES
#ifndef WNT
library = getLibrary( "libRepairGUI.so" );
createGeomAction( 608, "POINT_ON_EDGE" );
createGeomAction( 609, "CHECK_FREE_BNDS" );
createGeomAction( 610, "CHECK_FREE_FACES" );
+ createGeomAction( 611, "CHANGE_ORIENTATION" );
createGeomAction( 708, "POINT_COORDS" );
createGeomAction( 701, "BASIC_PROPS" );
createMenu( 608, repairId, -1 );
createMenu( 609, repairId, -1 );
createMenu( 610, repairId, -1 );
+ createMenu( 611, repairId, -1 );
int measurId = createMenu( tr( "MEN_MEASURES" ), -1, -1, 10 );
createMenu( 708, measurId, -1 );
return true;
}
+
+
+//=============================================================================
+/*!
+ * ChangeOrientation
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientation (GEOM::GEOM_Object_ptr theObject)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Check parameters
+ if ( CORBA::is_nil(theObject) )
+ return aGEOMObject._retn();
+
+ aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject);
+
+ // Get the object itself
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+ if (anObject.IsNull())
+ return aGEOMObject._retn();
+
+ // Perform
+// Handle(GEOM_Object) aNewObject =
+ GetOperations()->ChangeOrientation( anObject );
+// if (!GetOperations()->IsDone() || aNewObject.IsNull())
+// return aGEOMObject._retn();
+
+ //return GetObject(aNewObject);
+ return aGEOMObject._retn();
+}
+
+
+//=============================================================================
+/*!
+ * ChangeOrientationCopy
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ // Set a not done flag
+ GetOperations()->SetNotDone();
+
+ // Check parameters
+ if ( CORBA::is_nil(theObject) )
+ return aGEOMObject._retn();
+
+ // Get the object itself
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
+ if (anObject.IsNull())
+ return aGEOMObject._retn();
+
+ // Perform
+ Handle(GEOM_Object) aNewObject =
+ GetOperations()->ChangeOrientationCopy( anObject );
+ if (!GetOperations()->IsDone() || aNewObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(aNewObject);
+}
+
CORBA::Boolean GetFreeBoundary(GEOM::GEOM_Object_ptr theObject, GEOM::ListOfGO_out theClosedWires, GEOM::ListOfGO_out theOpenWires );
+ GEOM::GEOM_Object_ptr ChangeOrientation (GEOM::GEOM_Object_ptr theObject);
+ GEOM::GEOM_Object_ptr ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject);
+
::GEOMImpl_IHealingOperations* GetOperations() { return (::GEOMImpl_IHealingOperations*)GetImpl(); }
private:
print "DivideEdge : ", HealOp.GetErrorCode()
return anObj
+## Change orientation of the given object.
+# @param theObject Shape to be processed.
+# @update given shape
+def ChangeOrientation(theObject):
+ theObject = HealOp.ChangeOrientation(theObject)
+ if HealOp.IsDone() == 0:
+ print "ChangeOrientation : ", HealOp.GetErrorCode()
+
+## Change orientation of the given object.
+# @param theObject Shape to be processed.
+# @return New GEOM_Object, containing processed shape.
+def ChangeOrientationCopy(theObject):
+ anObj = HealOp.ChangeOrientation(theObject)
+ if HealOp.IsDone() == 0:
+ print "ChangeOrientation : ", HealOp.GetErrorCode()
+ return anObj
+
## Get a list of wires (wrapped in GEOM_Object-s),
# that constitute a free boundary of the given shape.
# @param theObject Shape to get free boundary of.
ShHealOper_ShapeProcess.cxx \
ShHealOper_SplitCurve2d.cxx \
ShHealOper_SplitCurve3d.cxx \
+ ShHealOper_ChangeOrientation.cxx \
ShHealOper_Tool.cxx \
LIB_CLIENT_IDL =
ShHealOper_SpiltCurve2d.hxx \
ShHealOper_SplitCurve2d.hxx \
ShHealOper_SplitCurve3d.hxx \
+ ShHealOper_ChangeOrientation.hxx \
ShHealOper_Tool.hxx
# idl files
--- /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: ShHealOper_ChangeOrientation.cxx
+// Created: 11.07.06 11:46:45
+// Author: Sergey KUUL
+
+
+#include <ShHealOper_ChangeOrientation.hxx>
+
+#include <BRep_Builder.hxx>
+#include <TopoDS_Iterator.hxx>
+
+//=======================================================================
+//function : ShHealOper_ChangeOrientation()
+//purpose : Constructor
+//=======================================================================
+
+ShHealOper_ChangeOrientation::ShHealOper_ChangeOrientation ( const TopoDS_Shape& theShape )
+{
+ Init(theShape);
+}
+
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+
+void ShHealOper_ChangeOrientation::Init(const TopoDS_Shape& theShape)
+{
+ ShHealOper_Tool::Init(theShape);
+}
+
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+
+Standard_Boolean ShHealOper_ChangeOrientation::Perform()
+{
+ if (myInitShape.ShapeType() == TopAbs_SHELL) {
+ BRep_Builder B;
+ myResultShape = myInitShape.EmptyCopied();
+ TopoDS_Iterator itr(myInitShape);
+ while (itr.More()) {
+ B.Add(myResultShape,itr.Value().Reversed());
+ itr.Next();
+ }
+ }
+ else if (myInitShape.ShapeType() == TopAbs_FACE) {
+ myResultShape = myInitShape.Reversed();
+ }
+ else if (myInitShape.ShapeType() == TopAbs_WIRE) {
+ myResultShape = myInitShape.Reversed();
+ }
+ else if (myInitShape.ShapeType() == TopAbs_EDGE) {
+ myResultShape = myInitShape.Reversed();
+ }
+ else {
+ return false;
+ }
+
+ return 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
+//
+//
+// File: ShHealOper_ChangeOrientation.hxx
+// Created: 11.07.06 11:22:26
+// Author: Sergey KUUL
+
+
+#ifndef ShHealOper_ChangeOrientation_HeaderFile
+#define ShHealOper_ChangeOrientation_HeaderFile
+
+#include <MMgt_TShared.hxx>
+#include <ShHealOper_Tool.hxx>
+#include <TopoDS_Shape.hxx>
+
+/// Class ShHealOper_ChangeOrientation
+// Intended for change orientation of given shape
+// if shape is Shell - create empty copy and put to it
+// each face as Reversed()
+
+class ShHealOper_ChangeOrientation : public ShHealOper_Tool
+{
+ public:
+ // ---------- PUBLIC METHODS ----------
+
+ /// Empty constructor
+ Standard_EXPORT ShHealOper_ChangeOrientation () {}
+
+ /// Copy constructor
+ Standard_EXPORT ShHealOper_ChangeOrientation (const TopoDS_Shape& theShape);
+ //Method for initalization by whole shape.
+
+ Standard_EXPORT virtual void Init(const TopoDS_Shape& theShape);
+ //Method for initalization by whole shape.
+
+ Standard_EXPORT Standard_Boolean Perform();
+ //Change orientation
+
+
+ public:
+// Declaration of CASCADE RTTI
+//DEFINE_STANDARD_RTTI (ShHealOper_RemoveInternalWires)
+};
+
+// Definition of HANDLE object using Standard_DefineHandle.hxx
+//DEFINE_STANDARD_HANDLE (ShHealOper_RemoveInternalWires, )
+
+
+#endif