This commit is contained in:
eap 2010-01-26 07:16:30 +00:00
parent 10fc3eb3e0
commit fc79403acc
8 changed files with 62 additions and 62 deletions

View File

@ -260,10 +260,10 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromHypo( NetgenHypothesisData
if ( myIs2D ) if ( myIs2D )
{ {
NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d = NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d =
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( initParamsHypothesis() ); NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( initParamsHypothesis() );
if ( !h_2d->_is_nil() ) if ( !h_2d->_is_nil() )
h_data.myAllowQuadrangles = h_2d->GetQuadAllowed(); h_data.myAllowQuadrangles = h_2d->GetQuadAllowed();
} }
return true; return true;
@ -289,9 +289,9 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
if( fineness==UserDefined ) if( fineness==UserDefined )
{ {
h->SetGrowthRate( h_data.myGrowthRate ); h->SetGrowthRate( h_data.myGrowthRate );
h->SetNbSegPerEdge( h_data.myNbSegPerEdge ); h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
h->SetNbSegPerRadius( h_data.myNbSegPerRadius ); h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
aVariablesList.append(h_data.myGrowthRateVar); aVariablesList.append(h_data.myGrowthRateVar);
aVariablesList.append(h_data.myNbSegPerEdgeVar); aVariablesList.append(h_data.myNbSegPerEdgeVar);
@ -300,11 +300,11 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
if ( myIs2D ) if ( myIs2D )
{ {
NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d = NETGENPlugin::NETGENPlugin_Hypothesis_2D_var h_2d =
NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h ); NETGENPlugin::NETGENPlugin_Hypothesis_2D::_narrow( h );
if ( !h_2d->_is_nil() ) if ( !h_2d->_is_nil() )
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles ); h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
} }
h->SetParameters(aVariablesList.join(":").toLatin1().constData()); h->SetParameters(aVariablesList.join(":").toLatin1().constData());
@ -360,34 +360,34 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
double aGrowthRate, aNbSegPerEdge, aNbSegPerRadius; double aGrowthRate, aNbSegPerEdge, aNbSegPerRadius;
switch ( myFineness->currentIndex() ) switch ( myFineness->currentIndex() )
{ {
case VeryCoarse: case VeryCoarse:
aGrowthRate = 0.7; aGrowthRate = 0.7;
aNbSegPerEdge = 0.3; aNbSegPerEdge = 0.3;
aNbSegPerRadius = 1; aNbSegPerRadius = 1;
break; break;
case Coarse: case Coarse:
aGrowthRate = 0.5; aGrowthRate = 0.5;
aNbSegPerEdge = 0.5; aNbSegPerEdge = 0.5;
aNbSegPerRadius = 1.5; aNbSegPerRadius = 1.5;
break; break;
case Fine: case Fine:
aGrowthRate = 0.2; aGrowthRate = 0.2;
aNbSegPerEdge = 2; aNbSegPerEdge = 2;
aNbSegPerRadius = 3; aNbSegPerRadius = 3;
break; break;
case VeryFine: case VeryFine:
aGrowthRate = 0.1; aGrowthRate = 0.1;
aNbSegPerEdge = 3; aNbSegPerEdge = 3;
aNbSegPerRadius = 5; aNbSegPerRadius = 5;
break; break;
case Moderate: case Moderate:
default: default:
aGrowthRate = 0.3; aGrowthRate = 0.3;
aNbSegPerEdge = 1; aNbSegPerEdge = 1;
aNbSegPerRadius = 2; aNbSegPerRadius = 2;
break; break;
} }
myGrowthRate->setValue( aGrowthRate ); myGrowthRate->setValue( aGrowthRate );
myNbSegPerEdge->setValue( aNbSegPerEdge ); myNbSegPerEdge->setValue( aNbSegPerEdge );

View File

@ -50,7 +50,7 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus); SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap); MapShapeNbElems& aResMap);

View File

@ -141,8 +141,8 @@ bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh,
//============================================================================= //=============================================================================
bool NETGENPlugin_NETGEN_2D3D::Evaluate(SMESH_Mesh& aMesh, bool NETGENPlugin_NETGEN_2D3D::Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap) MapShapeNbElems& aResMap)
{ {
NETGENPlugin_Mesher mesher(&aMesh, aShape, true); NETGENPlugin_Mesher mesher(&aMesh, aShape, true);
mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis)); mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis));

View File

@ -50,11 +50,11 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus); SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh& aMesh, virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap); MapShapeNbElems& aResMap);
protected: protected:
const SMESHDS_Hypothesis* _hypothesis; const SMESHDS_Hypothesis* _hypothesis;

View File

@ -38,8 +38,8 @@
//============================================================================= //=============================================================================
NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA, NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA,
int theStudyId, int theStudyId,
::SMESH_Gen* theGenImpl ) ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ), : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ), SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ), SMESH_Algo_i( thePOA ),

View File

@ -75,7 +75,7 @@ using namespace std;
//============================================================================= //=============================================================================
NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId, NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId,
SMESH_Gen* gen) SMESH_Gen* gen)
: SMESH_3D_Algo(hypId, studyId, gen) : SMESH_3D_Algo(hypId, studyId, gen)
{ {
MESSAGE("NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D"); MESSAGE("NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D");
@ -616,8 +616,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
{ {
Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point ); Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0], SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0],
Netgen_point[1], Netgen_point[1],
Netgen_point[2]); Netgen_point[2]);
nodeVec.at(nodeIndex) = node; nodeVec.at(nodeIndex) = node;
} }
@ -626,9 +626,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
{ {
Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron); Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron);
aHelper->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ), aHelper->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ),
nodeVec.at( Netgen_tetrahedron[1] ), nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ), nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] )); nodeVec.at( Netgen_tetrahedron[3] ));
} }
} }
@ -648,8 +648,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
//============================================================================= //=============================================================================
bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh, bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap) MapShapeNbElems& aResMap)
{ {
int nbtri = 0, nbqua = 0; int nbtri = 0, nbqua = 0;
double fullArea = 0.0; double fullArea = 0.0;
@ -686,7 +686,7 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
if( anIt==aResMap.end() ) { if( anIt==aResMap.end() ) {
SMESH_ComputeErrorPtr& smError = aSubMesh->GetComputeError(); SMESH_ComputeErrorPtr& smError = aSubMesh->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED, smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
"Submesh can not be evaluated",this)); "Submesh can not be evaluated",this));
return false; return false;
} }
std::vector<int> aVec = (*anIt).second; std::vector<int> aVec = (*anIt).second;

View File

@ -49,14 +49,14 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus); SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape); const TopoDS_Shape& aShape);
virtual bool Compute(SMESH_Mesh& aMesh, virtual bool Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper); SMESH_MesherHelper* aHelper);
virtual bool Evaluate(SMESH_Mesh& aMesh, virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap); MapShapeNbElems& aResMap);
protected: protected:
double _maxElementVolume; double _maxElementVolume;

View File

@ -43,8 +43,8 @@ using namespace std;
//============================================================================= //=============================================================================
NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA, NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId, int theStudyId,
::SMESH_Gen* theGenImpl ) ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ), : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ), SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ), SMESH_Algo_i( thePOA ),
@ -52,8 +52,8 @@ NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr theP
{ {
MESSAGE( "NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i" ); MESSAGE( "NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i" );
myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(), myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(),
theStudyId, theStudyId,
theGenImpl ); theGenImpl );
} }
//============================================================================= //=============================================================================