-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <Standard_Stream.hxx>
#include <GEOMImpl_ICurvesOperations.hxx>
* MakePolyline
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (list<Handle(GEOM_Object)> thePoints)
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::list<Handle(GEOM_Object)> thePoints)
{
SetErrorCode(KO);
aCI.SetLength(aLen);
int ind = 1;
- list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
+ std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
if (aRefPnt.IsNull()) {
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
(Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
- double theRMajor, double theRMinor)
+ double theRMajor, double theRMinor,
+ Handle(GEOM_Object) theVecMaj)
{
SetErrorCode(KO);
// Not set thePnt means origin of global CS,
// Not set theVec means Z axis of global CS
+ // Not set theVecMaj means X axis of global CS
//if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Ellipse object
aCI.SetRMajor(theRMajor);
aCI.SetRMinor(theRMinor);
+ if (!theVecMaj.IsNull()) {
+ Handle(GEOM_Function) aRefVecMaj = theVecMaj->GetLastFunction();
+ if (aRefVecMaj.IsNull()) return NULL;
+ aCI.SetVectorMajor(aRefVecMaj);
+ }
+
//Compute the Ellipse value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
- << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
+ if (!theVecMaj.IsNull()) {
+ GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
+ << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor
+ << ", " << theVecMaj << ")";
+ }
+ else {
+ GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
+ << thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
+ }
SetErrorCode(OK);
return anEll;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcOfEllipse (Handle(GEOM_Object) thePnt1,
- Handle(GEOM_Object) thePnt2,
- Handle(GEOM_Object) thePnt3)
+ Handle(GEOM_Object) thePnt2,
+ Handle(GEOM_Object) thePnt3)
{
SetErrorCode(KO);
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier
- (list<Handle(GEOM_Object)> thePoints)
+ (std::list<Handle(GEOM_Object)> thePoints)
{
SetErrorCode(KO);
aCI.SetLength(aLen);
int ind = 1;
- list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
+ std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation
- (list<Handle(GEOM_Object)> thePoints)
+ (std::list<Handle(GEOM_Object)> thePoints,
+ bool theIsClosed)
{
SetErrorCode(KO);
aCI.SetLength(aLen);
int ind = 1;
- list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
+ std::list<Handle(GEOM_Object)>::iterator it = thePoints.begin();
for (; it != thePoints.end(); it++, ind++) {
Handle(GEOM_Function) aRefPnt = (*it)->GetLastFunction();
aCI.SetPoint(ind, aRefPnt);
}
+ aCI.SetIsClosed(theIsClosed);
+
//Compute the Spline value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
while (it != thePoints.end()) {
pd << ", " << (*it++);
}
- pd << "])";
+ pd << "]";
+ if ( theIsClosed ) pd << ", True";
+ pd << ")";
SetErrorCode(OK);
return aSpline;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher (const char* theCommand,
- list<double> theWorkingPlane)
+ std::list<double> theWorkingPlane)
{
SetErrorCode(KO);
aCI.SetCommand(aCommand);
int ind = 1;
- list<double>::iterator it = theWorkingPlane.begin();
+ std::list<double>::iterator it = theWorkingPlane.begin();
for (; it != theWorkingPlane.end(); it++, ind++)
aCI.SetWorkingPlane(ind, *it);
* Make3DSketcher
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcher (list<double> theCoordinates)
+Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcher (std::list<double> theCoordinates)
{
SetErrorCode(KO);
GEOMImpl_I3DSketcher aCI (aFunction);
int nbOfCoords = 0;
- list<double>::iterator it = theCoordinates.begin();
+ std::list<double>::iterator it = theCoordinates.begin();
for (; it != theCoordinates.end(); it++)
nbOfCoords++;