mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-24 16:30:35 +05:00
PAL7158: Multi translation/rotation has been enabled on sub-shapes
This commit is contained in:
parent
44c126ac12
commit
0315037434
@ -787,34 +787,34 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy
|
|||||||
* MultiTranslate1D
|
* MultiTranslate1D
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector, CORBA::Double theStep, CORBA::Long theNbTimes)
|
GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D
|
||||||
|
(GEOM::GEOM_Object_ptr theObject,
|
||||||
|
GEOM::GEOM_Object_ptr theVector,
|
||||||
|
CORBA::Double theStep, CORBA::Long theNbTimes)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aGEOMObject;
|
//Set a not done flag
|
||||||
|
|
||||||
//Set a not done flag
|
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
||||||
|
|
||||||
//check if the object is a subshape
|
//Get the object itself
|
||||||
if(!theObject->IsMainShape()) {
|
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
|
||||||
GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
|
(theObject->GetStudyID(), theObject->GetEntry());
|
||||||
return aGEOMObject._retn();
|
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
||||||
}
|
|
||||||
|
//Get the vector of translation
|
||||||
//Get the object itself
|
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject
|
||||||
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
|
(theVector->GetStudyID(), theVector->GetEntry());
|
||||||
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
if (aVector.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Get the vector of translation
|
//Perform the translation
|
||||||
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), theVector->GetEntry());
|
Handle(GEOM_Object) anObject =
|
||||||
if (aVector.IsNull()) return aGEOMObject._retn();
|
GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
|
||||||
|
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
||||||
//Perform the translation
|
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes);
|
return GetObject(anObject);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
|
||||||
|
|
||||||
return GetObject(anObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
@ -830,33 +830,31 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_
|
|||||||
CORBA::Double theStep2,
|
CORBA::Double theStep2,
|
||||||
CORBA::Long theNbTimes2)
|
CORBA::Long theNbTimes2)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aGEOMObject;
|
|
||||||
|
|
||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
if (theObject == NULL || theVector1 == NULL || theVector2 == NULL) return aGEOMObject._retn();
|
if (theObject == NULL || theVector1 == NULL || theVector2 == NULL) return aGEOMObject._retn();
|
||||||
|
|
||||||
//check if the object is a subshape
|
|
||||||
if(!theObject->IsMainShape()) {
|
|
||||||
GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get the object itself
|
//Get the object itself
|
||||||
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
|
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theObject->GetStudyID(), theObject->GetEntry());
|
||||||
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Get the vector1 of translation
|
//Get the vector1 of translation
|
||||||
Handle(GEOM_Object) aVector1 = GetOperations()->GetEngine()->GetObject(theVector1->GetStudyID(), theVector1->GetEntry());
|
Handle(GEOM_Object) aVector1 = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theVector1->GetStudyID(), theVector1->GetEntry());
|
||||||
if (aVector1.IsNull()) return aGEOMObject._retn();
|
if (aVector1.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Get the vector2 of translation
|
//Get the vector2 of translation
|
||||||
Handle(GEOM_Object) aVector2 = GetOperations()->GetEngine()->GetObject(theVector2->GetStudyID(), theVector2->GetEntry());
|
Handle(GEOM_Object) aVector2 = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theVector2->GetStudyID(), theVector2->GetEntry());
|
||||||
if (aVector2.IsNull()) return aGEOMObject._retn();
|
if (aVector2.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Perform the translation
|
//Perform the translation
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->Translate2D(aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
|
Handle(GEOM_Object) anObject = GetOperations()->Translate2D
|
||||||
|
(aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
@ -871,29 +869,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Obj
|
|||||||
GEOM::GEOM_Object_ptr theVector,
|
GEOM::GEOM_Object_ptr theVector,
|
||||||
CORBA::Long theNbTimes)
|
CORBA::Long theNbTimes)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aGEOMObject;
|
|
||||||
|
|
||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
||||||
|
|
||||||
//check if the object is a subshape
|
|
||||||
if(!theObject->IsMainShape()) {
|
|
||||||
GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get the object itself
|
//Get the object itself
|
||||||
Handle(GEOM_Object) aBasicObject =
|
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
|
||||||
GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
|
(theObject->GetStudyID(), theObject->GetEntry());
|
||||||
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
//Get the a directon of rotation
|
//Get the a directon of rotation
|
||||||
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), theVector->GetEntry());
|
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theVector->GetStudyID(), theVector->GetEntry());
|
||||||
if (aVector.IsNull()) return aGEOMObject._retn();
|
if (aVector.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
|
||||||
//Perform the rotation
|
//Perform the rotation
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
|
Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theNbTimes);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
||||||
@ -913,31 +905,26 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Obj
|
|||||||
CORBA::Double theStep,
|
CORBA::Double theStep,
|
||||||
CORBA::Long theNbTimes2)
|
CORBA::Long theNbTimes2)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aGEOMObject;
|
|
||||||
|
|
||||||
//Set a not done flag
|
//Set a not done flag
|
||||||
GetOperations()->SetNotDone();
|
GetOperations()->SetNotDone();
|
||||||
|
|
||||||
|
GEOM::GEOM_Object_var aGEOMObject;
|
||||||
|
|
||||||
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
if (theObject == NULL || theVector == NULL) return aGEOMObject._retn();
|
||||||
|
|
||||||
//check if the object is a subshape
|
|
||||||
if(!theObject->IsMainShape()) {
|
|
||||||
GetOperations()->SetErrorCode(SUBSHAPE_ERROR);
|
|
||||||
return aGEOMObject._retn();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get the object itself
|
//Get the object itself
|
||||||
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), theObject->GetEntry());
|
Handle(GEOM_Object) aBasicObject = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theObject->GetStudyID(), theObject->GetEntry());
|
||||||
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
if (aBasicObject.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
|
||||||
//Get the a directon of rotation
|
//Get the a directon of rotation
|
||||||
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject(theVector->GetStudyID(), theVector->GetEntry());
|
Handle(GEOM_Object) aVector = GetOperations()->GetEngine()->GetObject
|
||||||
|
(theVector->GetStudyID(), theVector->GetEntry());
|
||||||
if (aVector.IsNull()) return aGEOMObject._retn();
|
if (aVector.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
|
|
||||||
//Perform the rotation
|
//Perform the rotation
|
||||||
Handle(GEOM_Object) anObject = GetOperations()->Rotate2D(aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
|
Handle(GEOM_Object) anObject = GetOperations()->Rotate2D
|
||||||
|
(aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2);
|
||||||
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn();
|
||||||
|
|
||||||
return GetObject(anObject);
|
return GetObject(anObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user