0026203: Foundation Classes - provide method ::Swap() for NCollection_IndexedMap...
[occt.git] / src / NIS / NIS_SelectFilter.hxx
CommitLineData
b311480e 1// Created on: 2007-08-20
2// Created by: Alexander GRIGORIEV
973c2be1 3// Copyright (c) 2007-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16#ifndef NIS_SelectFilter_HeaderFile
17#define NIS_SelectFilter_HeaderFile
18
19#include <Standard_DefineHandle.hxx>
20#include <Standard_Transient.hxx>
21
22class NIS_InteractiveObject;
857ffd5e 23class Handle(Standard_Type);
7fd59977 24
25/**
ebc93ae7 26 * Interface for selection filters. It can be used in NIS_InteractiveContext by methods SetFilter and GetFilter.
27 * Unlike in AIS, only one filter can be installed in InteractiveContext.
28 * If you need more than one filter instance to work together, create a composite
29 * NIS_SelectFilter specialization that would hold a list of simpler Filter instances.
7fd59977 30 */
7fd59977 31class NIS_SelectFilter : public Standard_Transient
32{
33 public:
34 // ---------- PUBLIC METHODS ----------
35
36
37 /**
38 * Empty constructor.
39 */
40 inline NIS_SelectFilter () {}
41
42 /**
43 * Indicate that the given NIS_InteractiveObject passes the Filter.
44 * @return
45 * True - theObject is kept in the Selection, False - excluded from it.
46 */
47 virtual Standard_Boolean
48 IsOk (const NIS_InteractiveObject * theObject) const = 0;
49
50 /**
51 * Check if the type of InteractiveObject is allowed for selection.
52 * Default implementation returns always True.
53 * @return
54 * True if objects of the given Type should be checked, False if such
55 * objects are excluded from Selection before any checking.
56 */
57 Standard_EXPORT virtual Standard_Boolean
857ffd5e 58 ActsOn (const Handle(Standard_Type)& theType) const;
7fd59977 59
60
61 protected:
62 // ---------- PROTECTED METHODS ----------
63
64
65
66
67 public:
68// Declaration of CASCADE RTTI
69DEFINE_STANDARD_RTTI (NIS_SelectFilter)
70};
71
72// Definition of HANDLE object using Standard_DefineHandle.hxx
73DEFINE_STANDARD_HANDLE (NIS_SelectFilter, Standard_Transient)
74
75#endif