1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDSImpl_SComponent.cxx
21 // Author : Sergey RUIN
25 #include "SALOMEDSImpl_SComponent.hxx"
26 #include "SALOMEDSImpl_AttributeComment.hxx"
27 #include "SALOMEDSImpl_AttributeIOR.hxx"
31 //============================================================================
32 /*! Function : Empty constructor
35 //============================================================================
36 SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent()
40 //============================================================================
41 /*! Function : Copy constructor
44 //============================================================================
45 SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO)
48 _value = theSCO._value;
53 //============================================================================
54 /*! Function : constructor
57 //============================================================================
58 SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const DF_Label& theLabel)
59 :SALOMEDSImpl_SObject(theLabel)
63 //============================================================================
64 /*! Function : destructor
67 //============================================================================
68 SALOMEDSImpl_SComponent::~SALOMEDSImpl_SComponent()
73 //============================================================================
74 /*! Function : ComponentDataType
77 //============================================================================
78 string SALOMEDSImpl_SComponent::ComponentDataType()
81 SALOMEDSImpl_AttributeComment* type;
82 if ( (type = (SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())) ) {
90 //============================================================================
91 /*! Function : ComponentIOR
94 //============================================================================
95 bool SALOMEDSImpl_SComponent::ComponentIOR(string& IOR)
97 SALOMEDSImpl_AttributeIOR* ior;
98 if (!(ior = (SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())) )
105 //============================================================================
109 //============================================================================
110 bool SALOMEDSImpl_SComponent::IsA(const DF_Label& theLabel)
112 // scomponent must contain comment and belong to the 2th depth label
113 if ( theLabel.IsAttribute(SALOMEDSImpl_AttributeComment::GetID()) && theLabel.Depth() == 2) {
119 //============================================================================
120 /*! Function : GetPersistentCopy
123 //============================================================================
124 SALOMEDSImpl_SComponent* SALOMEDSImpl_SComponent::GetPersistentCopy() const
126 SALOMEDSImpl_SComponent* sco = new SALOMEDSImpl_SComponent;
130 sco->_value = _value;