0030268: Inspectors - improvements in VInspector plugin
[occt.git] / tools / DFBrowserPane / DFBrowserPane_AttributePaneCreator.cxx
1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement. 
15
16 #include <inspector/DFBrowserPane_AttributePaneCreator.hxx>
17
18 #include <TDF_Attribute.hxx>
19
20 #include <TDF_Reference.hxx>
21
22 // the types are defined in TDF library
23 #include <inspector/DFBrowserPane_TDFReference.hxx>
24 #include <inspector/DFBrowserPane_TDFTagSource.hxx>
25
26 #include <TDataStd_Current.hxx>
27 #include <TDataStd_Name.hxx>
28 #include <TDataStd_Comment.hxx>
29 #include <TDataStd_Integer.hxx>
30 #include <TDataStd_IntegerArray.hxx>
31 #include <TDataStd_Real.hxx>
32 #include <TDataStd_RealArray.hxx>
33 #include <TDataStd_ExtStringArray.hxx>
34 #include <TDataStd_UAttribute.hxx>
35 #include <TDataStd_TreeNode.hxx>
36 #include <TDataStd_Directory.hxx>
37 #include <TDataStd_NoteBook.hxx>
38 #include <TDataStd_Expression.hxx>
39 #include <TDataStd_Relation.hxx>
40 #include <TDataStd_Variable.hxx>
41 #include <TDataStd_Tick.hxx>
42 #include <TDataStd_AsciiString.hxx>
43 #include <TDataStd_IntPackedMap.hxx>
44 #include <TDataStd_IntegerList.hxx>
45 #include <TDataStd_RealList.hxx>
46 #include <TDataStd_ExtStringList.hxx>
47 #include <TDataStd_BooleanList.hxx>
48 #include <TDataStd_ReferenceList.hxx>
49 #include <TDataStd_BooleanArray.hxx>
50 #include <TDataStd_ReferenceArray.hxx>
51 #include <TDataStd_ByteArray.hxx>
52 #include <TDataStd_NamedData.hxx>
53
54 #include <TDocStd_Modified.hxx>
55 #include <TDocStd_Owner.hxx>
56 #include <TDocStd_XLink.hxx>
57 #include <TDocStd_XLinkRoot.hxx>
58 #include <TPrsStd_AISViewer.hxx>
59 #include <TPrsStd_AISPresentation.hxx>
60
61 #include <TNaming_NamedShape.hxx>
62 #include <TNaming_Naming.hxx>
63 #include <TNaming_UsedShapes.hxx>
64
65 #include <TFunction_Function.hxx>
66 #include <TFunction_GraphNode.hxx>
67 #include <TFunction_Scope.hxx>
68
69 // the types are defined in TDataStd.cdl
70 // Basic  attributes
71 #include <inspector/DFBrowserPane_TDataStdCurrent.hxx>
72 #include <inspector/DFBrowserPane_TDataStdName.hxx>
73 #include <inspector/DFBrowserPane_TDataStdComment.hxx>
74 #include <inspector/DFBrowserPane_TDataStdInteger.hxx>
75 #include <inspector/DFBrowserPane_TDataStdIntegerArray.hxx>
76 #include <inspector/DFBrowserPane_TDataStdReal.hxx>
77 #include <inspector/DFBrowserPane_TDataStdRealArray.hxx>
78 #include <inspector/DFBrowserPane_TDataStdExtStringArray.hxx>
79 #include <inspector/DFBrowserPane_TDataStdUAttribute.hxx>
80
81 #include <inspector/DFBrowserPane_TDataStdTreeNode.hxx>
82 #include <inspector/DFBrowserPane_TDataStdDirectory.hxx>
83 #include <inspector/DFBrowserPane_TDataStdNoteBook.hxx>
84 #include <inspector/DFBrowserPane_TDataStdExpression.hxx>
85 #include <inspector/DFBrowserPane_TDataStdRelation.hxx>
86 #include <inspector/DFBrowserPane_TDataStdVariable.hxx>
87
88 //Extension
89 #include <inspector/DFBrowserPane_TDataStdTick.hxx>
90 #include <inspector/DFBrowserPane_TDataStdAsciiString.hxx>
91 #include <inspector/DFBrowserPane_TDataStdIntPackedMap.hxx>
92 // Lists:
93 #include <inspector/DFBrowserPane_TDataStdIntegerList.hxx>
94 #include <inspector/DFBrowserPane_TDataStdRealList.hxx>
95 #include <inspector/DFBrowserPane_TDataStdExtStringList.hxx>
96 #include <inspector/DFBrowserPane_TDataStdBooleanList.hxx>
97 #include <inspector/DFBrowserPane_TDataStdReferenceList.hxx>
98
99 // Arrays:
100 #include <inspector/DFBrowserPane_TDataStdBooleanArray.hxx>
101 #include <inspector/DFBrowserPane_TDataStdReferenceArray.hxx>
102 #include <inspector/DFBrowserPane_TDataStdByteArray.hxx>
103 #include <inspector/DFBrowserPane_TDataStdNamedData.hxx>
104
105 // TDocStd attributes
106 #include <inspector/DFBrowserPane_TDocStdModified.hxx>
107 #include <inspector/DFBrowserPane_TDocStdOwner.hxx>
108 #include <inspector/DFBrowserPane_TDocStdXLink.hxx>
109 #include <inspector/DFBrowserPane_TDocStdXLinkRoot.hxx>
110
111 // TPrsStd attributes
112 #include <inspector/DFBrowserPane_TPrsStdAISViewer.hxx>
113 #include <inspector/DFBrowserPane_TPrsStdAISPresentation.hxx>
114
115 // TNaming attributes
116 #include <inspector/DFBrowserPane_TNamingNamedShape.hxx>
117 #include <inspector/DFBrowserPane_TNamingNaming.hxx>
118 #include <inspector/DFBrowserPane_TNamingUsedShapes.hxx>
119
120 // TFunction attributes
121 #include <inspector/DFBrowserPane_TFunctionFunction.hxx>
122 #include <inspector/DFBrowserPane_TFunctionGraphNode.hxx>
123 #include <inspector/DFBrowserPane_TFunctionScope.hxx>
124
125 // =======================================================================
126 // function : Constructor
127 // purpose :
128 // =======================================================================
129 DFBrowserPane_AttributePaneAPI* DFBrowserPane_AttributePaneCreator::CreateAttributePane (Standard_CString theAttributeName)
130 {
131   DFBrowserPane_AttributePaneAPI* aPane = 0;
132   if (theAttributeName == STANDARD_TYPE (TDF_Reference)->Name())
133     aPane = new DFBrowserPane_TDFReference();
134   else if (theAttributeName == STANDARD_TYPE (TDF_TagSource)->Name())
135     aPane = new DFBrowserPane_TDFTagSource();
136   else if (theAttributeName == STANDARD_TYPE (TDataStd_Current)->Name()) // Basic  attributes
137     aPane = new DFBrowserPane_TDataStdCurrent();
138   else if (theAttributeName == STANDARD_TYPE (TDataStd_Name)->Name())
139     aPane = new DFBrowserPane_TDataStdName();
140   else if (theAttributeName == STANDARD_TYPE (TDataStd_Comment)->Name())
141     aPane = new DFBrowserPane_TDataStdComment();
142   else if (theAttributeName == STANDARD_TYPE (TDataStd_Integer)->Name())
143     aPane = new DFBrowserPane_TDataStdInteger();
144   else if (theAttributeName == STANDARD_TYPE (TDataStd_IntegerArray)->Name())
145     aPane = new DFBrowserPane_TDataStdIntegerArray();
146   else if (theAttributeName == STANDARD_TYPE (TDataStd_Real)->Name())
147     aPane = new DFBrowserPane_TDataStdReal();
148   else if (theAttributeName == STANDARD_TYPE (TDataStd_RealArray)->Name())
149     aPane = new DFBrowserPane_TDataStdRealArray();
150   else if (theAttributeName == STANDARD_TYPE (TDataStd_ExtStringArray)->Name())
151     aPane = new DFBrowserPane_TDataStdExtStringArray();
152   else if (theAttributeName == STANDARD_TYPE (TDataStd_UAttribute)->Name())
153     aPane = new DFBrowserPane_TDataStdUAttribute();
154   else if (theAttributeName == STANDARD_TYPE (TDataStd_TreeNode)->Name()) // Attributes for organization
155     aPane = new DFBrowserPane_TDataStdTreeNode();
156   else if (theAttributeName == STANDARD_TYPE (TDataStd_Directory)->Name())
157     aPane = new DFBrowserPane_TDataStdDirectory();
158   else if (theAttributeName == STANDARD_TYPE (TDataStd_NoteBook)->Name()) // Other attributes
159     aPane = new DFBrowserPane_TDataStdNoteBook();
160   else if (theAttributeName == STANDARD_TYPE (TDataStd_Expression)->Name())
161     aPane = new DFBrowserPane_TDataStdExpression();
162   else if (theAttributeName == STANDARD_TYPE (TDataStd_Relation)->Name())
163     aPane = new DFBrowserPane_TDataStdRelation();
164   else if (theAttributeName == STANDARD_TYPE (TDataStd_Variable)->Name())
165     aPane = new DFBrowserPane_TDataStdVariable();
166   else if (theAttributeName == STANDARD_TYPE (TDataStd_Tick)->Name()) //Extension
167     aPane = new DFBrowserPane_TDataStdTick();
168   else if (theAttributeName == STANDARD_TYPE (TDataStd_AsciiString)->Name())
169     aPane = new DFBrowserPane_TDataStdAsciiString();
170   else if (theAttributeName == STANDARD_TYPE (TDataStd_IntPackedMap)->Name())
171     aPane = new DFBrowserPane_TDataStdIntPackedMap();
172   else if (theAttributeName == STANDARD_TYPE (TDataStd_IntegerList)->Name()) // Lists
173     aPane = new DFBrowserPane_TDataStdIntegerList();
174   else if (theAttributeName == STANDARD_TYPE (TDataStd_RealList)->Name())
175     aPane = new DFBrowserPane_TDataStdRealList();
176   else if (theAttributeName == STANDARD_TYPE (TDataStd_ExtStringList)->Name())
177     aPane = new DFBrowserPane_TDataStdExtStringList();
178   else if (theAttributeName == STANDARD_TYPE (TDataStd_BooleanList)->Name())
179     aPane = new DFBrowserPane_TDataStdBooleanList();
180   else if (theAttributeName == STANDARD_TYPE (TDataStd_ReferenceList)->Name())
181     aPane = new DFBrowserPane_TDataStdReferenceList();
182   else if (theAttributeName == STANDARD_TYPE (TDataStd_BooleanArray)->Name()) // Arrays:
183     aPane = new DFBrowserPane_TDataStdBooleanArray();
184   else if (theAttributeName == STANDARD_TYPE (TDataStd_ReferenceArray)->Name())
185     aPane = new DFBrowserPane_TDataStdReferenceArray();
186   else if (theAttributeName == STANDARD_TYPE (TDataStd_ByteArray)->Name())
187     aPane = new DFBrowserPane_TDataStdByteArray();
188   else if (theAttributeName == STANDARD_TYPE (TDataStd_NamedData)->Name())
189     aPane = new DFBrowserPane_TDataStdNamedData();
190   else if (theAttributeName == STANDARD_TYPE (TDocStd_Modified)->Name()) // TDocStd attributes
191     aPane = new DFBrowserPane_TDocStdModified();
192   else if (theAttributeName == STANDARD_TYPE (TDocStd_Owner)->Name())
193     aPane = new DFBrowserPane_TDocStdOwner();
194   else if (theAttributeName == STANDARD_TYPE (TDocStd_XLink)->Name())
195     aPane = new DFBrowserPane_TDocStdXLink();
196   else if (theAttributeName == STANDARD_TYPE (TDocStd_XLinkRoot)->Name())
197     aPane = new DFBrowserPane_TDocStdXLinkRoot();
198   else if (theAttributeName == STANDARD_TYPE (TPrsStd_AISViewer)->Name()) // TPrsStd attributes
199     aPane = new DFBrowserPane_TPrsStdAISViewer();
200   else if (theAttributeName == STANDARD_TYPE (TPrsStd_AISPresentation)->Name())
201     aPane = new DFBrowserPane_TPrsStdAISPresentation();
202   else if (theAttributeName == STANDARD_TYPE (TNaming_NamedShape)->Name()) // TNaming attributes
203     aPane = new DFBrowserPane_TNamingNamedShape();
204   else if (theAttributeName == STANDARD_TYPE (TNaming_Naming)->Name())
205     aPane = new DFBrowserPane_TNamingNaming();
206   else if (theAttributeName == STANDARD_TYPE (TNaming_UsedShapes)->Name())
207     aPane = new DFBrowserPane_TNamingUsedShapes();
208   else if (theAttributeName == STANDARD_TYPE (TFunction_Function)->Name()) // TFunction attributes
209     aPane = new DFBrowserPane_TFunctionFunction();
210   else if (theAttributeName == STANDARD_TYPE (TFunction_GraphNode)->Name())
211     aPane = new DFBrowserPane_TFunctionGraphNode();
212   else if (theAttributeName == STANDARD_TYPE (TFunction_Scope)->Name())
213     aPane = new DFBrowserPane_TFunctionScope();
214
215   return aPane;
216 }