// Module : GEOM
// $Header$
-using namespace std;
#include "BuildGUI_EdgeDlg.h"
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : BuildGUI_EdgeDlg()
// purpose : Constructs a BuildGUI_EdgeDlg which is a child of 'parent', with the
case TopAbs_SHAPE:
{ return "Shape" ;}
}
+ return 0;
}
// Module : GEOM
// $Header:
-using namespace std;
#include "GEOMToolsGUI.h"
#include "QAD_Config.h"
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
#include "GEOMToolsGUI_TransparencyDlg.h" // Method TRANSPARENCY adjustement
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : GEOMToolsGUI()
// purpose : Constructor
{
if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() > VIEW_OCC)
break;
-
+
OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getViewer();
Handle (AIS_InteractiveContext) ic = v3d->getAISContext();
QString nameShape = QAD_Tools::getFileNameFromPath(file,false) + QString("_%1").arg(myGeomGUI->myNbGeom++);
- if(myGeomBase->Display(aShape, strdup(nameShape.latin1()))) {
+ if(myGeomBase->Display(aShape, (char*)nameShape.latin1())) {
QAD_Application::getDesktop()->getActiveStudy()->setMessage( tr("GEOM_INF_LOADED").arg(QAD_Tools::getFileNameFromPath( file )) );
QAD_Application::getDesktop()->putInfo( tr("GEOM_PRP_READY"));
}
QApplication::setOverrideCursor( Qt::waitCursor );
// Standard_Boolean result = BRepTools::Write(Shape->Shape(), strdup(file.latin1()) );
try {
- myGeom->ExportBREP(strdup( file.latin1()), aShape);
+ myGeom->ExportBREP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
if ( !file.isEmpty() && !aShape->_is_nil() ) {
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- myGeom->ExportIGES(strdup( file.latin1()), aShape);
+ myGeom->ExportIGES((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
QApplication::setOverrideCursor( Qt::waitCursor ) ;
try {
- myGeom->ExportSTEP(strdup( file.latin1()), aShape);
+ myGeom->ExportSTEP((char*)file.latin1(), aShape);
}
catch (const SALOME::SALOME_Exception& S_ex) {
QtCatchCorbaException(S_ex);
}
QApplication::restoreOverrideCursor() ;
+ return true;
}
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_FillingDlg.h"
+#include "QAD_WaitCursor.h"
#include "QAD_Config.h"
#include <GeomFill_SectionGenerator.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS_Iterator.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_FillingDlg()
return;
if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) {
- myEditCurrentArgument->setText(aString);
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
+ // mySectionShape should be a compound of edges
+ for ( TopoDS_Iterator it( mySectionShape ); it.More(); it.Next() )
+ if ( it.Value().ShapeType() != TopAbs_EDGE )
+ return;
+ myEditCurrentArgument->setText(aString);
myOkSectionShape = true;
}
//=================================================================================
void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
{
+ QAD_WaitCursor wc;
+
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE)
return;
C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+ if (C.IsNull()) continue;
C = new Geom_TrimmedCurve(C, First, Last);
Section.AddCurve(C) ;
i++ ;
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PipeDlg.h"
#include <TopoDS_Edge.hxx>
#include <BRepAlgoAPI.hxx>
#endif
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PipeDlg()
// purpose : Constructs a GenerationGUI_PipeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_PrismDlg.h"
#include <BRepPrimAPI_MakePrism.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : GenerationGUI_PrismDlg()
// purpose : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "GenerationGUI_RevolDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include "QAD_Config.h"
+#include <TopExp_Explorer.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
//=================================================================================
// class : GenerationGUI_RevolDlg()
return;
}
+//=======================================================================
+//function : isAcceptableBase
+//purpose : return true if theBase can be used as algo argument
+//=======================================================================
+
+static bool isAcceptableBase(const TopoDS_Shape& theBase)
+{
+ switch ( theBase.ShapeType() ) {
+ case TopAbs_VERTEX:
+ case TopAbs_EDGE:
+ case TopAbs_WIRE:
+ case TopAbs_FACE:
+ case TopAbs_SHELL:
+ return true;
+ case TopAbs_SOLID:
+ case TopAbs_COMPSOLID:
+ return false;
+ case TopAbs_COMPOUND: {
+ TopExp_Explorer exp( theBase, TopAbs_SOLID);
+ return !exp.More();
+ }
+ default:
+ return false;
+ }
+ return false;
+}
//=================================================================================
// function : SelectionIntoArgument()
myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
if(!testResult)
return;
- TopAbs_ShapeEnum aType = S.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType != TopAbs_COMPOUND)
+ if( !isAcceptableBase( S ))
return;
myEditCurrentArgument->setText(aString);
myOkBase = true;
myGeomBase->EraseSimulationShape();
mySimulationTopoDs.Nullify();
- TopAbs_ShapeEnum aType = myBase.ShapeType();
- if(aType != TopAbs_VERTEX && aType != TopAbs_EDGE && aType != TopAbs_WIRE && aType != TopAbs_FACE && aType != TopAbs_SHELL && aType !=TopAbs_COMPOUND)
+ if (!isAcceptableBase( myBase ))
return;
try {
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_BndBoxDlg.h"
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBndLib.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_BndBoxDlg()
// purpose : Constructs a MeasureGUI_BndBoxDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CenterMassDlg.h"
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CenterMassDlg()
// purpose : Constructs a MeasureGUI_CenterMassDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_CheckShapeDlg.h"
#include <BRepCheck_Analyzer.hxx>
#include <qtextedit.h>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_CheckShapeDlg()
// purpose : Constructs a MeasureGUI_CheckShapeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_DistanceDlg.h"
#include "QAD_RightFrame.h"
#include <gce_MakePln.hxx>
#include <Precision.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_DistanceDlg()
// purpose : Constructs a MeasureGUI_DistanceDlg which is a child of 'parent', with the
gp_Pln gp_P = gce_MP.Value();
Handle(Geom_Plane) P = new Geom_Plane(gp_P);
- Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(strdup(S)));
+ char* aCopyS = CORBA::string_dup(S);
+ Handle(AIS_LengthDimension) Distance = new AIS_LengthDimension(V1, V2, P, Dist, TCollection_ExtendedString(aCopyS));
+ delete(aCopyS);
GroupC1->LineEdit3->setText(S);
// Author : Lucien PIGNOLONI
// Module : GEOM
-using namespace std;
#include "MeasureGUI_InertiaDlg.h"
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_InertiaDlg()
// purpose : Constructs a MeasureGUI_InertiaDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_MaxToleranceDlg.h"
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_MaxToleranceDlg()
// purpose : Constructs a MeasureGUI_MaxToleranceDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_PropertiesDlg.h"
#include <TopExp_Explorer.hxx>
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_PropertiesDlg()
// purpose : Constructs a MeasureGUI_PropertiesDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "MeasureGUI_WhatisDlg.h"
#include <TopTools_MapOfShape.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : MeasureGUI_WhatisDlg()
// purpose : Constructs a MeasureGUI_WhatisDlg which is a child of 'parent', with the
if ( S.ShapeType() == TopAbs_EDGE ) {
if( BRep_Tool::Degenerated(TopoDS::Edge(S)) ) {
- Astr = Astr + " " + strdup(SelectedName.latin1()) + " is a degenerated edge \n";
+ Astr = Astr + " " + CORBA::string_dup(SelectedName.latin1()) + " is a degenerated edge \n";
}
}
- Astr = Astr + " Number of shapes in " + strdup(SelectedName.latin1()) + " : \n";
+ Astr = Astr + " Number of shapes in " + CORBA::string_dup(SelectedName.latin1()) + " : \n";
try {
int iType, nbTypes [TopAbs_SHAPE];
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRepTools.hxx>
#include "DisplayGUI.h"
#include "QAD_MessageBox.h"
+#include <TopoDS_Edge.hxx>
#include <AIS_InteractiveContext.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_ConeDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_ConeDlg()
// purpose : Constructs a PrimitiveGUI_ConeDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_CylinderDlg.h"
#include <gp_Lin.hxx>
#include <Precision.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_CylinderDlg()
// purpose : Constructs a PrimitiveGUI_CylinderDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "PrimitiveGUI_TorusDlg.h"
#include <gp_Lin.hxx>
#include <BRepAdaptor_Curve.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : PrimitiveGUI_TorusDlg()
// purpose : Constructs a PrimitiveGUI_TorusDlg which is a child of 'parent', with the
// Module : GEOM
// $Header:
-using namespace std;
#include "RepairGUI.h"
#include "QAD_RightFrame.h"
#include "RepairGUI_SuppressFacesDlg.h" // Method SUPPRESS FACES
#include "RepairGUI_SuppressHoleDlg.h" // Method SUPPRESS HOLE
+#include "utilities.h"
+
+using namespace std;
+
//=======================================================================
// function : RepairGUI()
// purpose : Constructor
// Module : GEOM
// $Header$
-using namespace std;
#include "RepairGUI_OrientationDlg.h"
#include <Precision.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopExp_Explorer.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : RepairGUI_OrientationDlg()
// purpose : Constructs a RepairGUI_OrientationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MirrorDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include <Geom_Plane.hxx>
#include <BRep_Tool.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MirrorDlg()
// purpose : Constructs a TransformationGUI_MirrorDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiRotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiRotationDlg()
// purpose : Constructs a TransformationGUI_MultiRotationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_MultiTranslationDlg.h"
#include <gp_Lin.hxx>
#include <TopoDS_Compound.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_MultiTranslationDlg()
// purpose : Constructs a TransformationGUI_MultiTranslationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_RotationDlg.h"
#include <gp_Lin.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_RotationDlg()
// purpose : Constructs a TransformationGUI_RotationDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_ScaleDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_ScaleDlg()
// purpose : Constructs a TransformationGUI_ScaleDlg which is a child of 'parent', with the
// Module : GEOM
// $Header$
-using namespace std;
#include "TransformationGUI_TranslationDlg.h"
#include <BRepBuilderAPI_Transform.hxx>
#include "QAD_Config.h"
+#include "utilities.h"
+
+using namespace std;
+
//=================================================================================
// class : TransformationGUI_TranslationDlg()
// purpose : Constructs a TransformationGUI_TranslationDlg which is a child of 'parent', with the