mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-12 11:06:26 +08: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.
49 lines
1.7 KiB
C++
49 lines
1.7 KiB
C++
// Copyright (c) 2021 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.
|
|
|
|
#ifndef _GeomConvert_Units_HeaderFile
|
|
#define _GeomConvert_Units_HeaderFile
|
|
|
|
#include <Standard_DefineAlloc.hxx>
|
|
#include <Standard_Handle.hxx>
|
|
class Geom2d_Curve;
|
|
class Geom_Surface;
|
|
|
|
//! Class contains conversion methods for 2d geom objects
|
|
class GeomConvert_Units
|
|
{
|
|
public:
|
|
|
|
DEFINE_STANDARD_ALLOC
|
|
|
|
//! Convert 2d curve for change angle unit from radian to degree
|
|
Standard_EXPORT static Handle(Geom2d_Curve) RadianToDegree(
|
|
const Handle(Geom2d_Curve)& theCurve,
|
|
const Handle(Geom_Surface)& theSurface,
|
|
const Standard_Real theLengthFactor,
|
|
const Standard_Real theFactorRadianDegree);
|
|
|
|
//! Convert 2d curve for change angle unit from degree to radian
|
|
Standard_EXPORT static Handle(Geom2d_Curve) DegreeToRadian(
|
|
const Handle(Geom2d_Curve)& theCurve,
|
|
const Handle(Geom_Surface)& theSurface,
|
|
const Standard_Real theLengthFactor,
|
|
const Standard_Real theFactorRadianDegree);
|
|
|
|
//! return 2d curve as 'mirror' for given
|
|
Standard_EXPORT static Handle(Geom2d_Curve) MirrorPCurve(const Handle(Geom2d_Curve)& theCurve);
|
|
|
|
};
|
|
|
|
#endif // _GeomConvert_Units_HeaderFile
|