From d8c160ee270e9ffa09ef77bafbfd502cb9322217 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 28 Jun 2011 13:00:19 +0000 Subject: [PATCH] Create StdMeshers_QuadrangleParams hyp instead of "Quadrangle preference" and "Triangle preference" obsolete hypotheses --- src/StdMeshers_I/StdMeshers_i.cxx | 33 +++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/StdMeshers_I/StdMeshers_i.cxx b/src/StdMeshers_I/StdMeshers_i.cxx index 510cc91d1..a8274ffb4 100644 --- a/src/StdMeshers_I/StdMeshers_i.cxx +++ b/src/StdMeshers_I/StdMeshers_i.cxx @@ -40,8 +40,8 @@ #include "StdMeshers_Deflection1D_i.hxx" #include "StdMeshers_Propagation_i.hxx" #include "StdMeshers_LengthFromEdges_i.hxx" -#include "StdMeshers_QuadranglePreference_i.hxx" -#include "StdMeshers_TrianglePreference_i.hxx" +//#include "StdMeshers_QuadranglePreference_i.hxx" +//#include "StdMeshers_TrianglePreference_i.hxx" #include "StdMeshers_QuadraticMesh_i.hxx" #include "StdMeshers_MaxElementArea_i.hxx" #include "StdMeshers_MaxElementVolume_i.hxx" @@ -75,10 +75,33 @@ template class StdHypothesisCreator_i:public HypothesisCreator_i { +public: // as we have 'module StdMeshers' in SMESH_BasicHypothesis.idl virtual std::string GetModuleName() { return "StdMeshers"; } }; +//============================================================================= +/*! + * \brief Creates StdMeshers_QuadrangleParams_i instead of + * StdMeshers_TrianglePreference_i and StdMeshers_QuadranglePreference_i + */ +//============================================================================= + +template +class QuadrangleParamsCreator : public StdHypothesisCreator_i +{ +public: + virtual SMESH_Hypothesis_i* Create (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl) + { + StdMeshers_QuadrangleParams_i* h = + new StdMeshers_QuadrangleParams_i( thePOA, theStudyId, theGenImpl); + h->SetQuadType( TYPE ); + return h; + } +}; + //============================================================================= /*! * @@ -122,9 +145,11 @@ STDMESHERS_I_EXPORT else if (strcmp(aHypName, "AutomaticLength") == 0) aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "QuadranglePreference") == 0) - aCreator = new StdHypothesisCreator_i; + //aCreator = new StdHypothesisCreator_i; + aCreator = new QuadrangleParamsCreator< StdMeshers::QUAD_QUADRANGLE_PREF >(); else if (strcmp(aHypName, "TrianglePreference") == 0) - aCreator = new StdHypothesisCreator_i; + //aCreator = new StdHypothesisCreator_i; + aCreator = new QuadrangleParamsCreator< StdMeshers::QUAD_TRIANGLE_PREF >(); else if (strcmp(aHypName, "QuadraticMesh") == 0) aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "ProjectionSource3D") == 0) -- 2.39.2