1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <inspector/TInspectorAPI_PluginParameters.hxx>
18 #if OCC_VERSION_HEX <= 0x060901
19 IMPLEMENT_STANDARD_HANDLE (TInspectorAPI_PluginParameters, Standard_Transient)
20 IMPLEMENT_STANDARD_RTTIEXT (TInspectorAPI_PluginParameters, Standard_Transient)
22 IMPLEMENT_STANDARD_RTTIEXT (TInspectorAPI_PluginParameters, Standard_Transient)
25 // =======================================================================
26 // function : Constructor
28 // =======================================================================
29 TInspectorAPI_PluginParameters::TInspectorAPI_PluginParameters()
33 // =======================================================================
34 // function : SetParameters
36 // =======================================================================
37 void TInspectorAPI_PluginParameters::SetParameters (const TCollection_AsciiString& thePluginName,
38 const NCollection_List<Handle(Standard_Transient)>& theParameters,
39 const Standard_Boolean&)
41 if (theParameters.Size() > 0)
42 myParameters.Bind (thePluginName, theParameters);
44 myParameters.UnBind (thePluginName);
47 // =======================================================================
48 // function : AddFileName
50 // =======================================================================
51 void TInspectorAPI_PluginParameters::AddFileName (const TCollection_AsciiString& thePluginName,
52 const TCollection_AsciiString& theFileName)
54 if (myFileNames.IsBound(thePluginName))
55 myFileNames.ChangeFind(thePluginName).Append (theFileName);
58 NCollection_List<TCollection_AsciiString> aNames;
59 aNames.Append (theFileName);
60 myFileNames.Bind (thePluginName, aNames);
64 // =======================================================================
65 // function : SetFileNames
67 // =======================================================================
68 void TInspectorAPI_PluginParameters::SetFileNames (const TCollection_AsciiString& thePluginName,
69 const NCollection_List<TCollection_AsciiString>& theFileNames)
71 if (theFileNames.Size() > 0)
72 myFileNames.Bind (thePluginName, theFileNames);
74 myFileNames.UnBind (thePluginName);
77 // =======================================================================
78 // function : SetSelectedNames
80 // =======================================================================
81 void TInspectorAPI_PluginParameters::SetSelectedNames (const TCollection_AsciiString& thePluginName,
82 const NCollection_List<TCollection_AsciiString>& theItemNames)
84 mySelectedItemNames.Bind (thePluginName, theItemNames);
87 // =======================================================================
88 // function : SetSelected
90 // =======================================================================
91 void TInspectorAPI_PluginParameters::SetSelected (const TCollection_AsciiString& thePluginName,
92 const NCollection_List<Handle(Standard_Transient)>& theObjects)
94 if (theObjects.Size() > 0)
95 mySelectedObjects.Bind (thePluginName, theObjects);
97 mySelectedObjects.UnBind (thePluginName);
100 // =======================================================================
101 // function : FindParameters
103 // =======================================================================
104 bool TInspectorAPI_PluginParameters::FindParameters (const TCollection_AsciiString& thePluginName)
106 return myParameters.IsBound(thePluginName);
109 // =======================================================================
110 // function : Parameters
112 // =======================================================================
113 const NCollection_List<Handle(Standard_Transient)>& TInspectorAPI_PluginParameters::Parameters
114 (const TCollection_AsciiString& thePluginName)
116 return myParameters.Find (thePluginName);
119 // =======================================================================
120 // function : FindFileNames
122 // =======================================================================
123 bool TInspectorAPI_PluginParameters::FindFileNames (const TCollection_AsciiString& thePluginName)
125 return myFileNames.IsBound(thePluginName);
128 // =======================================================================
129 // function : FileNames
131 // =======================================================================
132 const NCollection_List<TCollection_AsciiString>& TInspectorAPI_PluginParameters::FileNames
133 (const TCollection_AsciiString& thePluginName)
135 return myFileNames.Find (thePluginName);
138 // =======================================================================
139 // function : FindSelectedNames
141 // =======================================================================
142 bool TInspectorAPI_PluginParameters::FindSelectedNames (const TCollection_AsciiString& thePluginName)
144 return mySelectedItemNames.IsBound(thePluginName);
147 // =======================================================================
148 // function : GetSelectedNames
150 // =======================================================================
151 const NCollection_List<TCollection_AsciiString>& TInspectorAPI_PluginParameters::GetSelectedNames
152 (const TCollection_AsciiString& thePluginName)
154 return mySelectedItemNames.Find (thePluginName);
157 // =======================================================================
158 // function : GetSelectedObjects
160 // =======================================================================
161 Standard_Boolean TInspectorAPI_PluginParameters::GetSelectedObjects (const TCollection_AsciiString& thePluginName,
162 NCollection_List<Handle(Standard_Transient)>& theObjects)
164 return mySelectedObjects.Find (thePluginName, theObjects);