1 // Copyright (C) 2013-2022 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: CurveCreator_ShapeFilter.cxx
21 // Author: Ilya Shchekin
24 #include "CurveCreator_ShapeFilter.hxx"
26 #include <SelectMgr_EntityOwner.hxx>
27 #include <StdSelect_BRepOwner.hxx>
28 #include <TopoDS_Vertex.hxx>
30 IMPLEMENT_STANDARD_RTTIEXT(CurveCreator_ShapeFilter,SelectMgr_Filter)
32 CurveCreator_ShapeFilter::CurveCreator_ShapeFilter()
37 CurveCreator_ShapeFilter::~CurveCreator_ShapeFilter()
41 Standard_Boolean CurveCreator_ShapeFilter::ActsOn(const TopAbs_ShapeEnum aType) const
43 return (aType == TopAbs_VERTEX);
46 Standard_Boolean CurveCreator_ShapeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
48 Handle(StdSelect_BRepOwner) aBO = Handle(StdSelect_BRepOwner)::DownCast(EO);
50 return Standard_False;
52 const TopoDS_Shape& aShape = aBO->Shape();
54 if(aShape.ShapeType()!= TopAbs_VERTEX)
55 return Standard_False;
57 return myShapes.Contains(aShape);
60 void CurveCreator_ShapeFilter::AddShape(const TopoDS_Shape& aShape)
65 void CurveCreator_ShapeFilter::RemoveShape(const TopoDS_Shape& aShape)
67 myShapes.Remove(aShape);
70 void CurveCreator_ShapeFilter::ClearShapes()