// File : SMESHGUI.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SMESH includes
-//
+
#include "SMESHGUI.h"
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI_TransparencyDlg.h"
/* Warning : however by internal mechanism all subMeshes icons are changed ! */
if ( !aHypothesis->_is_nil() )
{
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
- if (aCreator)
+ // BUG 0020378
+ //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
+ SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
+ if (aCreator) {
aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() );
+ }
else
{
// report error
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
+
// SMESH includes
-//
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI.h"
THypothesisDataMap myHypothesesMap;
THypothesisDataMap myAlgorithmsMap;
- typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
- THypCreatorMap myHypCreatorMap;
+ // BUG 0020378
+ //typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
+ //THypCreatorMap myHypCreatorMap;
QList<HypothesesSet*> myListOfHypothesesSets;
return false;
}
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const QString& aHypType)
+ HypothesisCreatorPtr GetHypothesisCreator(const QString& aHypType)
{
if(MYDEBUG) MESSAGE("Get HypothesisCreator for " << aHypType.toLatin1().data());
SMESHGUI_GenericHypothesisCreator* aCreator = 0;
// check, if creator for this hypothesis type already exists
- if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
- aCreator = myHypCreatorMap[aHypType];
- }
- else {
+ // BUG 0020378
+ //if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
+ // aCreator = myHypCreatorMap[aHypType];
+ //}
+ //else
+ {
// 1. Init list of available hypotheses, if needed
InitAvailableHypotheses();
// 2. Get names of plugin libraries
HypothesisData* aHypData = GetHypothesisData(aHypType);
if (!aHypData)
- return aCreator;
+ return HypothesisCreatorPtr(aCreator);
QString aClientLibName = aHypData->ClientLibName;
QString aServerLibName = aHypData->ServerLibName;
}
else {
// map hypothesis creator to a hypothesis name
- myHypCreatorMap[aHypType] = aCreator;
+ // BUG 0020378
+ //myHypCreatorMap[aHypType] = aCreator;
}
}
}
}
}
- return aCreator;
+ return HypothesisCreatorPtr(aCreator);
}
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
-//
+
#ifndef SMESHGUI_HYPOTHESESUTILS_H
#define SMESHGUI_HYPOTHESESUTILS_H
// STL includes
#include <vector>
+// boost includes
+#include <boost/shared_ptr.hpp>
+
class HypothesisData;
class HypothesesSet;
class SMESHGUI_GenericHypothesisCreator;
namespace SMESH
{
+ typedef boost::shared_ptr<SMESHGUI_GenericHypothesisCreator> HypothesisCreatorPtr;
+
SMESHGUI_EXPORT
void InitAvailableHypotheses();
const HypothesisData* );
SMESHGUI_EXPORT
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
+ HypothesisCreatorPtr GetHypothesisCreator( const QString& );
SMESHGUI_EXPORT
SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,
- const QString&,
- const bool = false);
+ const QString&,
+ const bool = false );
SMESHGUI_EXPORT
bool AddHypothesisOnMesh( SMESH::SMESH_Mesh_ptr, SMESH::SMESH_Hypothesis_ptr );
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshOp.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
+
// SMESH includes
-//
#include "SMESHGUI_MeshOp.h"
#include "SMESHGUI.h"
SMESH::CreateHypothesis(theTypeName, aHypName, false);
} else {
// Get hypotheses creator client (GUI)
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
+ // BUG 0020378
+ //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
+ SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(theTypeName);
// Create hypothesis
if (aCreator) {
if ( aHyp->_is_nil() )
return;
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aHyp->GetName() );
+ // BUG 0020378
+ //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
+ SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
if ( aCreator )
{
// Get initial parameters
SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
} else {
// Get hypotheses creator client (GUI)
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
+ // BUG 0020378
+ //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
+ SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypName);
// Create algorithm
- if (aCreator)
+ if (aCreator) {
aCreator->create(true, aHypName, myDlg);
+ }
else
SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
}
return;
CORBA::String_var hypType = myHyp->GetName();
- SMESHGUI_GenericHypothesisCreator*
- editor = SMESH::GetHypothesisCreator( hypType.in() );
+ // BUG 0020378
+ //SMESHGUI_GenericHypothesisCreator* editor = SMESH::GetHypothesisCreator(hypType.in());
+ SMESH::HypothesisCreatorPtr editor = SMESH::GetHypothesisCreator(hypType.in());
if ( !editor ) return;
if ( myDlg ) myDlg->hide();