1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00
Files
occt/src/MXCAFDoc/MXCAFDoc_DimTolRetrievalDriver.cxx
bugmster 973c2be1e1 0024428: Implementation of LGPL license
The copying permission statements at the beginning of source files updated to refer to LGPL.
Copyright dates extended till 2014 in advance.
2013-12-17 12:42:41 +04:00

93 lines
3.4 KiB
C++

// Created on: 2008-12-10
// Created by: Pavel TELKOV
// Copyright (c) 2008-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and / or modify it
// under the terms of the GNU Lesser General Public version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <MXCAFDoc_DimTolRetrievalDriver.ixx>
#include <PXCAFDoc_DimTol.hxx>
#include <XCAFDoc_DimTol.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <PCollection_HAsciiString.hxx>
#include <PColStd_HArray1OfReal.hxx>
//=======================================================================
//function : MCAFDoc_DimTolRetrievalDriver
//purpose :
//=======================================================================
MXCAFDoc_DimTolRetrievalDriver::MXCAFDoc_DimTolRetrievalDriver
(const Handle(CDM_MessageDriver)& theMsgDriver) : MDF_ARDriver (theMsgDriver)
{}
//=======================================================================
//function : VersionNumber
//purpose :
//=======================================================================
Standard_Integer MXCAFDoc_DimTolRetrievalDriver::VersionNumber() const
{ return 0; }
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type) MXCAFDoc_DimTolRetrievalDriver::SourceType() const
{
static Handle(Standard_Type) sourceType = STANDARD_TYPE(PXCAFDoc_DimTol);
return sourceType;
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) MXCAFDoc_DimTolRetrievalDriver::NewEmpty() const
{
return new XCAFDoc_DimTol();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void MXCAFDoc_DimTolRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
const Handle(TDF_Attribute)& Target,
const Handle(MDF_RRelocationTable)& /*RelocTable*/) const
{
Handle(PXCAFDoc_DimTol) S = Handle(PXCAFDoc_DimTol)::DownCast (Source);
Handle(XCAFDoc_DimTol) T = Handle(XCAFDoc_DimTol)::DownCast (Target);
Handle(TColStd_HArray1OfReal) aVals;
Handle(PColStd_HArray1OfReal) aPArr = S->GetVal();
if ( !aPArr.IsNull() )
{
Standard_Integer i = aPArr->Lower(), n = aPArr->Upper();
aVals = new TColStd_HArray1OfReal( i, n );
for( ; i <= n; i++ )
aVals->SetValue( i, aPArr->Value( i ) );
}
Handle(TCollection_HAsciiString) aName, aDescr;
if ( !S->GetName().IsNull() )
aName = new TCollection_HAsciiString( (S->GetName())->Convert() );
if ( !S->GetDescription().IsNull() )
aDescr = new TCollection_HAsciiString( (S->GetDescription())->Convert() );
T->Set(S->GetKind(), aVals, aName, aDescr);
}