mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-01 10:26:12 +03:00
Possibility for adding LengthUnit info to XCAF document using special class XCAFDoc_LenghtUnit and XCAFDoc_LenghtUnitTool is implemented. Package UnitsMethods is split: geom methods were placed to new file GeomConvert_Units which is in the toolkit TKXSBase, internal step scale factors was placed to StepData. Updated UnitMethods to convert scale factor to different unit types. Now, XSAlgo::XSAlgo_AlgoContainer is used to update unit info from static interface values. New Draw command "XSetLengthUnit" and "XGetLengthUnit" for set or get XDE attribute. Upgraded tests for STEP, IGES, OBJ, glTF, VRML formats to check area regressing with used unit. Upgraded tests\de test cases to use any units in the "loop back" algorithms.
71 lines
3.2 KiB
C++
71 lines
3.2 KiB
C++
// Created on: 2005-04-18
|
|
// Created by: Eugeny NAPALKOV
|
|
// Copyright (c) 2005-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 License 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 <BinMDF_ADriverTable.hxx>
|
|
#include <BinMNaming_NamedShapeDriver.hxx>
|
|
#include <BinMXCAFDoc.hxx>
|
|
#include <BinMXCAFDoc_AssemblyItemRefDriver.hxx>
|
|
#include <BinMXCAFDoc_CentroidDriver.hxx>
|
|
#include <BinMXCAFDoc_ColorDriver.hxx>
|
|
#include <BinMXCAFDoc_DatumDriver.hxx>
|
|
#include <BinMXCAFDoc_DimTolDriver.hxx>
|
|
#include <BinMXCAFDoc_GraphNodeDriver.hxx>
|
|
#include <BinMXCAFDoc_LengthUnitDriver.hxx>
|
|
#include <BinMXCAFDoc_LocationDriver.hxx>
|
|
#include <BinMXCAFDoc_MaterialDriver.hxx>
|
|
#include <BinMXCAFDoc_NoteDriver.hxx>
|
|
#include <BinMXCAFDoc_NoteBinDataDriver.hxx>
|
|
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
|
|
#include <BinMXCAFDoc_VisMaterialDriver.hxx>
|
|
#include <BinMXCAFDoc_VisMaterialToolDriver.hxx>
|
|
#include <Message_Messenger.hxx>
|
|
#include <TNaming_NamedShape.hxx>
|
|
|
|
//=======================================================================
|
|
//function :
|
|
//purpose :
|
|
//=======================================================================
|
|
void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
|
|
const Handle(Message_Messenger)& theMsgDrv)
|
|
{
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_CentroidDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_ColorDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_GraphNodeDriver(theMsgDrv));
|
|
|
|
//oan: changes for sharing locations map
|
|
Handle(BinMDF_ADriver) aNSDriver;
|
|
theDriverTable->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aNSDriver);
|
|
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
|
|
Handle(BinMNaming_NamedShapeDriver)::DownCast (aNSDriver);
|
|
|
|
Handle(BinMXCAFDoc_LocationDriver) aLocationDriver = new BinMXCAFDoc_LocationDriver (theMsgDrv);
|
|
if (!aNamedShapeDriver.IsNull())
|
|
{
|
|
aLocationDriver->SetNSDriver (aNamedShapeDriver);
|
|
}
|
|
|
|
theDriverTable->AddDriver( aLocationDriver);
|
|
theDriverTable->AddDriver(new BinMXCAFDoc_LengthUnitDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_AssemblyItemRefDriver(theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_DatumDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_DimTolDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_VisMaterialDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_NoteBinDataDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_NoteCommentDriver (theMsgDrv));
|
|
theDriverTable->AddDriver( new BinMXCAFDoc_VisMaterialToolDriver(theMsgDrv));
|
|
}
|