X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_I%2FGEOM_ITransformOperations_i.cc;h=7d2993f2b724b107ce8d49f49b5fe8d93b9ef24b;hb=5d340bb0d6761b4a61913395814a5f18845c96a9;hp=27a3893bf5675e1b3aa28bd6e25e82e95b9de72a;hpb=2488be88d9b3d65dd3e3487a6bbdb5e96694b8a5;p=modules%2Fgeom.git diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.cc b/src/GEOM_I/GEOM_ITransformOperations_i.cc index 27a3893bf..7d2993f2b 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.cc +++ b/src/GEOM_I/GEOM_ITransformOperations_i.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,6 +18,7 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include @@ -86,15 +87,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPoints aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the first point of translation - Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); + Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); if (aPoint1.IsNull()) return aGEOMObject._retn(); //Get the second point of translation - Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); + Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); if (aPoint2.IsNull()) return aGEOMObject._retn(); //Perform the translation @@ -122,19 +123,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateTwoPointsCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the first point of translation - Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); + Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); if (aPoint1.IsNull()) return aGEOMObject._retn(); //Get the second point of translation - Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); + Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); if (aPoint2.IsNull()) return aGEOMObject._retn(); //Create the translated shape - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->TranslateTwoPointsCopy(aBasicObject, aPoint1, aPoint2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -166,7 +167,7 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZ aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Perform the translation @@ -193,11 +194,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateDXDYDZCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Create the translated shape - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->TranslateDXDYDZCopy(aBasicObject, theDX, theDY, theDZ); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -229,11 +230,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVector aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); if (aVector.IsNull()) return aGEOMObject._retn(); //Perform the translation @@ -260,15 +261,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); if (aVector.IsNull()) return aGEOMObject._retn(); //Perform the translation - Handle(GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector); + Handle(::GEOM_Object) anObject = GetOperations()->TranslateVectorCopy(aBasicObject, aVector); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -301,16 +302,16 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TranslateVectorDistance aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); if (aVector.IsNull()) return aGEOMObject._retn(); //Perform the translation if (theCopy) { - Handle(GEOM_Object) anObject = GetOperations()-> + Handle(::GEOM_Object) anObject = GetOperations()-> TranslateVectorDistance(aBasicObject, aVector, theDistance, theCopy); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -350,11 +351,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::Rotate (GEOM::GEOM_Object_ptr aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the axis of revolution - Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis); + Handle(::GEOM_Object) anAxis = GetObjectImpl(theAxis); if (anAxis.IsNull()) return aGEOMObject._retn(); //Perform the rotation @@ -381,15 +382,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateCopy (GEOM::GEOM_Object GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the axis of rotation - Handle(GEOM_Object) anAxis = GetObjectImpl(theAxis); + Handle(::GEOM_Object) anAxis = GetObjectImpl(theAxis); if (anAxis.IsNull()) return aGEOMObject._retn(); //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle); + Handle(::GEOM_Object) anObject = GetOperations()->RotateCopy(aBasicObject, anAxis, theAngle); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -419,11 +420,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlane } //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the plane - Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane); + Handle(::GEOM_Object) aPlane = GetObjectImpl(thePlane); if (aPlane.IsNull()) return aGEOMObject._retn(); //Perform the mirror @@ -450,15 +451,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPlaneCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aPlane = GetObjectImpl(thePlane); + Handle(::GEOM_Object) aPlane = GetObjectImpl(thePlane); if (aPlane.IsNull()) return aGEOMObject._retn(); //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane); + Handle(::GEOM_Object) anObject = GetOperations()->MirrorPlaneCopy(aBasicObject, aPlane); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -488,11 +489,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxis } //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the axis - Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis); + Handle(::GEOM_Object) aAxis = GetObjectImpl(theAxis); if (aAxis.IsNull()) return aGEOMObject._retn(); //Perform the mirror @@ -519,15 +520,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorAxisCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aAxis = GetObjectImpl(theAxis); + Handle(::GEOM_Object) aAxis = GetObjectImpl(theAxis); if (aAxis.IsNull()) return aGEOMObject._retn(); //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis); + Handle(::GEOM_Object) anObject = GetOperations()->MirrorAxisCopy(aBasicObject, aAxis); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -557,11 +558,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPoint } //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the point - Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint); + Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); //Perform the mirror @@ -588,15 +589,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint); + Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); //Perform the mirror - Handle(GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint); + Handle(::GEOM_Object) anObject = GetOperations()->MirrorPointCopy(aBasicObject, aPoint); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -608,9 +609,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MirrorPointCopy * OffsetShape */ //============================================================================= -GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape - (GEOM::GEOM_Object_ptr theObject, - CORBA::Double theOffset) +GEOM::GEOM_Object_ptr +GEOM_ITransformOperations_i::OffsetShape (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theOffset, + CORBA::Boolean theJoinByPipes) { GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); @@ -626,11 +628,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape } //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Create the offset shape - GetOperations()->OffsetShape(aBasicObject, theOffset); + GetOperations()->OffsetShape( aBasicObject, theOffset, theJoinByPipes ); // Update GUI. UpdateGUIForObject(theObject); @@ -643,9 +645,10 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShape * OffsetShapeCopy */ //============================================================================= -GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy - (GEOM::GEOM_Object_ptr theObject, - CORBA::Double theOffset) +GEOM::GEOM_Object_ptr +GEOM_ITransformOperations_i::OffsetShapeCopy (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theOffset, + CORBA::Boolean theJoinByPipes) { GEOM::GEOM_Object_var aGEOMObject; @@ -653,11 +656,12 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::OffsetShapeCopy GetOperations()->SetNotDone(); //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Create the offset shape - Handle(GEOM_Object) anObject = GetOperations()->OffsetShapeCopy(aBasicObject, theOffset); + Handle(::GEOM_Object) anObject = + GetOperations()->OffsetShapeCopy(aBasicObject, theOffset, theJoinByPipes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -679,18 +683,53 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ProjectShapeCopy GetOperations()->SetNotDone(); //Get the input objects - Handle(GEOM_Object) aSource = GetObjectImpl(theSource); - Handle(GEOM_Object) aTarget = GetObjectImpl(theTarget); + Handle(::GEOM_Object) aSource = GetObjectImpl(theSource); + Handle(::GEOM_Object) aTarget = GetObjectImpl(theTarget); if (aSource.IsNull() || aTarget.IsNull()) return aGEOMObject._retn(); //Create the projection - Handle(GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget); + Handle(::GEOM_Object) anObject = GetOperations()->ProjectShapeCopy(aSource, aTarget); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); return GetObject(anObject); } +//============================================================================= +/*! + * ProjectPointOnWire + */ +//============================================================================= +CORBA::Double GEOM_ITransformOperations_i::ProjectPointOnWire + (GEOM::GEOM_Object_ptr thePoint, + GEOM::GEOM_Object_ptr theWire, + GEOM::GEOM_Object_out thePointOnEdge, + CORBA::Long& theEdgeInWireIndex) +{ + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the reference shape + Handle(::GEOM_Object) aPoint = GetObjectImpl(thePoint); + Handle(::GEOM_Object) aWire = GetObjectImpl(theWire); + + if (aPoint.IsNull() || aWire.IsNull()) { + return -1.0; + } + + Handle(::GEOM_Object) aPointOnEdge; + Standard_Integer anEdgeIndex; + CORBA::Double aResult = GetOperations()->ProjectPointOnWire + (aPoint, aWire, aPointOnEdge, anEdgeIndex); + + if (!aPointOnEdge.IsNull()) { + thePointOnEdge = GetObject(aPointOnEdge); + theEdgeInWireIndex = anEdgeIndex; + } + + return aResult; +} + //============================================================================= /*! * ScaleShape @@ -715,11 +754,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShape } //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the point - Handle(GEOM_Object) aPoint; + Handle(::GEOM_Object) aPoint; if (!thePoint->_is_nil()) { aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); @@ -750,18 +789,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeCopy GetOperations()->SetNotDone(); //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the point - Handle(GEOM_Object) aPoint; + Handle(::GEOM_Object) aPoint; if (!thePoint->_is_nil()) { aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); } //Perform the scale - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->ScaleShapeCopy(aBasicObject, aPoint, theFactor); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -795,11 +834,11 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxes } //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the point - Handle(GEOM_Object) aPoint; + Handle(::GEOM_Object) aPoint; if (!thePoint->_is_nil()) { aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); @@ -833,18 +872,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::ScaleShapeAlongAxesCopy GetOperations()->SetNotDone(); //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the point - Handle(GEOM_Object) aPoint; + Handle(::GEOM_Object) aPoint; if (!thePoint->_is_nil()) { aPoint = GetObjectImpl(thePoint); if (aPoint.IsNull()) return aGEOMObject._retn(); } //Perform the scale - Handle(GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes + Handle(::GEOM_Object) anObject = GetOperations()->ScaleShapeAlongAxes (aBasicObject, aPoint, theFactorX, theFactorY, theFactorZ, /*doCopy*/true); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -877,18 +916,18 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShape } //Get the basic object - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the Start LCS (may be NULL for positioning from global LCS) - Handle(GEOM_Object) aStartLCS; + Handle(::GEOM_Object) aStartLCS; if (!CORBA::is_nil(theStartLCS)) { aStartLCS = GetObjectImpl(theStartLCS); if (aStartLCS.IsNull()) return aGEOMObject._retn(); } //Get the End LCS - Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS); + Handle(::GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS); if (aEndLCS.IsNull()) return aGEOMObject._retn(); //Perform the Position @@ -916,22 +955,22 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionShapeCopy GetOperations()->SetNotDone(); //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the Start LCS (may be NULL for positioning from global LCS) - Handle(GEOM_Object) aStartLCS; + Handle(::GEOM_Object) aStartLCS; if (!CORBA::is_nil(theStartLCS)) { aStartLCS = GetObjectImpl(theStartLCS); if (aStartLCS.IsNull()) return aGEOMObject._retn(); } //Get the End LCS - Handle(GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS); + Handle(::GEOM_Object) aEndLCS = GetObjectImpl(theEndLCS); if (aEndLCS.IsNull()) return aGEOMObject._retn(); //Perform the position - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->PositionShapeCopy(aBasicObject, aStartLCS, aEndLCS); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -957,15 +996,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::PositionAlongPath GetOperations()->SetNotDone(); //Get the basic object - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the path object - Handle(GEOM_Object) aPathObject = GetObjectImpl(thePath); + Handle(::GEOM_Object) aPathObject = GetObjectImpl(thePath); if (aPathObject.IsNull()) return aGEOMObject._retn(); //Perform the position - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->PositionAlongPath(aBasicObject, aPathObject, theDistance, theCopy, theReverse); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -994,15 +1033,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate1D GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector of translation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DX by default //Perform the translation - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->Translate1D(aBasicObject, aVector, theStep, theNbTimes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1028,19 +1067,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiTranslate2D (GEOM::GEOM_ GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the vector1 of translation - Handle(GEOM_Object) aVector1 = GetObjectImpl(theVector1); + Handle(::GEOM_Object) aVector1 = GetObjectImpl(theVector1); //if (aVector1.IsNull()) return aGEOMObject._retn(); // DX by default //Get the vector2 of translation - Handle(GEOM_Object) aVector2 = GetObjectImpl(theVector2); + Handle(::GEOM_Object) aVector2 = GetObjectImpl(theVector2); //if (aVector2.IsNull()) return aGEOMObject._retn(); // DY by default //Perform the translation - Handle(GEOM_Object) anObject = GetOperations()->Translate2D + Handle(::GEOM_Object) anObject = GetOperations()->Translate2D (aBasicObject, aVector1, theStep1, theNbTimes1, aVector2, theStep2, theNbTimes2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1062,15 +1101,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1D (GEOM::GEOM_Obj GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the a directon of rotation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default //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(); return GetObject(anObject); @@ -1092,15 +1131,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate1DByStep (GEOM::GE GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the a directon of rotation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theAngleStep, theNbSteps); + Handle(::GEOM_Object) anObject = GetOperations()->Rotate1D(aBasicObject, aVector, theAngleStep, theNbSteps); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); return GetObject(anObject); @@ -1123,15 +1162,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DNbTimes (GEOM::G GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the a directon of rotation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->Rotate2D + Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D (aBasicObject, aVector, theNbObjects, theRadialStep, theNbSteps); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1156,15 +1195,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2DByStep (GEOM::GE GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the a directon of rotation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->Rotate2D + Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D (aBasicObject, aVector, theAngle, theNbTimes1, theStep, theNbTimes2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1189,17 +1228,17 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MultiRotate2D (GEOM::GEOM_Obj GEOM::GEOM_Object_var aGEOMObject; //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the a directon of rotation - Handle(GEOM_Object) aVector = GetObjectImpl(theVector); + Handle(::GEOM_Object) aVector = GetObjectImpl(theVector); //if (aVector.IsNull()) return aGEOMObject._retn(); // DZ by default double anAngle = M_PI * theAngle / 180.; //Perform the rotation - Handle(GEOM_Object) anObject = GetOperations()->Rotate2D + Handle(::GEOM_Object) anObject = GetOperations()->Rotate2D (aBasicObject, aVector, anAngle, theNbTimes1, theStep, theNbTimes2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1233,19 +1272,19 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePoints aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the central point of rotation - Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint); + Handle(::GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint); if (aCentPoint.IsNull()) return aGEOMObject._retn(); //Get the first point - Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); + Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); if (aPoint1.IsNull()) return aGEOMObject._retn(); //Get the second point - Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); + Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); if (aPoint2.IsNull()) return aGEOMObject._retn(); //Perform the translation @@ -1274,23 +1313,23 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) aBasicObject = GetObjectImpl(theObject); if (aBasicObject.IsNull()) return aGEOMObject._retn(); //Get the central point of rotation - Handle(GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint); + Handle(::GEOM_Object) aCentPoint = GetObjectImpl(theCentPoint); if (aCentPoint.IsNull()) return aGEOMObject._retn(); //Get the first point - Handle(GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); + Handle(::GEOM_Object) aPoint1 = GetObjectImpl(thePoint1); if (aPoint1.IsNull()) return aGEOMObject._retn(); //Get the second point - Handle(GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); + Handle(::GEOM_Object) aPoint2 = GetObjectImpl(thePoint2); if (aPoint2.IsNull()) return aGEOMObject._retn(); //Perform the rotation - Handle(GEOM_Object) anObject = + Handle(::GEOM_Object) anObject = GetOperations()->RotateThreePointsCopy(aBasicObject, aCentPoint, aPoint1, aPoint2); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -1313,15 +1352,15 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy GetOperations()->SetNotDone(); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Get the sample object - Handle(GEOM_Object) aSample = GetObjectImpl(theSample); + Handle(::GEOM_Object) aSample = GetObjectImpl(theSample); if (aSample.IsNull()) return aGEOMObject._retn(); //Perform the transformation - Handle(GEOM_Object) aResObject = + Handle(::GEOM_Object) aResObject = GetOperations()->TransformLikeOtherCopy(anObject, aSample); if (!GetOperations()->IsDone() || aResObject.IsNull()) return aGEOMObject._retn(); @@ -1346,13 +1385,48 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); //Get the object itself - Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); if (anObject.IsNull()) return aGEOMObject._retn(); //Perform the recomputation - Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction(); + Handle(::GEOM_Function) aLastFunction = anObject->GetLastFunction(); if (aLastFunction.IsNull()) return aGEOMObject._retn(); GetOperations()->GetSolver()->ComputeFunction(aLastFunction); return aGEOMObject._retn(); } + +//============================================================================= +/*! + * MakeProjectionOnCylinder + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder + (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theRadius, + CORBA::Double theStartAngle, + CORBA::Double theAngleLength, + CORBA::Double theAngleRotation) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the object + Handle(::GEOM_Object) anObject = GetObjectImpl(theObject); + + if (anObject.IsNull()) { + return aGEOMObject._retn(); + } + + //Perform the transformation + Handle(::GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder + (anObject, theRadius, theStartAngle, theAngleLength, theAngleRotation); + + if (!GetOperations()->IsDone() || aResObject.IsNull()) { + return aGEOMObject._retn(); + } + + return GetObject(aResObject); +}