From 99364640ac306bcc33aa2cb92409514b556ef761 Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 26 Jul 2011 17:48:51 +0000 Subject: [PATCH] Add PreCAD IDL functions and implementations --- idl/BLSURFPlugin_Algorithm.idl | 26 +++++ src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 7 -- .../BLSURFPlugin_Hypothesis_i.cxx | 108 ++++++++++++++++++ .../BLSURFPlugin_Hypothesis_i.hxx | 12 ++ 4 files changed, 146 insertions(+), 7 deletions(-) diff --git a/idl/BLSURFPlugin_Algorithm.idl b/idl/BLSURFPlugin_Algorithm.idl index ddfdeca..10ec2f0 100644 --- a/idl/BLSURFPlugin_Algorithm.idl +++ b/idl/BLSURFPlugin_Algorithm.idl @@ -211,6 +211,32 @@ module BLSURFPlugin void SetVerbosity(in short theVal) raises (SALOME::SALOME_Exception); short GetVerbosity(); + /*! + * To optimize the CAD (merges edges and removes nano edges). + */ + void SetPreCADOptimCAD(in boolean toOptimizeCAD); + boolean GetPreCADOptimCAD(); + + /*! + * To compute topology from scratch + */ + void SetPreCADDiscardInput(in boolean toDiscardInput); + boolean GetPreCADDiscardInput(); + + /*! + * To help PreCAD treat some very dirty cases. + * If the treated object is manifold. + */ + void SetPreCADManifoldGeom(in boolean manifold); + boolean GetPreCADManifoldGeom(); + + /*! + * To help PreCAD treat some very dirty cases. + * If the object is also closed (imagine a shell). + */ + void SetPreCADClosedGeom(in boolean closed); + boolean GetPreCADClosedGeom(); + /*! * Sets advanced option value */ diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 8a10a63..b15b2c5 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -741,13 +741,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, precad_set_param(pcs, "discard_input_topology", _precadDiscardInput ? "1" : "0"); precad_set_param(pcs, "manifold_geometry", _precadManifoldGeom ? "1" : "0"); precad_set_param(pcs, "closed_geometry", _precadClosedGeom ? "1" : "0"); - /* - precad_set_param(pcs, "merge_edges", "0"); - precad_set_param(pcs, "remove_nano_edges", "0"); - precad_set_param(pcs, "discard_input_topology", "0"); - precad_set_param(pcs, "manifold_geometry", "0"); - precad_set_param(pcs, "closed_geometry", "0"); - */ } _smp_phy_size = _phySize; diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 78898fe..882e698 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -370,6 +370,114 @@ CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() { return (CORBA::Short) this->GetImpl()->GetVerbosity(); } +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD + * + * Set true or false + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD"); + ASSERT(myBaseImpl); + this->GetImpl()->SetPreCADOptimCAD(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADOptimCAD( " << theValue << " )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD + * + * Get true or false + */ +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetPreCADOptimCAD(); +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput + * + * Set true or false + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput"); + ASSERT(myBaseImpl); + this->GetImpl()->SetPreCADDiscardInput(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValue << " )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput + * + * Get true or false + */ +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetPreCADDiscardInput(); +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom + * + * Set true or false + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom"); + ASSERT(myBaseImpl); + this->GetImpl()->SetPreCADManifoldGeom(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADManifoldGeom( " << theValue << " )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom + * + * Get true or false + */ +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetPreCADManifoldGeom(); +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom + * + * Set true or false + */ +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom"); + ASSERT(myBaseImpl); + this->GetImpl()->SetPreCADClosedGeom(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADClosedGeom( " << theValue << " )"; +} + +//============================================================================= +/*! + * BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom + * + * Get true or false + */ +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetPreCADClosedGeom(); +} + //============================================================================= void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index 60692a2..f4f8ecb 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -87,6 +87,18 @@ public: void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception); CORBA::Short GetVerbosity(); + void SetPreCADOptimCAD(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADOptimCAD(); + + void SetPreCADDiscardInput(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADDiscardInput(); + + void SetPreCADManifoldGeom(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADManifoldGeom(); + + void SetPreCADClosedGeom(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADClosedGeom(); + void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception); char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception); -- 2.39.2