0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / XmlMDF / XmlMDF_ADriver.cxx
1 // Created on: 2001-07-09
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 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
17 #include <Message_Messenger.hxx>
18 #include <Standard_Type.hxx>
19 #include <TCollection_AsciiString.hxx>
20 #include <TCollection_ExtendedString.hxx>
21 #include <TDF_Attribute.hxx>
22 #include <XmlMDF_ADriver.hxx>
23 #include <XmlObjMgt_Persistent.hxx>
24
25 IMPLEMENT_STANDARD_RTTIEXT(XmlMDF_ADriver,Standard_Transient)
26
27 //=======================================================================
28 //function : XmlMDF_ADriver
29 //purpose  : Constructor
30 //=======================================================================
31 XmlMDF_ADriver::XmlMDF_ADriver (const Handle(Message_Messenger)& theMsgDriver,
32                                 const Standard_CString           theNS,
33                                 const Standard_CString           theName)
34      : myMessageDriver (theMsgDriver)
35 {
36   if (theNS != NULL)
37     if (theNS[0] != '\0') {
38       myTypeName = theNS;
39       myTypeName += ':';
40     }
41   if (theName != NULL)
42     myTypeName += theName;
43 }
44
45 //=======================================================================
46 //function : VersionNumber
47 //purpose  : default version number from which the driver is available
48 //=======================================================================
49
50 Standard_Integer XmlMDF_ADriver::VersionNumber () const
51 {
52   return 0;
53 }
54
55 //=======================================================================
56 //function : SourceType
57 //purpose  : 
58 //=======================================================================
59
60 Handle(Standard_Type) XmlMDF_ADriver::SourceType () const
61 {
62   return NewEmpty() -> DynamicType();
63 }
64
65 //=======================================================================
66 //function : TypeName
67 //purpose  : 
68 //=======================================================================
69
70 const TCollection_AsciiString& XmlMDF_ADriver::TypeName () const
71 {
72   const Standard_CString aString = myTypeName.ToCString();
73   if (myTypeName.Length() == 0 || aString [myTypeName.Length() - 1] == ':')
74     (TCollection_AsciiString&)myTypeName += SourceType() -> Name();
75   return myTypeName;
76 }