1 // Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SALOMEDSImpl_SComponent.cxx
24 // Author : Sergey RUIN
27 #include "SALOMEDSImpl_SComponent.hxx"
28 #include "SALOMEDSImpl_AttributeComment.hxx"
29 #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)
46 : SALOMEDSImpl_SObject()
49 _value = theSCO._value;
54 //============================================================================
55 /*! Function : constructor
58 //============================================================================
59 SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const DF_Label& theLabel)
60 :SALOMEDSImpl_SObject(theLabel)
64 //============================================================================
65 /*! Function : destructor
68 //============================================================================
69 SALOMEDSImpl_SComponent::~SALOMEDSImpl_SComponent()
74 //============================================================================
75 /*! Function : ComponentDataType
78 //============================================================================
79 std::string SALOMEDSImpl_SComponent::ComponentDataType()
82 SALOMEDSImpl_AttributeComment* type;
83 if ( (type = (SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())) ) {
91 //============================================================================
92 /*! Function : ComponentIOR
95 //============================================================================
96 bool SALOMEDSImpl_SComponent::ComponentIOR(std::string& IOR)
98 SALOMEDSImpl_AttributeIOR* ior;
99 if (!(ior = (SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())) )
106 //============================================================================
110 //============================================================================
111 bool SALOMEDSImpl_SComponent::IsA(const DF_Label& theLabel)
113 // scomponent must contain comment and belong to the 2th depth label
114 return theLabel.Depth() == 2 && theLabel.IsAttribute(SALOMEDSImpl_AttributeComment::GetID());
117 //============================================================================
118 /*! Function : GetPersistentCopy
121 //============================================================================
122 SALOMEDSImpl_SComponent* SALOMEDSImpl_SComponent::GetPersistentCopy() const
124 SALOMEDSImpl_SComponent* sco = new SALOMEDSImpl_SComponent;
128 sco->_value = _value;