mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-22 15:55:38 +05:00
Fix memory leaks
This commit is contained in:
parent
7b409949c0
commit
ba2aa33a1e
@ -477,11 +477,12 @@ bool BlocksGUI_BlockDlg::execute (ObjectList& objects)
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
|
|
||||||
switch (getConstructorId()) {
|
switch (getConstructorId()) {
|
||||||
case 0:
|
case 0:
|
||||||
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2)) {
|
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2)) {
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeHexa2Faces(myFace1, myFace2);
|
||||||
MakeHexa2Faces(myFace1, myFace2);
|
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -489,8 +490,7 @@ bool BlocksGUI_BlockDlg::execute (ObjectList& objects)
|
|||||||
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2) &&
|
if (!CORBA::is_nil(myFace1) && !CORBA::is_nil(myFace2) &&
|
||||||
!CORBA::is_nil(myFace3) && !CORBA::is_nil(myFace4) &&
|
!CORBA::is_nil(myFace3) && !CORBA::is_nil(myFace4) &&
|
||||||
!CORBA::is_nil(myFace5) && !CORBA::is_nil(myFace6)) {
|
!CORBA::is_nil(myFace5) && !CORBA::is_nil(myFace6)) {
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeHexa(myFace1, myFace2, myFace3, myFace4, myFace5, myFace6);
|
||||||
MakeHexa(myFace1, myFace2, myFace3, myFace4, myFace5, myFace6);
|
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -332,8 +332,8 @@ void BlocksGUI_ExplodeDlg::updateButtonState()
|
|||||||
myGrp1->TextBrowser1->setText( "" );
|
myGrp1->TextBrowser1->setText( "" );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bool isOnlyBlocks = GEOM::GEOM_IBlocksOperations::_narrow
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
( getOperation() )->IsCompoundOfBlocks( myObject,
|
bool isOnlyBlocks = anOper->IsCompoundOfBlocks( myObject,
|
||||||
myGrp1->SpinBox1->value(),
|
myGrp1->SpinBox1->value(),
|
||||||
myGrp1->SpinBox2->value(),
|
myGrp1->SpinBox2->value(),
|
||||||
myNbBlocks );
|
myNbBlocks );
|
||||||
@ -401,10 +401,11 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
GEOM::ListOfGO_var aList;
|
GEOM::ListOfGO_var aList;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0:
|
case 0:
|
||||||
aList = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->ExplodeCompoundOfBlocks
|
aList = anOper->ExplodeCompoundOfBlocks( myObject,
|
||||||
( myObject,
|
|
||||||
myGrp1->SpinBox1->value(),
|
myGrp1->SpinBox1->value(),
|
||||||
myGrp1->SpinBox2->value() );
|
myGrp1->SpinBox2->value() );
|
||||||
break;
|
break;
|
||||||
@ -452,7 +453,7 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
|
|||||||
if ( selected.contains( QString( objStr.in() ) ) )
|
if ( selected.contains( QString( objStr.in() ) ) )
|
||||||
{
|
{
|
||||||
if ( !IsPreview() )
|
if ( !IsPreview() )
|
||||||
(*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
(*anIter)->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
objects.push_back( *anIter );
|
objects.push_back( *anIter );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -472,7 +473,7 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] );
|
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] );
|
||||||
if ( !IsPreview() )
|
if ( !IsPreview() )
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,8 @@ bool BlocksGUI_PropagateDlg::isValid( QString& )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool BlocksGUI_PropagateDlg::execute( ObjectList& objects )
|
bool BlocksGUI_PropagateDlg::execute( ObjectList& objects )
|
||||||
{
|
{
|
||||||
GEOM::ListOfGO_var aList = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->Propagate( myObject );
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
|
GEOM::ListOfGO_var aList = anOper->Propagate( myObject );
|
||||||
mainFrame()->ResultName->setText( "" );
|
mainFrame()->ResultName->setText( "" );
|
||||||
|
|
||||||
if ( !aList->length() )
|
if ( !aList->length() )
|
||||||
|
@ -532,20 +532,19 @@ bool BlocksGUI_QuadFaceDlg::execute (ObjectList& objects)
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
|
|
||||||
switch (getConstructorId()) {
|
switch (getConstructorId()) {
|
||||||
case 0:
|
case 0:
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeQuad4Vertices(myShape1, myShape2, myShape3, myShape4);
|
||||||
MakeQuad4Vertices(myShape1, myShape2, myShape3, myShape4);
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeQuad2Edges(myShape1, myShape2);
|
||||||
MakeQuad2Edges(myShape1, myShape2);
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeQuad(myShape1, myShape2, myShape3, myShape4);
|
||||||
MakeQuad(myShape1, myShape2, myShape3, myShape4);
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -576,10 +576,11 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
|
||||||
|
|
||||||
switch (getConstructorId()) {
|
switch (getConstructorId()) {
|
||||||
case 0:
|
case 0:
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeMultiTransformation1D(myShape,
|
||||||
MakeMultiTransformation1D(myShape,
|
|
||||||
myFaces[Face1], myFaces[Face2],
|
myFaces[Face1], myFaces[Face2],
|
||||||
mySpinBox[SpinBox1]->value());
|
mySpinBox[SpinBox1]->value());
|
||||||
if (!anObj->_is_nil() && !IsPreview())
|
if (!anObj->_is_nil() && !IsPreview())
|
||||||
@ -587,13 +588,12 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
|
|||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << "" << "";
|
aParameters << "" << "";
|
||||||
aParameters << mySpinBox[SpinBox1]->text();
|
aParameters << mySpinBox[SpinBox1]->text();
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
}
|
}
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
|
anObj = anOper->MakeMultiTransformation2D (myShape,
|
||||||
MakeMultiTransformation2D (myShape,
|
|
||||||
myFaces[Face1U], myFaces[Face2U],
|
myFaces[Face1U], myFaces[Face2U],
|
||||||
mySpinBox[SpinBox2U]->value(),
|
mySpinBox[SpinBox2U]->value(),
|
||||||
myFaces[Face1V], myFaces[Face2V],
|
myFaces[Face1V], myFaces[Face2V],
|
||||||
@ -605,7 +605,7 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
|
|||||||
aParameters << mySpinBox[SpinBox2U]->text();
|
aParameters << mySpinBox[SpinBox2U]->text();
|
||||||
aParameters << "" << "";
|
aParameters << "" << "";
|
||||||
aParameters << mySpinBox[SpinBox2V]->text();
|
aParameters << mySpinBox[SpinBox2V]->text();
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
}
|
}
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
|
@ -329,8 +329,8 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects)
|
|||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
|
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
|
||||||
MakeBoolean(myObject1, myObject2, myOperation);
|
anObj = anOper->MakeBoolean(myObject1, myObject2, myOperation);
|
||||||
if (!anObj->_is_nil())
|
if (!anObj->_is_nil())
|
||||||
objects.push_back(anObj._retn());
|
objects.push_back(anObj._retn());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user