geom/src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx

115 lines
3.7 KiB
C++
Raw Normal View History

2013-04-01 12:25:01 +00:00
// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
2005-12-05 16:23:52 +00:00
//
2012-08-09 07:58:02 +00:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2005-12-05 16:23:52 +00:00
//
2012-08-09 07:58:02 +00:00
// 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.
2009-02-13 12:16:39 +00:00
//
2012-08-09 07:58:02 +00:00
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
2009-02-13 12:16:39 +00:00
//
2012-08-09 07:58:02 +00:00
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2009-02-13 12:16:39 +00:00
//
2012-08-09 07:58:02 +00:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2005-12-05 16:23:52 +00:00
//
2012-08-09 07:58:02 +00:00
// File: GEOMAlgo_ShapeAlgo.cxx
// Created: Tue Dec 7 12:06:54 2004
// Author: Peter KURNEV
// <pkv@irinox>
2009-02-13 12:16:39 +00:00
//
2012-08-09 07:58:02 +00:00
#include <GEOMAlgo_ShapeAlgo.hxx>
#include <BOPInt_Context.hxx>
2004-12-17 11:18:33 +00:00
//=======================================================================
//function : GEOMAlgo_ShapeAlgo
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
GEOMAlgo_ShapeAlgo::GEOMAlgo_ShapeAlgo()
2012-08-09 07:58:02 +00:00
:
2004-12-17 11:18:33 +00:00
GEOMAlgo_Algo()
{
myTolerance=0.0001;
}
2012-08-09 07:58:02 +00:00
2004-12-17 11:18:33 +00:00
//=======================================================================
//function : ~
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
GEOMAlgo_ShapeAlgo::~GEOMAlgo_ShapeAlgo()
{
}
//=======================================================================
2012-08-09 07:58:02 +00:00
//function : SetContext
//purpose :
//=======================================================================
void GEOMAlgo_ShapeAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
2012-08-09 07:58:02 +00:00
{
myContext=theContext;
}
//=======================================================================
//function : Context
//purpose :
//=======================================================================
const Handle(BOPInt_Context)& GEOMAlgo_ShapeAlgo::Context()const
2012-08-09 07:58:02 +00:00
{
return myContext;
}
//=======================================================================
2004-12-17 11:18:33 +00:00
//function : SetShape
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
void GEOMAlgo_ShapeAlgo::SetShape(const TopoDS_Shape& aS)
{
myShape=aS;
}
//=======================================================================
//function : Shape
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
const TopoDS_Shape& GEOMAlgo_ShapeAlgo::Shape()const
{
return myShape;
}
//=======================================================================
//function : SetTolerance
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
void GEOMAlgo_ShapeAlgo::SetTolerance(const Standard_Real aT)
{
myTolerance=aT;
}
//=======================================================================
//function : Tolerance
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
Standard_Real GEOMAlgo_ShapeAlgo::Tolerance()const
{
return myTolerance;
}
//=======================================================================
//function : Result
2012-08-09 07:58:02 +00:00
//purpose :
2004-12-17 11:18:33 +00:00
//=======================================================================
const TopoDS_Shape& GEOMAlgo_ShapeAlgo::Result()const
{
return myResult;
}
2012-08-09 07:58:02 +00:00
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void GEOMAlgo_ShapeAlgo::Perform()
{
if (myContext.IsNull()) {
myContext=new BOPInt_Context;
2012-08-09 07:58:02 +00:00
}
}