|
11 | 11 | // Alternatively, this file may be used under the terms of Open CASCADE
|
12 | 12 | // commercial license or contractual agreement.
|
13 | 13 |
|
14 |
| -#include <DEBRepCascade_ConfigurationNode.hxx> |
| 14 | +#include <DEBREP_ConfigurationNode.hxx> |
15 | 15 |
|
| 16 | +#include <DEBREP_Provider.hxx> |
16 | 17 | #include <DE_ConfigurationContext.hxx>
|
17 | 18 | #include <DE_PluginHolder.hxx>
|
18 |
| -#include <DEBRepCascade_Provider.hxx> |
19 | 19 | #include <NCollection_Buffer.hxx>
|
20 | 20 |
|
21 |
| -IMPLEMENT_STANDARD_RTTIEXT(DEBRepCascade_ConfigurationNode, DE_ConfigurationNode) |
| 21 | +IMPLEMENT_STANDARD_RTTIEXT(DEBREP_ConfigurationNode, DE_ConfigurationNode) |
22 | 22 |
|
23 | 23 | namespace
|
24 | 24 | {
|
25 |
| - static const TCollection_AsciiString& THE_CONFIGURATION_SCOPE() |
26 |
| - { |
27 |
| - static const TCollection_AsciiString aScope = "provider"; |
28 |
| - return aScope; |
29 |
| - } |
| 25 | +static const TCollection_AsciiString& THE_CONFIGURATION_SCOPE() |
| 26 | +{ |
| 27 | + static const TCollection_AsciiString aScope = "provider"; |
| 28 | + return aScope; |
| 29 | +} |
| 30 | + |
| 31 | +// Wrapper to auto-load DE component |
| 32 | +DE_PluginHolder<DEBREP_ConfigurationNode> THE_OCCT_BREP_COMPONENT_PLUGIN; |
| 33 | +} // namespace |
30 | 34 |
|
31 |
| - // Wrapper to auto-load DE component |
32 |
| - DE_PluginHolder<DEBRepCascade_ConfigurationNode> THE_OCCT_BREP_COMPONENT_PLUGIN; |
| 35 | +//================================================================================================= |
| 36 | + |
| 37 | +DEBREP_ConfigurationNode::DEBREP_ConfigurationNode() |
| 38 | + : DE_ConfigurationNode() |
| 39 | +{ |
33 | 40 | }
|
34 | 41 |
|
35 |
| -//======================================================================= |
36 |
| -// function : DEBRepCascade_ConfigurationNode |
37 |
| -// purpose : |
38 |
| -//======================================================================= |
39 |
| -DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode() : |
40 |
| - DE_ConfigurationNode() |
41 |
| -{} |
42 |
| - |
43 |
| -//======================================================================= |
44 |
| -// function : DEBRepCascade_ConfigurationNode |
45 |
| -// purpose : |
46 |
| -//======================================================================= |
47 |
| -DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode(const Handle(DEBRepCascade_ConfigurationNode)& theNode) |
48 |
| - :DE_ConfigurationNode(theNode) |
| 42 | +//================================================================================================= |
| 43 | + |
| 44 | +DEBREP_ConfigurationNode::DEBREP_ConfigurationNode(const Handle(DEBREP_ConfigurationNode)& theNode) |
| 45 | + : DE_ConfigurationNode(theNode) |
49 | 46 | {
|
50 | 47 | InternalParameters = theNode->InternalParameters;
|
51 | 48 | }
|
52 | 49 |
|
53 |
| -//======================================================================= |
54 |
| -// function : Load |
55 |
| -// purpose : |
56 |
| -//======================================================================= |
57 |
| -bool DEBRepCascade_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theResource) |
| 50 | +//================================================================================================= |
| 51 | + |
| 52 | +bool DEBREP_ConfigurationNode::Load(const Handle(DE_ConfigurationContext)& theResource) |
58 | 53 | {
|
59 |
| - TCollection_AsciiString aScope = THE_CONFIGURATION_SCOPE() + "." + GetFormat() + "." + GetVendor(); |
| 54 | + TCollection_AsciiString aScope = |
| 55 | + THE_CONFIGURATION_SCOPE() + "." + GetFormat() + "." + GetVendor(); |
60 | 56 |
|
61 | 57 | InternalParameters.WriteBinary =
|
62 | 58 | theResource->BooleanVal("write.binary", InternalParameters.WriteBinary, aScope);
|
63 | 59 | InternalParameters.WriteVersionBin =
|
64 |
| - (BinTools_FormatVersion)theResource->IntegerVal("write.version.binary", InternalParameters.WriteVersionBin, aScope); |
| 60 | + (BinTools_FormatVersion)theResource->IntegerVal("write.version.binary", |
| 61 | + InternalParameters.WriteVersionBin, |
| 62 | + aScope); |
65 | 63 | InternalParameters.WriteVersionAscii =
|
66 |
| - (TopTools_FormatVersion)theResource->IntegerVal("write.version.ascii", InternalParameters.WriteVersionAscii, aScope); |
| 64 | + (TopTools_FormatVersion)theResource->IntegerVal("write.version.ascii", |
| 65 | + InternalParameters.WriteVersionAscii, |
| 66 | + aScope); |
67 | 67 | InternalParameters.WriteTriangles =
|
68 | 68 | theResource->BooleanVal("write.triangles", InternalParameters.WriteTriangles, aScope);
|
69 | 69 | InternalParameters.WriteNormals =
|
70 | 70 | theResource->BooleanVal("write.normals", InternalParameters.WriteNormals, aScope);
|
71 | 71 | return true;
|
72 | 72 | }
|
73 | 73 |
|
74 |
| -//======================================================================= |
75 |
| -// function : Save |
76 |
| -// purpose : |
77 |
| -//======================================================================= |
78 |
| -TCollection_AsciiString DEBRepCascade_ConfigurationNode::Save() const |
| 74 | +//================================================================================================= |
| 75 | + |
| 76 | +TCollection_AsciiString DEBREP_ConfigurationNode::Save() const |
79 | 77 | {
|
80 | 78 | TCollection_AsciiString aResult;
|
81 | 79 | aResult += "!*****************************************************************************\n";
|
82 |
| - aResult = aResult + "!Configuration Node " + " Vendor: " + GetVendor() + " Format: " + GetFormat() + "\n"; |
83 |
| - TCollection_AsciiString aScope = THE_CONFIGURATION_SCOPE() + "." + GetFormat() + "." + GetVendor() + "."; |
| 80 | + aResult = |
| 81 | + aResult + "!Configuration Node " + " Vendor: " + GetVendor() + " Format: " + GetFormat() + "\n"; |
| 82 | + TCollection_AsciiString aScope = |
| 83 | + THE_CONFIGURATION_SCOPE() + "." + GetFormat() + "." + GetVendor() + "."; |
84 | 84 |
|
85 | 85 | aResult += "!\n";
|
86 | 86 | aResult += "!Write parameters:\n";
|
@@ -120,88 +120,70 @@ TCollection_AsciiString DEBRepCascade_ConfigurationNode::Save() const
|
120 | 120 | return aResult;
|
121 | 121 | }
|
122 | 122 |
|
123 |
| -//======================================================================= |
124 |
| -// function : Copy |
125 |
| -// purpose : |
126 |
| -//======================================================================= |
127 |
| -Handle(DE_ConfigurationNode) DEBRepCascade_ConfigurationNode::Copy() const |
| 123 | +//================================================================================================= |
| 124 | + |
| 125 | +Handle(DE_ConfigurationNode) DEBREP_ConfigurationNode::Copy() const |
128 | 126 | {
|
129 |
| - return new DEBRepCascade_ConfigurationNode(*this); |
| 127 | + return new DEBREP_ConfigurationNode(*this); |
130 | 128 | }
|
131 | 129 |
|
132 |
| -//======================================================================= |
133 |
| -// function : BuildProvider |
134 |
| -// purpose : |
135 |
| -//======================================================================= |
136 |
| -Handle(DE_Provider) DEBRepCascade_ConfigurationNode::BuildProvider() |
| 130 | +//================================================================================================= |
| 131 | + |
| 132 | +Handle(DE_Provider) DEBREP_ConfigurationNode::BuildProvider() |
137 | 133 | {
|
138 |
| - return new DEBRepCascade_Provider(this); |
| 134 | + return new DEBREP_Provider(this); |
139 | 135 | }
|
140 | 136 |
|
141 |
| -//======================================================================= |
142 |
| -// function : IsImportSupported |
143 |
| -// purpose : |
144 |
| -//======================================================================= |
145 |
| -bool DEBRepCascade_ConfigurationNode::IsImportSupported() const |
| 137 | +//================================================================================================= |
| 138 | + |
| 139 | +bool DEBREP_ConfigurationNode::IsImportSupported() const |
146 | 140 | {
|
147 | 141 | return true;
|
148 | 142 | }
|
149 | 143 |
|
150 |
| -//======================================================================= |
151 |
| -// function : IsExportSupported |
152 |
| -// purpose : |
153 |
| -//======================================================================= |
154 |
| -bool DEBRepCascade_ConfigurationNode::IsExportSupported() const |
| 144 | +//================================================================================================= |
| 145 | + |
| 146 | +bool DEBREP_ConfigurationNode::IsExportSupported() const |
155 | 147 | {
|
156 | 148 | return true;
|
157 | 149 | }
|
158 | 150 |
|
159 |
| -//======================================================================= |
160 |
| -// function : GetFormat |
161 |
| -// purpose : |
162 |
| -//======================================================================= |
163 |
| -TCollection_AsciiString DEBRepCascade_ConfigurationNode::GetFormat() const |
| 151 | +//================================================================================================= |
| 152 | + |
| 153 | +TCollection_AsciiString DEBREP_ConfigurationNode::GetFormat() const |
164 | 154 | {
|
165 | 155 | return TCollection_AsciiString("BREP");
|
166 | 156 | }
|
167 | 157 |
|
168 |
| -//======================================================================= |
169 |
| -// function : GetVendor |
170 |
| -// purpose : |
171 |
| -//======================================================================= |
172 |
| -TCollection_AsciiString DEBRepCascade_ConfigurationNode::GetVendor() const |
| 158 | +//================================================================================================= |
| 159 | + |
| 160 | +TCollection_AsciiString DEBREP_ConfigurationNode::GetVendor() const |
173 | 161 | {
|
174 | 162 | return TCollection_AsciiString("OCC");
|
175 | 163 | }
|
176 | 164 |
|
177 |
| -//======================================================================= |
178 |
| -// function : GetExtensions |
179 |
| -// purpose : |
180 |
| -//======================================================================= |
181 |
| -TColStd_ListOfAsciiString DEBRepCascade_ConfigurationNode::GetExtensions() const |
| 165 | +//================================================================================================= |
| 166 | + |
| 167 | +TColStd_ListOfAsciiString DEBREP_ConfigurationNode::GetExtensions() const |
182 | 168 | {
|
183 | 169 | TColStd_ListOfAsciiString anExt;
|
184 | 170 | anExt.Append("brep");
|
185 | 171 | return anExt;
|
186 | 172 | }
|
187 | 173 |
|
188 |
| -//======================================================================= |
189 |
| -// function : CheckContent |
190 |
| -// purpose : |
191 |
| -//======================================================================= |
192 |
| -bool DEBRepCascade_ConfigurationNode::CheckContent(const Handle(NCollection_Buffer)& theBuffer) const |
| 174 | +//================================================================================================= |
| 175 | + |
| 176 | +bool DEBREP_ConfigurationNode::CheckContent(const Handle(NCollection_Buffer)& theBuffer) const |
193 | 177 | {
|
194 | 178 | if (theBuffer.IsNull() || theBuffer->Size() < 20)
|
195 | 179 | {
|
196 | 180 | return false;
|
197 | 181 | }
|
198 | 182 | const char* aBytes = (const char*)theBuffer->Data();
|
199 |
| - if (::strstr(aBytes, "DBRep_DrawableShape") || |
200 |
| - ::strstr(aBytes, "CASCADE Topology V1") || |
201 |
| - ::strstr(aBytes, "CASCADE Topology V3")) |
| 183 | + if (::strstr(aBytes, "DBRep_DrawableShape") || ::strstr(aBytes, "CASCADE Topology V1") |
| 184 | + || ::strstr(aBytes, "CASCADE Topology V3")) |
202 | 185 | {
|
203 | 186 | return true;
|
204 | 187 | }
|
205 | 188 | return false;
|
206 | 189 | }
|
207 |
| - |
0 commit comments