mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-19 00:10:37 +05:00
Fix memory leaks
This commit is contained in:
parent
f65909a2fb
commit
7b409949c0
@ -571,11 +571,13 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
|
|||||||
bool res = false;
|
bool res = false;
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArc( myPoint1, myPoint2, myPoint3 );
|
anObj = anOper->MakeArc( myPoint1, myPoint2, myPoint3 );
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -584,7 +586,7 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
bool Sense = Group3Pnts2->CheckButton1->isChecked();
|
bool Sense = Group3Pnts2->CheckButton1->isChecked();
|
||||||
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArcCenter( myPoint1, myPoint2, myPoint3, Sense );
|
anObj = anOper->MakeArcCenter( myPoint1, myPoint2, myPoint3, Sense );
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -592,7 +594,7 @@ bool BasicGUI_ArcDlg::execute( ObjectList& objects )
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
if ( !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) ) {
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArcOfEllipse( myPoint1, myPoint2, myPoint3 );
|
anObj = anOper->MakeArcOfEllipse( myPoint1, myPoint2, myPoint3 );
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -643,23 +643,25 @@ bool BasicGUI_CircleDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
{
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << GroupPntVecR->SpinBox_DX->text();
|
aParameters << GroupPntVecR->SpinBox_DX->text();
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() );
|
anObj = anOper->MakeCirclePntVecR( myPoint, myDir, getRadius() );
|
||||||
if ( !anObj->_is_nil() && !IsPreview() )
|
if ( !anObj->_is_nil() && !IsPreview() )
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1 :
|
case 1 :
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCircleThreePnt( myPoint1, myPoint2, myPoint3 );
|
anObj = anOper->MakeCircleThreePnt( myPoint1, myPoint2, myPoint3 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCircleCenter2Pnt( myPoint4, myPoint5, myPoint6 );
|
anObj = anOper->MakeCircleCenter2Pnt( myPoint4, myPoint5, myPoint6 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -439,18 +439,19 @@ bool BasicGUI_CurveDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakePolyline( myPoints );
|
anObj = anOper->MakePolyline( myPoints );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeSplineBezier( myPoints );
|
anObj = anOper->MakeSplineBezier( myPoints );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->
|
anObj = anOper->MakeSplineInterpolation( myPoints, GroupPoints->CheckButton1->isChecked() );
|
||||||
MakeSplineInterpolation( myPoints, GroupPoints->CheckButton1->isChecked() );
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -459,12 +459,13 @@ bool BasicGUI_EllipseDlg::execute( ObjectList& objects )
|
|||||||
aParameters<<GroupPoints->SpinBox_DX->text();
|
aParameters<<GroupPoints->SpinBox_DX->text();
|
||||||
aParameters<<GroupPoints->SpinBox_DY->text();
|
aParameters<<GroupPoints->SpinBox_DY->text();
|
||||||
|
|
||||||
|
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
|
||||||
GEOM::GEOM_Object_var anObj = myMajor->_is_nil() ?
|
GEOM::GEOM_Object_var anObj = myMajor->_is_nil() ?
|
||||||
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse ( myPoint, myDir, aMajorR, aMinorR ) :
|
anOper->MakeEllipse ( myPoint, myDir, aMajorR, aMinorR ) :
|
||||||
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipseVec( myPoint, myDir, aMajorR, aMinorR, myMajor );
|
anOper->MakeEllipseVec( myPoint, myDir, aMajorR, aMinorR, myMajor );
|
||||||
if ( !anObj->_is_nil() ) {
|
if ( !anObj->_is_nil() ) {
|
||||||
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() );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -448,13 +448,14 @@ bool BasicGUI_LineDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeLineTwoPnt( myPoint1, myPoint2 );
|
anObj = anOper->MakeLineTwoPnt( myPoint1, myPoint2 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeLineTwoFaces( myFace1, myFace2 );
|
anObj = anOper->MakeLineTwoFaces( myFace1, myFace2 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -720,10 +720,16 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
|
bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IBasicOperations::_narrow(
|
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
||||||
getOperation() )->MakeMarker( myData[ X ]->value(), myData[ Y ]->value(), myData[ Z ]->value(),
|
GEOM::GEOM_Object_var anObj = anOper->MakeMarker( myData[ X ]->value(),
|
||||||
myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value(),
|
myData[ Y ]->value(),
|
||||||
myData[ DX2 ]->value(), myData[ DY2 ]->value(), myData[ DZ2 ]->value() );
|
myData[ Z ]->value(),
|
||||||
|
myData[ DX1 ]->value(),
|
||||||
|
myData[ DY1 ]->value(),
|
||||||
|
myData[ DZ1 ]->value(),
|
||||||
|
myData[ DX2 ]->value(),
|
||||||
|
myData[ DY2 ]->value(),
|
||||||
|
myData[ DZ2 ]->value() );
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters<<myData[X]->text();
|
aParameters<<myData[X]->text();
|
||||||
aParameters<<myData[Y]->text();
|
aParameters<<myData[Y]->text();
|
||||||
@ -737,7 +743,7 @@ bool BasicGUI_MarkerDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
if ( !anObj->_is_nil() ) {
|
if ( !anObj->_is_nil() ) {
|
||||||
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() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,25 +788,27 @@ bool BasicGUI_PlaneDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlanePntVec( myPoint, myDir, getSize() );
|
anObj = anOper->MakePlanePntVec( myPoint, myDir, getSize() );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 1 :
|
case 1 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlaneThreePnt( myPoint1, myPoint2, myPoint3, getSize() );
|
anObj = anOper->MakePlaneThreePnt( myPoint1, myPoint2, myPoint3, getSize() );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 2 :
|
case 2 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlaneFace( myFace, getSize() );
|
anObj = anOper->MakePlaneFace( myFace, getSize() );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 3 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlane2Vec( myVec1, myVec2, getSize() );
|
anObj = anOper->MakePlane2Vec( myVec1, myVec2, getSize() );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case 4 :
|
case 4 :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePlaneLCS( myLCS, getSize(), myOriginType );
|
anObj = anOper->MakePlaneLCS( myLCS, getSize(), myOriginType );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -55,11 +55,11 @@
|
|||||||
#define PARAM_VALUE 0
|
#define PARAM_VALUE 0
|
||||||
#define COORD_VALUE 1
|
#define COORD_VALUE 1
|
||||||
|
|
||||||
#define POINT_XYZ 0
|
#define GEOM_POINT_XYZ 0
|
||||||
#define POINT_REF 1
|
#define GEOM_POINT_REF 1
|
||||||
#define POINT_EDGE 2
|
#define GEOM_POINT_EDGE 2
|
||||||
#define POINT_INTINT 3
|
#define GEOM_POINT_INTINT 3
|
||||||
#define POINT_SURF 4
|
#define GEOM_POINT_SURF 4
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -310,7 +310,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
globalSelection(); // close local contexts, if any
|
globalSelection(); // close local contexts, if any
|
||||||
|
|
||||||
switch ( constructorId ) {
|
switch ( constructorId ) {
|
||||||
case POINT_XYZ:
|
case GEOM_POINT_XYZ:
|
||||||
{
|
{
|
||||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
GroupXYZ->show();
|
GroupXYZ->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_REF:
|
case GEOM_POINT_REF:
|
||||||
{
|
{
|
||||||
myEditCurrentArgument = GroupRefPoint->LineEdit1;
|
myEditCurrentArgument = GroupRefPoint->LineEdit1;
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
@ -346,7 +346,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
myCoordGrp->show();
|
myCoordGrp->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_EDGE:
|
case GEOM_POINT_EDGE:
|
||||||
{
|
{
|
||||||
myEditCurrentArgument = GroupOnCurve->LineEdit1;
|
myEditCurrentArgument = GroupOnCurve->LineEdit1;
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
@ -366,7 +366,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
updateParamCoord( false );
|
updateParamCoord( false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_INTINT:
|
case GEOM_POINT_INTINT:
|
||||||
{
|
{
|
||||||
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
|
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
|
||||||
GroupLineIntersection->LineEdit1->setText( "" );
|
GroupLineIntersection->LineEdit1->setText( "" );
|
||||||
@ -392,7 +392,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
|
|||||||
GroupLineIntersection->show();
|
GroupLineIntersection->show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_SURF:
|
case GEOM_POINT_SURF:
|
||||||
{
|
{
|
||||||
myEditCurrentArgument = GroupOnSurface->LineEdit1;
|
myEditCurrentArgument = GroupOnSurface->LineEdit1;
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
@ -460,7 +460,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
|
|
||||||
if ( ( id == POINT_REF || id == POINT_EDGE || id == POINT_SURF ) && myEditCurrentArgument != 0 )
|
if ( ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) && myEditCurrentArgument != 0 )
|
||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
myX->setText( "" );
|
myX->setText( "" );
|
||||||
@ -482,9 +482,9 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
if ( id == POINT_EDGE || id == POINT_INTINT )
|
if ( id == GEOM_POINT_EDGE || id == GEOM_POINT_INTINT )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
else if ( id == POINT_SURF )
|
else if ( id == GEOM_POINT_SURF )
|
||||||
aNeedType = TopAbs_FACE;
|
aNeedType = TopAbs_FACE;
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
@ -513,7 +513,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
if ( aShape.ShapeType() != aNeedType ) {
|
if ( aShape.ShapeType() != aNeedType ) {
|
||||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
aName = "";
|
aName = "";
|
||||||
if ( id == POINT_XYZ ) return;
|
if ( id == GEOM_POINT_XYZ ) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -521,21 +521,21 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
if ( aShape.IsNull() || aShape.ShapeType() != aNeedType)
|
if ( aShape.IsNull() || aShape.ShapeType() != aNeedType)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( id == POINT_XYZ ) {
|
if ( id == GEOM_POINT_XYZ ) {
|
||||||
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
|
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
|
||||||
GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
|
GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
|
||||||
GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
|
GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
|
||||||
GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
|
GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
|
||||||
}
|
}
|
||||||
else if ( id == POINT_REF ) {
|
else if ( id == GEOM_POINT_REF ) {
|
||||||
myRefPoint = aSelectedObject;
|
myRefPoint = aSelectedObject;
|
||||||
GroupRefPoint->LineEdit1->setText( aName );
|
GroupRefPoint->LineEdit1->setText( aName );
|
||||||
}
|
}
|
||||||
else if ( id == POINT_EDGE ) {
|
else if ( id == GEOM_POINT_EDGE ) {
|
||||||
myEdge = aSelectedObject;
|
myEdge = aSelectedObject;
|
||||||
GroupOnCurve->LineEdit1->setText( aName );
|
GroupOnCurve->LineEdit1->setText( aName );
|
||||||
}
|
}
|
||||||
else if ( id == POINT_INTINT ) {
|
else if ( id == GEOM_POINT_INTINT ) {
|
||||||
myEditCurrentArgument->setText( aName );
|
myEditCurrentArgument->setText( aName );
|
||||||
globalSelection();
|
globalSelection();
|
||||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||||
@ -550,7 +550,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
GroupLineIntersection->PushButton1->click();
|
GroupLineIntersection->PushButton1->click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( id == POINT_SURF )
|
else if ( id == GEOM_POINT_SURF )
|
||||||
{
|
{
|
||||||
myFace = aSelectedObject;
|
myFace = aSelectedObject;
|
||||||
GroupOnSurface->LineEdit1->setText( aName );
|
GroupOnSurface->LineEdit1->setText( aName );
|
||||||
@ -710,7 +710,7 @@ double BasicGUI_PointDlg::getVParameter() const
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
|
void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
|
||||||
{
|
{
|
||||||
if ( getConstructorId() == POINT_XYZ ) {
|
if ( getConstructorId() == GEOM_POINT_XYZ ) {
|
||||||
GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
|
GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
|
||||||
GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
|
GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
|
||||||
GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
|
GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
|
||||||
@ -735,14 +735,14 @@ GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
|
|||||||
bool BasicGUI_PointDlg::isValid( QString& msg )
|
bool BasicGUI_PointDlg::isValid( QString& msg )
|
||||||
{
|
{
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
if ( id == POINT_XYZ ) {
|
if ( id == GEOM_POINT_XYZ ) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
||||||
ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
|
||||||
ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
else if ( id == POINT_REF ) {
|
else if ( id == GEOM_POINT_REF ) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
||||||
ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
|
||||||
@ -750,7 +750,7 @@ bool BasicGUI_PointDlg::isValid( QString& msg )
|
|||||||
|
|
||||||
return !myRefPoint->_is_nil() && ok;
|
return !myRefPoint->_is_nil() && ok;
|
||||||
}
|
}
|
||||||
else if ( id == POINT_EDGE ) {
|
else if ( id == GEOM_POINT_EDGE ) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if ( myParamCoord->checkedId() == PARAM_VALUE )
|
if ( myParamCoord->checkedId() == PARAM_VALUE )
|
||||||
ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
|
ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
|
||||||
@ -761,9 +761,9 @@ bool BasicGUI_PointDlg::isValid( QString& msg )
|
|||||||
}
|
}
|
||||||
return !myEdge->_is_nil() && ok;
|
return !myEdge->_is_nil() && ok;
|
||||||
}
|
}
|
||||||
else if ( id == POINT_INTINT )
|
else if ( id == GEOM_POINT_INTINT )
|
||||||
return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
|
return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
|
||||||
else if ( id == POINT_SURF ) {
|
else if ( id == GEOM_POINT_SURF ) {
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
||||||
ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
|
||||||
@ -791,8 +791,10 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case POINT_XYZ :
|
case GEOM_POINT_XYZ :
|
||||||
{
|
{
|
||||||
double x = GroupXYZ->SpinBox_DX->value();
|
double x = GroupXYZ->SpinBox_DX->value();
|
||||||
double y = GroupXYZ->SpinBox_DY->value();
|
double y = GroupXYZ->SpinBox_DY->value();
|
||||||
@ -802,11 +804,11 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
aParameters << GroupXYZ->SpinBox_DY->text();
|
aParameters << GroupXYZ->SpinBox_DY->text();
|
||||||
aParameters << GroupXYZ->SpinBox_DZ->text();
|
aParameters << GroupXYZ->SpinBox_DZ->text();
|
||||||
|
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x, y, z );
|
anObj = anOper->MakePointXYZ( x, y, z );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_REF :
|
case GEOM_POINT_REF :
|
||||||
{
|
{
|
||||||
double dx = GroupRefPoint->SpinBox_DX->value();
|
double dx = GroupRefPoint->SpinBox_DX->value();
|
||||||
double dy = GroupRefPoint->SpinBox_DY->value();
|
double dy = GroupRefPoint->SpinBox_DY->value();
|
||||||
@ -816,17 +818,14 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
aParameters << GroupRefPoint->SpinBox_DY->text();
|
aParameters << GroupRefPoint->SpinBox_DY->text();
|
||||||
aParameters << GroupRefPoint->SpinBox_DZ->text();
|
aParameters << GroupRefPoint->SpinBox_DZ->text();
|
||||||
|
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
|
anObj = anOper->MakePointWithReference( myRefPoint, dx, dy, dz );
|
||||||
MakePointWithReference( myRefPoint, dx, dy, dz );
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_EDGE :
|
case GEOM_POINT_EDGE :
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IBasicOperations_ptr anOp =
|
|
||||||
GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
|
||||||
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
||||||
anObj = anOp->MakePointOnCurve( myEdge, getParameter() );
|
anObj = anOper->MakePointOnCurve( myEdge, getParameter() );
|
||||||
aParameters<<GroupOnCurve->SpinBox_DX->text();
|
aParameters<<GroupOnCurve->SpinBox_DX->text();
|
||||||
} else {
|
} else {
|
||||||
double x = GroupXYZ->SpinBox_DX->value();
|
double x = GroupXYZ->SpinBox_DX->value();
|
||||||
@ -837,22 +836,19 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
aParameters << GroupXYZ->SpinBox_DY->text();
|
aParameters << GroupXYZ->SpinBox_DY->text();
|
||||||
aParameters << GroupXYZ->SpinBox_DZ->text();
|
aParameters << GroupXYZ->SpinBox_DZ->text();
|
||||||
|
|
||||||
anObj = anOp->MakePointOnCurveByCoord( myEdge, x, y, z );
|
anObj = anOper->MakePointOnCurveByCoord( myEdge, x, y, z );
|
||||||
}
|
}
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case POINT_INTINT :
|
case GEOM_POINT_INTINT :
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
|
anOper->MakePointOnLinesIntersection( myLine1, myLine2 );
|
||||||
MakePointOnLinesIntersection( myLine1, myLine2 );
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
case POINT_SURF :
|
case GEOM_POINT_SURF :
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IBasicOperations_ptr anOp =
|
|
||||||
GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
|
||||||
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
if ( myParamCoord->checkedId() == PARAM_VALUE ) {
|
||||||
anObj = anOp->MakePointOnSurface( myFace, getUParameter(), getVParameter() );
|
anObj = anOper->MakePointOnSurface( myFace, getUParameter(), getVParameter() );
|
||||||
aParameters<<GroupOnSurface->SpinBox_DX->text();
|
aParameters<<GroupOnSurface->SpinBox_DX->text();
|
||||||
aParameters<<GroupOnSurface->SpinBox_DY->text();
|
aParameters<<GroupOnSurface->SpinBox_DY->text();
|
||||||
} else {
|
} else {
|
||||||
@ -864,7 +860,7 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
aParameters << GroupXYZ->SpinBox_DY->text();
|
aParameters << GroupXYZ->SpinBox_DY->text();
|
||||||
aParameters << GroupXYZ->SpinBox_DZ->text();
|
aParameters << GroupXYZ->SpinBox_DZ->text();
|
||||||
|
|
||||||
anObj = anOp->MakePointOnSurfaceByCoord( myFace, x, y, z );
|
anObj = anOper->MakePointOnSurfaceByCoord( myFace, x, y, z );
|
||||||
}
|
}
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
@ -872,15 +868,15 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
if(!anObj->_is_nil() && !IsPreview() && (id == POINT_XYZ ||
|
if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ ||
|
||||||
id == POINT_REF ||
|
id == GEOM_POINT_REF ||
|
||||||
id == POINT_EDGE ||
|
id == GEOM_POINT_EDGE ||
|
||||||
id == POINT_SURF) ) {
|
id == GEOM_POINT_SURF) ) {
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( id == POINT_REF || id == POINT_EDGE || id == POINT_SURF ) {
|
if ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) {
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() &&
|
if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() &&
|
||||||
aShape.ShapeType() == TopAbs_VERTEX ) {
|
aShape.ShapeType() == TopAbs_VERTEX ) {
|
||||||
@ -912,19 +908,19 @@ void BasicGUI_PointDlg::addSubshapesToStudy()
|
|||||||
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
QMap<QString, GEOM::GEOM_Object_var> objMap;
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case POINT_XYZ:
|
case GEOM_POINT_XYZ:
|
||||||
break;
|
break;
|
||||||
case POINT_REF:
|
case GEOM_POINT_REF:
|
||||||
objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
|
objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
|
||||||
break;
|
break;
|
||||||
case POINT_EDGE:
|
case GEOM_POINT_EDGE:
|
||||||
objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
|
objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
|
||||||
break;
|
break;
|
||||||
case POINT_INTINT:
|
case GEOM_POINT_INTINT:
|
||||||
objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
|
objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
|
||||||
objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
|
objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
|
||||||
break;
|
break;
|
||||||
case POINT_SURF:
|
case GEOM_POINT_SURF:
|
||||||
objMap[GroupOnSurface->LineEdit1->text()] = myFace;
|
objMap[GroupOnSurface->LineEdit1->text()] = myFace;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -951,11 +947,11 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
|
|||||||
GroupXYZ->setShown( !isParam );
|
GroupXYZ->setShown( !isParam );
|
||||||
|
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
if ( id == POINT_EDGE ) {
|
if ( id == GEOM_POINT_EDGE ) {
|
||||||
GroupOnCurve->TextLabel2->setShown( isParam );
|
GroupOnCurve->TextLabel2->setShown( isParam );
|
||||||
GroupOnCurve->SpinBox_DX->setShown( isParam );
|
GroupOnCurve->SpinBox_DX->setShown( isParam );
|
||||||
}
|
}
|
||||||
else if ( id == POINT_SURF ) {
|
else if ( id == GEOM_POINT_SURF ) {
|
||||||
GroupOnSurface->TextLabel2->setShown( isParam );
|
GroupOnSurface->TextLabel2->setShown( isParam );
|
||||||
GroupOnSurface->TextLabel3->setShown( isParam );
|
GroupOnSurface->TextLabel3->setShown( isParam );
|
||||||
GroupOnSurface->SpinBox_DX->setShown( isParam );
|
GroupOnSurface->SpinBox_DX->setShown( isParam );
|
||||||
|
@ -476,10 +476,12 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects )
|
|||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
|
||||||
|
GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
|
||||||
|
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0 :
|
case 0 :
|
||||||
{
|
{
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorTwoPnt( myPoint1, myPoint2 );
|
anObj = anOper->MakeVectorTwoPnt( myPoint1, myPoint2 );
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -493,10 +495,10 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects )
|
|||||||
aParameters << GroupDimensions->SpinBox_DX->text();
|
aParameters << GroupDimensions->SpinBox_DX->text();
|
||||||
aParameters << GroupDimensions->SpinBox_DY->text();
|
aParameters << GroupDimensions->SpinBox_DY->text();
|
||||||
aParameters << GroupDimensions->SpinBox_DZ->text();
|
aParameters << GroupDimensions->SpinBox_DZ->text();
|
||||||
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorDXDYDZ( dx, dy, dz );
|
anObj = anOper->MakeVectorDXDYDZ( dx, dy, dz );
|
||||||
|
|
||||||
if ( !anObj->_is_nil() && !IsPreview() )
|
if ( !anObj->_is_nil() && !IsPreview() )
|
||||||
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
|
anObj->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
|
||||||
res = true;
|
res = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user