mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e82d98d345 | ||
|
72c6d55bf2 | ||
|
d0e33902bc | ||
|
a52ee17c73 | ||
|
72b244bc98 | ||
|
9c6914c3cc | ||
|
4ab54d60ef | ||
|
09a69618da | ||
|
6cb0b9b4e3 | ||
|
33339b0dc2 | ||
|
392ba7dbb6 | ||
|
ed20837d8b | ||
|
2ab4e9e180 | ||
|
d83d72acf9 | ||
|
fae5678dc7 | ||
|
488c43ed0c |
13
.github/workflows/codemsvc.yml
vendored
13
.github/workflows/codemsvc.yml
vendored
@@ -56,14 +56,7 @@ jobs:
|
||||
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test
|
||||
|
||||
# Upload SARIF file to GitHub Code Scanning Alerts
|
||||
#- name: Upload SARIF to GitHub
|
||||
# uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
# with:
|
||||
# sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
||||
# Upload SARIF file as an Artifact to download and view
|
||||
- name: Upload SARIF as an Artifact
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
with:
|
||||
name: sarif-file
|
||||
path: ${{ steps.run-analysis.outputs.sarif }}
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
elseif(MINGW)
|
||||
add_definitions(-D_WIN32_WINNT=0x0601)
|
||||
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
|
||||
|
@@ -479,8 +479,8 @@ if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
|
||||
if (USE_QT)
|
||||
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
|
||||
|
@@ -11,7 +11,7 @@ project (ImportExport)
|
||||
add_definitions (-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/src)
|
||||
set (ImportExport_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/src)
|
||||
set (ImportExport_HEADER_FILES ${ImportExport_SRC_DIR}/ColoredShapes.h
|
||||
${ImportExport_SRC_DIR}/ImportExportApp.h
|
||||
${ImportExport_SRC_DIR}/ImportExportDoc.h
|
||||
@@ -21,7 +21,7 @@ set (ImportExport_SOURCE_FILES ${ImportExport_SRC_DIR}/ColoredShapes.cpp
|
||||
${ImportExport_SRC_DIR}/ImportExportDoc.cpp
|
||||
${ImportExport_SRC_DIR}/StdAfx.cpp)
|
||||
|
||||
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport/res)
|
||||
set (ImportExport_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport/res)
|
||||
set (ImportExport_RESOURCE_HEADER ${ImportExport_RESOURCE_DIR}/resource.h)
|
||||
set (ImportExport_RESOURCE_FILES ${ImportExport_RESOURCE_DIR}/Toolbar.bmp
|
||||
${ImportExport_RESOURCE_DIR}/ImportExport.rc)
|
||||
@@ -55,7 +55,7 @@ else()
|
||||
endif()
|
||||
|
||||
include_directories (${CMAKE_BINARY_DIR}/inc
|
||||
${MFC_STANDARD_SAMPLES_DIR}/05_ImportExport
|
||||
${MFC_STANDARD_SAMPLES_DIR}/03_ImportExport
|
||||
${ImportExport_SRC_DIR}
|
||||
${MFC_STANDARD_SAMPLES_DIR}/Common)
|
||||
|
||||
|
@@ -11,7 +11,7 @@ project (HLR)
|
||||
add_definitions(-DWINVER=0x0501 -DUNICODE -D_UNICODE)
|
||||
set (CMAKE_MFC_FLAG 2)
|
||||
|
||||
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/src)
|
||||
set (HLR_SRC_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/src)
|
||||
set (HLR_HEADER_FILES ${HLR_SRC_DIR}/HLRApp.h
|
||||
${HLR_SRC_DIR}/HLRDoc.h
|
||||
${HLR_SRC_DIR}/HLRView2D.h
|
||||
@@ -23,7 +23,7 @@ set (HLR_SOURCE_FILES ${HLR_SRC_DIR}/HLRApp.cpp
|
||||
${HLR_SRC_DIR}/SelectionDialog.cpp
|
||||
${HLR_SRC_DIR}/StdAfx.cpp )
|
||||
|
||||
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/08_HLR/res)
|
||||
set (HLR_RESOURCE_DIR ${MFC_STANDARD_SAMPLES_DIR}/04_HLR/res)
|
||||
set (HLR_RESOURCE_HEADER ${HLR_RESOURCE_DIR}/resource.h)
|
||||
set (HLR_RESOURCE_FILES ${HLR_RESOURCE_DIR}/axoviewd.bmp
|
||||
${HLR_RESOURCE_DIR}/axoviewf.bmp
|
||||
|
@@ -82,7 +82,6 @@ set (COMMON_HEADER_FILES ${MFC_STANDARD_COMMON_SAMPLES_DIR}/AISDialogs.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/OCC_StereoConfigDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ParamsFacesPage.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ResultDialog.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/User_Cylinder.hxx
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/ColoredMeshDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/DimensionDlg.h
|
||||
${MFC_STANDARD_COMMON_SAMPLES_DIR}/LengthParamsEdgePage.h
|
||||
|
@@ -229,7 +229,6 @@ Standard_Integer bopsmt(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
char buf[64];
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer aNb;
|
||||
BOPAlgo_BOP aBOP;
|
||||
@@ -237,8 +236,7 @@ Standard_Integer bopsmt(Draw_Interpretor& di,
|
||||
const TopTools_ListOfShape& aLC=pPF->Arguments();
|
||||
aNb=aLC.Extent();
|
||||
if (aNb!=2) {
|
||||
Sprintf (buf, " wrong number of arguments %s\n", aNb);
|
||||
di << buf;
|
||||
di << " wrong number of arguments " << aNb << '\n';
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
@@ -298,7 +296,6 @@ Standard_Integer bopsection(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
char buf[64];
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer aNb;
|
||||
BOPAlgo_Section aBOP;
|
||||
@@ -306,8 +303,7 @@ Standard_Integer bopsection(Draw_Interpretor& di,
|
||||
const TopTools_ListOfShape& aLC=pPF->Arguments();
|
||||
aNb=aLC.Extent();
|
||||
if (aNb!=2) {
|
||||
Sprintf (buf, " wrong number of arguments %s\n", aNb);
|
||||
di << buf;
|
||||
di << " wrong number of arguments " << aNb << '\n';
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
|
@@ -43,7 +43,7 @@ static Standard_Integer
|
||||
IntersectionOfSets( const NCollection_List<Standard_Integer>& theSet1,
|
||||
const NCollection_List<Standard_Integer>& theSet2)
|
||||
{
|
||||
const Standard_Integer anIntMax = IntegerLast();
|
||||
constexpr Standard_Integer anIntMax = IntegerLast();
|
||||
Standard_Integer aRetVal = anIntMax;
|
||||
for(NCollection_List<Standard_Integer>::Iterator
|
||||
anIt1 = theSet1.begin().Iterator();
|
||||
|
@@ -234,7 +234,7 @@ Standard_Integer BRepToIGESBRep_Entity::AddEdge(const TopoDS_Edge& myedge,
|
||||
Standard_Integer index = myEdges.FindIndex(E);
|
||||
if (index == 0) {
|
||||
index = myEdges.Add(E);
|
||||
myCurves.Add(C);
|
||||
myCurves.Append(C);
|
||||
}
|
||||
|
||||
return index;
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TColStd_IndexedMapOfTransient.hxx>
|
||||
#include <TColStd_SequenceOfTransient.hxx>
|
||||
#include <BRepToIGES_BREntity.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Message_ProgressRange.hxx>
|
||||
@@ -136,7 +137,7 @@ private:
|
||||
|
||||
TopTools_IndexedMapOfShape myVertices;
|
||||
TopTools_IndexedMapOfShape myEdges;
|
||||
TColStd_IndexedMapOfTransient myCurves;
|
||||
TColStd_SequenceOfTransient myCurves;
|
||||
Handle(IGESSolid_EdgeList) myEdgeList;
|
||||
Handle(IGESSolid_VertexList) myVertexList;
|
||||
|
||||
|
@@ -720,7 +720,7 @@ static Standard_Boolean IsSegmentOut(Standard_Real x1,Standard_Real y1,
|
||||
Standard_Real xs1,Standard_Real ys1,
|
||||
Standard_Real xs2,Standard_Real ys2)
|
||||
{
|
||||
Standard_Real eps = RealSmall();
|
||||
constexpr Standard_Real eps = RealSmall();
|
||||
Standard_Real xsmin = Min (xs1, xs2);
|
||||
Standard_Real xsmax = Max (xs1, xs2);
|
||||
Standard_Real ysmin = Min (ys1, ys2);
|
||||
@@ -765,7 +765,7 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir
|
||||
if (IsWhole()) return Standard_False;
|
||||
else if (IsVoid()) return Standard_True;
|
||||
|
||||
Standard_Real eps = RealSmall();
|
||||
constexpr Standard_Real eps = RealSmall();
|
||||
Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax;
|
||||
Get (myXmin, myYmin, myZmin, myXmax, myYmax, myZmax);
|
||||
|
||||
|
@@ -180,7 +180,7 @@ static void TreatInfinitePlane(const gp_Pln &aPlane,
|
||||
{
|
||||
// Get 3 coordinate axes of the plane.
|
||||
const gp_Dir &aNorm = aPlane.Axis().Direction();
|
||||
const Standard_Real anAngularTol = RealEpsilon();
|
||||
constexpr Standard_Real anAngularTol = RealEpsilon();
|
||||
|
||||
// Get location of the plane as its barycenter
|
||||
gp_Pnt aLocation = BaryCenter(aPlane, aUMin, aUMax, aVMin, aVMax);
|
||||
|
@@ -154,7 +154,8 @@ public:
|
||||
//!< Internal parameters for transfer process
|
||||
struct DE_SectionGlobal
|
||||
{
|
||||
Standard_Real LengthUnit = 1.0; //!< Scale length unit value from MM, default 1.0 (MM)
|
||||
Standard_Real LengthUnit = 1.0; //!< Target Unit (scaling based on MM) for the transfer process, default 1.0 (MM)
|
||||
Standard_Real SystemUnit = 1.0; //!< System Unit (scaling based on MM) to be used when initial unit is unknown, default 1.0 (MM)
|
||||
} GlobalParameters;
|
||||
|
||||
private:
|
||||
|
@@ -290,6 +290,7 @@ Standard_Boolean DE_Wrapper::Load(const Handle(DE_ConfigurationContext)& theReso
|
||||
const Standard_Boolean theIsRecursive)
|
||||
{
|
||||
GlobalParameters.LengthUnit = theResource->RealVal("general.length.unit", GlobalParameters.LengthUnit, THE_CONFIGURATION_SCOPE());
|
||||
GlobalParameters.SystemUnit = theResource->RealVal("general.system.unit", GlobalParameters.SystemUnit, THE_CONFIGURATION_SCOPE());
|
||||
if (theIsRecursive)
|
||||
{
|
||||
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
|
||||
@@ -372,8 +373,10 @@ TCollection_AsciiString DE_Wrapper::Save(const Standard_Boolean theIsRecursive,
|
||||
aResult += "\n";
|
||||
}
|
||||
aResult += "!Global parameters. Used for all providers\n";
|
||||
aResult += "!Length scale unit value. Should be more the 0. Default value: 1.0(MM)\n";
|
||||
aResult += "!Length scale unit value. Should be more than 0. Default value: 1.0(MM)\n";
|
||||
aResult += THE_CONFIGURATION_SCOPE() + ".general.length.unit :\t " + GlobalParameters.LengthUnit + "\n";
|
||||
aResult += "!System unit value. Should be more than 0. Default value: 1.0(MM)\n";
|
||||
aResult += THE_CONFIGURATION_SCOPE() + ".general.system.unit :\t " + GlobalParameters.SystemUnit + "\n";
|
||||
if (theIsRecursive)
|
||||
{
|
||||
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
|
||||
|
@@ -108,7 +108,7 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs
|
||||
SMA--;
|
||||
const Standard_Real * PM = &ProfileMatrix->Value(1);
|
||||
PM--;
|
||||
|
||||
IsDecomp = Standard_False;
|
||||
for(j = 1; j <= RowNumber(); j++) {
|
||||
DiagAddr = profile(2, j);
|
||||
Kj = j - profile(1, j);
|
||||
@@ -118,7 +118,7 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs
|
||||
|
||||
a = PM[DiagAddr] - Sum;
|
||||
if(a < Eps) {
|
||||
return IsDecomp = Standard_False;// Matrix is not positive defined
|
||||
return Standard_False;// Matrix is not positive defined
|
||||
}
|
||||
a = Sqrt(a);
|
||||
SMA[DiagAddr] = a;
|
||||
@@ -139,7 +139,8 @@ FEmTool_ProfileMatrix::FEmTool_ProfileMatrix(const TColStd_Array1OfInteger& Firs
|
||||
SMA[CurrAddr] = (PM[CurrAddr] - Sum)/a;
|
||||
}
|
||||
}
|
||||
return IsDecomp = Standard_True;
|
||||
IsDecomp = Standard_True;
|
||||
return IsDecomp;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -99,7 +99,7 @@ GccAna_Lin2dTanPer::
|
||||
IntAna2d_AnaIntersection Intp(linsol(1),TheCircle);
|
||||
if (Intp.IsDone()) {
|
||||
if (!Intp.IsEmpty()) {
|
||||
Standard_Real maxdist = RealLast();
|
||||
constexpr Standard_Real maxdist = RealLast();
|
||||
for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
|
||||
if (Intp.Point(i).Value().Distance(ThePnt) < maxdist) {
|
||||
pntint2sol(1) = Intp.Point(i).Value();
|
||||
@@ -244,7 +244,7 @@ GccAna_Lin2dTanPer::
|
||||
IntAna2d_AnaIntersection Intp(linsol(NbrSol),TheCircle);
|
||||
if (Intp.IsDone()) {
|
||||
if (!Intp.IsEmpty()) {
|
||||
Standard_Real maxdist = RealLast();
|
||||
constexpr Standard_Real maxdist = RealLast();
|
||||
for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
|
||||
if (Intp.Point(i).Value().Distance(pnttg1sol(NbrSol)) < maxdist) {
|
||||
pntint2sol(NbrSol) = Intp.Point(i).Value();
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Gauss.hxx>
|
||||
|
||||
#include <array>
|
||||
|
||||
GeomConvert_CurveToAnaCurve::GeomConvert_CurveToAnaCurve():
|
||||
myGap(Precision::Infinite()),
|
||||
@@ -650,15 +651,15 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
||||
const GeomConvert_ConvType theConvType, const GeomAbs_CurveType theTarget)
|
||||
{
|
||||
cf = c1; cl = c2;
|
||||
Handle(Geom_Curve) c3d, newc3d[3];
|
||||
Standard_Integer i, imin = -1;
|
||||
c3d = theC3d;
|
||||
if (c3d.IsNull()) return newc3d[imin];
|
||||
std::array<Handle(Geom_Curve), 3> newc3d = {};
|
||||
Handle(Geom_Curve) c3d = theC3d;
|
||||
if (c3d.IsNull()) return c3d;
|
||||
gp_Pnt P1 = c3d->Value(c1);
|
||||
gp_Pnt P2 = c3d->Value(c2);
|
||||
gp_Pnt P3 = c3d->Value(c1 + (c2 - c1) / 2);
|
||||
Standard_Real d[3] = { RealLast(), RealLast(), RealLast() };
|
||||
Standard_Real fp[3], lp[3];
|
||||
std::array<Standard_Real, 3> d = { RealLast(), RealLast(), RealLast() };
|
||||
std::array<Standard_Real, 3> fp = {};
|
||||
std::array<Standard_Real, 3> lp = {};
|
||||
|
||||
if (c3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||
Handle(Geom_TrimmedCurve) aTc = Handle(Geom_TrimmedCurve)::DownCast(c3d);
|
||||
@@ -723,7 +724,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
||||
|
||||
// theConvType == GeomConvert_MinGap
|
||||
// recognition in case of small curve
|
||||
imin = -1;
|
||||
Standard_Integer imin = -1;
|
||||
if((P1.Distance(P2) < 2*tolerance) && (P1.Distance(P3) < 2*tolerance)) {
|
||||
newc3d[1] = ComputeCircle(c3d, tolerance, c1, c2, fp[1], lp[1], d[1]);
|
||||
newc3d[0] = ComputeLine(c3d, tolerance, c1, c2, fp[0], lp[0], d[0]);
|
||||
@@ -746,7 +747,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
||||
newc3d[2] = ComputeEllipse(c3d, tol, c1, c2, fp[2], lp[2], d[2]);
|
||||
}
|
||||
Standard_Real dd = RealLast();
|
||||
for (i = 0; i < 3; ++i)
|
||||
for (Standard_Integer i = 0; i < 3; ++i)
|
||||
{
|
||||
if (newc3d[i].IsNull()) continue;
|
||||
if (d[i] < dd)
|
||||
|
@@ -668,8 +668,8 @@ Bnd_Box Graphic3d_Structure::MinMaxValues (const Standard_Boolean theToIgnoreInf
|
||||
aResult.Update (aBox.CornerMin().x(), aBox.CornerMin().y(), aBox.CornerMin().z(),
|
||||
aBox.CornerMax().x(), aBox.CornerMax().y(), aBox.CornerMax().z());
|
||||
|
||||
Standard_Real aLimMin = ShortRealFirst() + 1.0;
|
||||
Standard_Real aLimMax = ShortRealLast() - 1.0;
|
||||
constexpr Standard_Real aLimMin = ShortRealFirst() + 1.0;
|
||||
constexpr Standard_Real aLimMax = ShortRealLast() - 1.0;
|
||||
gp_Pnt aMin = aResult.CornerMin();
|
||||
gp_Pnt aMax = aResult.CornerMax();
|
||||
if (aMin.X() < aLimMin && aMin.Y() < aLimMin && aMin.Z() < aLimMin
|
||||
@@ -847,8 +847,8 @@ void Graphic3d_Structure::Transforms (const gp_Trsf& theTrsf,
|
||||
const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
|
||||
Standard_Real& theNewX, Standard_Real& theNewY, Standard_Real& theNewZ)
|
||||
{
|
||||
const Standard_Real aRL = RealLast();
|
||||
const Standard_Real aRF = RealFirst();
|
||||
constexpr Standard_Real aRL = RealLast();
|
||||
constexpr Standard_Real aRF = RealFirst();
|
||||
theNewX = theX;
|
||||
theNewY = theY;
|
||||
theNewZ = theZ;
|
||||
|
@@ -1251,6 +1251,7 @@ bool Image_AlienPixMap::Save (Standard_Byte* theBuffer,
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
(void)theLength;
|
||||
if (theBuffer != NULL)
|
||||
{
|
||||
Message::SendFail ("Error: no image library available");
|
||||
@@ -1450,6 +1451,8 @@ bool Image_AlienPixMap::Save (std::ostream& theStream, const TCollection_AsciiSt
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
(void)theExtension;
|
||||
(void)theStream;
|
||||
Message::SendFail ("Error: no image library available");
|
||||
return false;
|
||||
#endif
|
||||
|
@@ -977,7 +977,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
fprm=aSeqFprm(i);
|
||||
lprm=aSeqLprm(i);
|
||||
//
|
||||
Standard_Real aRealEpsilon=RealEpsilon();
|
||||
constexpr Standard_Real aRealEpsilon=RealEpsilon();
|
||||
if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*M_PI) > aRealEpsilon) {
|
||||
//==============================================
|
||||
////
|
||||
|
@@ -89,8 +89,8 @@ void LocOpe_CSIntersector::Perform(const LocOpe_SequenceOfLin& Slin)
|
||||
myPoints =
|
||||
(LocOpe_SequenceOfPntFace *) new LocOpe_SequenceOfPntFace[myNbelem];
|
||||
|
||||
Standard_Real binf = RealFirst();
|
||||
Standard_Real bsup = RealLast();
|
||||
constexpr Standard_Real binf = RealFirst();
|
||||
constexpr Standard_Real bsup = RealLast();
|
||||
TopExp_Explorer exp(myShape,TopAbs_FACE);
|
||||
for (; exp.More(); exp.Next()) {
|
||||
const TopoDS_Face& theface = TopoDS::Face(exp.Current());
|
||||
|
@@ -50,6 +50,85 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(MeshVS_MeshPrsBuilder,MeshVS_PrsBuilder)
|
||||
|
||||
namespace
|
||||
{
|
||||
//================================================================
|
||||
// Function : ProcessFace
|
||||
// Purpose : Fill array with triangles for the face
|
||||
//================================================================
|
||||
static void ProcessFace(const Handle(MeshVS_HArray1OfSequenceOfInteger)& theTopo,
|
||||
const TColStd_Array1OfReal& theNodes,
|
||||
const Standard_Real* theCenter,
|
||||
const Standard_Real theShrinkCoef,
|
||||
const Standard_Boolean theIsShrinked,
|
||||
const Standard_Boolean theIsShaded,
|
||||
Handle(Graphic3d_ArrayOfPrimitives) theArray)
|
||||
{
|
||||
for (Standard_Integer aFaceIdx = theTopo->Lower(); aFaceIdx <= theTopo->Upper(); ++aFaceIdx)
|
||||
{
|
||||
const TColStd_SequenceOfInteger& aFaceNodes = theTopo->Value (aFaceIdx);
|
||||
const Standard_Integer aNbPolyNodes = aFaceNodes.Length();
|
||||
|
||||
Standard_Real* aPolyNodesBuf = (Standard_Real*) alloca ((3 * aNbPolyNodes + 1) * sizeof (Standard_Real));
|
||||
TColStd_Array1OfReal aPolyNodes (*aPolyNodesBuf, 0, 3 * aNbPolyNodes);
|
||||
|
||||
for (Standard_Integer aNodeIdx = 0; aNodeIdx < aNbPolyNodes; ++aNodeIdx)
|
||||
{
|
||||
Standard_Integer anIdx = aFaceNodes.Value (aNodeIdx + 1);
|
||||
|
||||
Standard_Real aX = theNodes.Value (theNodes.Lower() + 3 * anIdx + 0);
|
||||
Standard_Real aY = theNodes.Value (theNodes.Lower() + 3 * anIdx + 1);
|
||||
Standard_Real aZ = theNodes.Value (theNodes.Lower() + 3 * anIdx + 2);
|
||||
|
||||
if (theIsShrinked)
|
||||
{
|
||||
aX = theCenter[0] + theShrinkCoef * (aX - theCenter[0]);
|
||||
aY = theCenter[1] + theShrinkCoef * (aY - theCenter[1]);
|
||||
aZ = theCenter[2] + theShrinkCoef * (aZ - theCenter[2]);
|
||||
}
|
||||
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 1, aX);
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 2, aY);
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 3, aZ);
|
||||
}
|
||||
|
||||
gp_Vec aNorm;
|
||||
|
||||
if (theIsShaded)
|
||||
{
|
||||
aPolyNodes.SetValue (0, aNbPolyNodes);
|
||||
|
||||
if (!MeshVS_Tool::GetAverageNormal (aPolyNodes, aNorm))
|
||||
{
|
||||
aNorm.SetCoord (0.0, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer aNodeIdx = 0; aNodeIdx < aNbPolyNodes - 2; ++aNodeIdx) // triangulate polygon
|
||||
{
|
||||
for (Standard_Integer aSubIdx = 0; aSubIdx < 3; ++aSubIdx) // generate sub-triangle
|
||||
{
|
||||
if (theIsShaded)
|
||||
{
|
||||
theArray->AddVertex (aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 1),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 2),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 3),
|
||||
aNorm.X(),
|
||||
aNorm.Y(),
|
||||
aNorm.Z());
|
||||
}
|
||||
else
|
||||
{
|
||||
theArray->AddVertex (aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 1),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 2),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : Constructor MeshVS_MeshPrsBuilder
|
||||
// Purpose :
|
||||
@@ -838,68 +917,7 @@ void MeshVS_MeshPrsBuilder::AddVolumePrs (const Handle(MeshVS_HArray1OfSequenceO
|
||||
|
||||
if (aIsPolygons)
|
||||
{
|
||||
for (Standard_Integer aFaceIdx = theTopo->Lower(), topoup = theTopo->Upper(); aFaceIdx <= topoup; ++aFaceIdx)
|
||||
{
|
||||
const TColStd_SequenceOfInteger& aFaceNodes = theTopo->Value (aFaceIdx);
|
||||
const Standard_Integer aNbPolyNodes = aFaceNodes.Length();
|
||||
|
||||
Standard_Real* aPolyNodesBuf = (Standard_Real*) alloca ((3 * aNbPolyNodes + 1) * sizeof (Standard_Real));
|
||||
TColStd_Array1OfReal aPolyNodes (*aPolyNodesBuf, 0, 3 * aNbPolyNodes);
|
||||
|
||||
for (Standard_Integer aNodeIdx = 0; aNodeIdx < aNbPolyNodes; ++aNodeIdx)
|
||||
{
|
||||
Standard_Integer anIdx = aFaceNodes.Value (aNodeIdx + 1);
|
||||
|
||||
Standard_Real aX = theNodes.Value (aLow + 3 * anIdx + 0);
|
||||
Standard_Real aY = theNodes.Value (aLow + 3 * anIdx + 1);
|
||||
Standard_Real aZ = theNodes.Value (aLow + 3 * anIdx + 2);
|
||||
|
||||
if (theIsShrinked)
|
||||
{
|
||||
aX = aCenter[0] + theShrinkCoef * (aX - aCenter[0]);
|
||||
aY = aCenter[1] + theShrinkCoef * (aY - aCenter[1]);
|
||||
aZ = aCenter[2] + theShrinkCoef * (aZ - aCenter[2]);
|
||||
}
|
||||
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 1, aX);
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 2, aY);
|
||||
aPolyNodes.SetValue (3 * aNodeIdx + 3, aZ);
|
||||
}
|
||||
|
||||
gp_Vec aNorm;
|
||||
|
||||
if (theIsShaded)
|
||||
{
|
||||
aPolyNodes.SetValue (0, aNbPolyNodes);
|
||||
|
||||
if (!MeshVS_Tool::GetAverageNormal (aPolyNodes, aNorm))
|
||||
{
|
||||
aNorm.SetCoord (0.0, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer aNodeIdx = 0; aNodeIdx < aNbPolyNodes - 2; ++aNodeIdx) // triangulate polygon
|
||||
{
|
||||
for (Standard_Integer aSubIdx = 0; aSubIdx < 3; ++aSubIdx) // generate sub-triangle
|
||||
{
|
||||
if (theIsShaded)
|
||||
{
|
||||
theArray->AddVertex (aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 1),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 2),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 3),
|
||||
aNorm.X(),
|
||||
aNorm.Y(),
|
||||
aNorm.Z());
|
||||
}
|
||||
else
|
||||
{
|
||||
theArray->AddVertex (aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 1),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 2),
|
||||
aPolyNodes.Value (3 * (aSubIdx == 0 ? 0 : (aNodeIdx + aSubIdx)) + 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ProcessFace (theTopo, theNodes, aCenter, theShrinkCoef, theIsShrinked, theIsShaded, theArray);
|
||||
}
|
||||
else if (theIsSelected)
|
||||
{
|
||||
|
@@ -79,7 +79,8 @@ public:
|
||||
static inline Standard_Integer getNearestPow2( Standard_Integer theValue )
|
||||
{
|
||||
// Precaution against overflow
|
||||
Standard_Integer aHalfMax = IntegerLast() >> 1, aRes = 1;
|
||||
constexpr Standard_Integer aHalfMax = IntegerLast() >> 1;
|
||||
Standard_Integer aRes = 1;
|
||||
if ( theValue > aHalfMax ) theValue = aHalfMax;
|
||||
while ( aRes < theValue ) aRes <<= 1;
|
||||
return aRes;
|
||||
|
@@ -240,7 +240,7 @@ public: //! @name public methods
|
||||
}
|
||||
|
||||
//! Assignment operator
|
||||
NCollection_DynamicArray& operator= (NCollection_DynamicArray&& theOther)
|
||||
NCollection_DynamicArray& operator= (NCollection_DynamicArray&& theOther) noexcept
|
||||
{
|
||||
return Assign(std::forward<NCollection_DynamicArray>(theOther));
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ public:
|
||||
NCollection_UtfString (const NCollection_UtfString& theCopy);
|
||||
|
||||
//! Move constructor
|
||||
NCollection_UtfString (NCollection_UtfString&& theOther);
|
||||
NCollection_UtfString (NCollection_UtfString&& theOther) noexcept;
|
||||
|
||||
//! Copy constructor from UTF-8 string.
|
||||
//! @param theCopyUtf8 UTF-8 string to copy
|
||||
|
@@ -95,7 +95,7 @@ NCollection_UtfString<Type>::NCollection_UtfString (const NCollection_UtfString&
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
template<typename Type> inline
|
||||
NCollection_UtfString<Type>::NCollection_UtfString (NCollection_UtfString&& theOther)
|
||||
NCollection_UtfString<Type>::NCollection_UtfString (NCollection_UtfString&& theOther) noexcept
|
||||
: myString(theOther.myString),
|
||||
mySize (theOther.mySize),
|
||||
myLength(theOther.myLength)
|
||||
|
@@ -118,7 +118,7 @@ public:
|
||||
//! you can use :
|
||||
//! If ( Abs( D1.D2 ) < Precision::Angular() ) ...
|
||||
//! (although the function IsNormal does exist).
|
||||
static Standard_Real Angular() { return 1.e-12; }
|
||||
static constexpr Standard_Real Angular() { return 1.e-12; }
|
||||
|
||||
//! Returns the recommended precision value when
|
||||
//! checking coincidence of two points in real space.
|
||||
@@ -160,11 +160,11 @@ public:
|
||||
//! distance (1 / 10 millimeter). This distance
|
||||
//! becomes easily measurable, but only within a restricted
|
||||
//! space which contains some small objects of the complete scene.
|
||||
static Standard_Real Confusion() { return 1.e-7; }
|
||||
static constexpr Standard_Real Confusion() { return 1.e-7; }
|
||||
|
||||
//! Returns square of Confusion.
|
||||
//! Created for speed and convenience.
|
||||
static Standard_Real SquareConfusion() { return Confusion() * Confusion(); }
|
||||
static constexpr Standard_Real SquareConfusion() { return Confusion() * Confusion(); }
|
||||
|
||||
//! Returns the precision value in real space, frequently
|
||||
//! used by intersection algorithms to decide that a solution is reached.
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
//! The tolerance of intersection is equal to :
|
||||
//! Precision::Confusion() / 100.
|
||||
//! (that is, 1.e-9).
|
||||
static Standard_Real Intersection() { return Confusion() * 0.01; }
|
||||
static constexpr Standard_Real Intersection() { return Confusion() * 0.01; }
|
||||
|
||||
//! Returns the precision value in real space, frequently used
|
||||
//! by approximation algorithms.
|
||||
@@ -203,14 +203,14 @@ public:
|
||||
//! (that is, 1.e-6).
|
||||
//! You may use a smaller tolerance in an approximation
|
||||
//! algorithm, but this option might be costly.
|
||||
static Standard_Real Approximation() { return Confusion() * 10.0; }
|
||||
static constexpr Standard_Real Approximation() { return Confusion() * 10.0; }
|
||||
|
||||
//! Convert a real space precision to a parametric
|
||||
//! space precision. <T> is the mean value of the
|
||||
//! length of the tangent of the curve or the surface.
|
||||
//!
|
||||
//! Value is P / T
|
||||
static Standard_Real Parametric (const Standard_Real P, const Standard_Real T) { return P / T; }
|
||||
static inline Standard_Real Parametric (const Standard_Real P, const Standard_Real T) { return P / T; }
|
||||
|
||||
//! Returns a precision value in parametric space, which may be used :
|
||||
//! - to test the coincidence of two points in the real space,
|
||||
@@ -256,11 +256,11 @@ public:
|
||||
//! 2.Pi without impacting on the resulting point.
|
||||
//! Therefore, take great care when adjusting a parametric
|
||||
//! tolerance to your own algorithm.
|
||||
static Standard_Real PConfusion (const Standard_Real T) { return Parametric (Confusion(), T); }
|
||||
static inline Standard_Real PConfusion (const Standard_Real T) { return Parametric (Confusion(), T); }
|
||||
|
||||
//! Returns square of PConfusion.
|
||||
//! Created for speed and convenience.
|
||||
static Standard_Real SquarePConfusion() { return PConfusion() * PConfusion(); }
|
||||
static constexpr Standard_Real SquarePConfusion() { return PConfusion() * PConfusion(); }
|
||||
|
||||
//! Returns a precision value in parametric space, which
|
||||
//! may be used by intersection algorithms, to decide that
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
//! segment whose length is equal to 100. (default value), or T.
|
||||
//! The parametric tolerance of intersection is equal to :
|
||||
//! - Precision::Intersection() / 100., or Precision::Intersection() / T.
|
||||
static Standard_Real PIntersection (const Standard_Real T) { return Parametric(Intersection(),T); }
|
||||
static inline Standard_Real PIntersection (const Standard_Real T) { return Parametric(Intersection(),T); }
|
||||
|
||||
//! Returns a precision value in parametric space, which may
|
||||
//! be used by approximation algorithms. The purpose of this
|
||||
@@ -290,47 +290,47 @@ public:
|
||||
//! segment whose length is equal to 100. (default value), or T.
|
||||
//! The parametric tolerance of intersection is equal to :
|
||||
//! - Precision::Approximation() / 100., or Precision::Approximation() / T.
|
||||
static Standard_Real PApproximation (const Standard_Real T) { return Parametric(Approximation(),T); }
|
||||
static inline Standard_Real PApproximation (const Standard_Real T) { return Parametric(Approximation(),T); }
|
||||
|
||||
//! Convert a real space precision to a parametric
|
||||
//! space precision on a default curve.
|
||||
//!
|
||||
//! Value is Parametric(P,1.e+2)
|
||||
static Standard_Real Parametric (const Standard_Real P) { return Parametric (P, 100.0); }
|
||||
static inline Standard_Real Parametric (const Standard_Real P) { return P * 0.01; }
|
||||
|
||||
//! Used to test distances in parametric space on a
|
||||
//! default curve.
|
||||
//!
|
||||
//! This is Precision::Parametric(Precision::Confusion())
|
||||
static Standard_Real PConfusion() { return Parametric (Confusion()); }
|
||||
static constexpr Standard_Real PConfusion() { return Confusion() * 0.01; }
|
||||
|
||||
//! Used for Intersections in parametric space on a
|
||||
//! default curve.
|
||||
//!
|
||||
//! This is Precision::Parametric(Precision::Intersection())
|
||||
static Standard_Real PIntersection() { return Parametric (Intersection()); }
|
||||
static constexpr Standard_Real PIntersection() { return Intersection() * 0.01; }
|
||||
|
||||
//! Used for Approximations in parametric space on a
|
||||
//! default curve.
|
||||
//!
|
||||
//! This is Precision::Parametric(Precision::Approximation())
|
||||
static Standard_Real PApproximation() { return Parametric (Approximation()); }
|
||||
static constexpr Standard_Real PApproximation() { return Approximation() * 0.01; }
|
||||
|
||||
//! Returns True if R may be considered as an infinite
|
||||
//! number. Currently Abs(R) > 1e100
|
||||
static Standard_Boolean IsInfinite (const Standard_Real R) { return Abs (R) >= (0.5 * Precision::Infinite()); }
|
||||
static inline Standard_Boolean IsInfinite (const Standard_Real R) { return Abs (R) >= (0.5 * Precision::Infinite()); }
|
||||
|
||||
//! Returns True if R may be considered as a positive
|
||||
//! infinite number. Currently R > 1e100
|
||||
static Standard_Boolean IsPositiveInfinite (const Standard_Real R) { return R >= (0.5 * Precision::Infinite()); }
|
||||
static inline Standard_Boolean IsPositiveInfinite (const Standard_Real R) { return R >= (0.5 * Precision::Infinite()); }
|
||||
|
||||
//! Returns True if R may be considered as a negative
|
||||
//! infinite number. Currently R < -1e100
|
||||
static Standard_Boolean IsNegativeInfinite (const Standard_Real R) { return R <= -(0.5 * Precision::Infinite()); }
|
||||
static inline Standard_Boolean IsNegativeInfinite (const Standard_Real R) { return R <= -(0.5 * Precision::Infinite()); }
|
||||
|
||||
//! Returns a big number that can be considered as
|
||||
//! infinite. Use -Infinite() for a negative big number.
|
||||
static Standard_Real Infinite() { return 2.e+100; }
|
||||
static constexpr Standard_Real Infinite() { return 2.e+100; }
|
||||
|
||||
};
|
||||
|
||||
|
@@ -2187,10 +2187,20 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
di << "(Integer) Overflow...";
|
||||
//std::cout.flush();
|
||||
di << "\n";
|
||||
Standard_Integer res, i=IntegerLast();
|
||||
res = i + 1;
|
||||
//++++ std::cout << " -- "<<res<<"="<<i<<"+1 Does not Caught... KO"<< std::endl;
|
||||
//++++ Succes = Standard_False;
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Winteger-overflow"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Woverflow"
|
||||
#endif
|
||||
constexpr Standard_Integer i=IntegerLast();
|
||||
Standard_Integer res = i + 1;
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
di << "Not caught: " << i << " + 1 = " << res << ", still OK\n";
|
||||
}
|
||||
catch(Standard_Overflow const&) {
|
||||
@@ -2212,8 +2222,8 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
di << "(Real) Overflow...";
|
||||
//std::cout.flush();
|
||||
di << "\n";
|
||||
Standard_Real res, r=RealLast();
|
||||
res = r * r;
|
||||
constexpr Standard_Real r = RealLast();
|
||||
Standard_Real res = r * r;
|
||||
|
||||
(void)sin(1.); //this function tests FPU flags and raises signal (tested on LINUX).
|
||||
|
||||
@@ -2244,8 +2254,8 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
di << "(Real) Underflow";
|
||||
//std::cout.flush();
|
||||
di << "\n";
|
||||
Standard_Real res, r = RealSmall();
|
||||
res = r * r;
|
||||
constexpr Standard_Real r = RealSmall();
|
||||
Standard_Real res = r * r;
|
||||
//res = res + 1.;
|
||||
//++++ std::cout<<"-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... KO"<<std::endl;
|
||||
//++++ Succes = Standard_False;
|
||||
@@ -4540,7 +4550,7 @@ Standard_Integer OCC17424 (Draw_Interpretor& di, Standard_Integer argc, const ch
|
||||
gp_Dir dir(X_Dir, Y_Dir, Z_Dir);
|
||||
gp_Lin ray(origin, dir);
|
||||
|
||||
Standard_Real PSup = RealLast();
|
||||
constexpr Standard_Real PSup = RealLast();
|
||||
intersector.PerformNearest(ray, PInf, PSup);
|
||||
if (intersector.NbPnt() != 0)
|
||||
{
|
||||
|
@@ -140,9 +140,20 @@ bool RWGltf_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
Handle(RWGltf_ConfigurationNode) aNode = Handle(RWGltf_ConfigurationNode)::DownCast(GetNode());
|
||||
|
||||
RWMesh_CoordinateSystemConverter aConverter;
|
||||
aConverter.SetInputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000);
|
||||
Standard_Real aScaleFactorM = 1.;
|
||||
if (!XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorM))
|
||||
{
|
||||
aConverter.SetInputLengthUnit(aNode->GlobalParameters.SystemUnit / 1000.);
|
||||
Message::SendWarning() << "Warning in the RWGltf_Provider during writing the file " <<
|
||||
thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
|
||||
}
|
||||
aConverter.SetInputCoordinateSystem(aNode->InternalParameters.SystemCS);
|
||||
aConverter.SetOutputLengthUnit(aNode->InternalParameters.FileLengthUnit);
|
||||
if (aNode->GlobalParameters.LengthUnit != 1000.)
|
||||
{
|
||||
Message::SendWarning() << "Warning in the RWGltf_Provider during writing the file " <<
|
||||
thePath << "\t: Target format doesn't support custom units. Model will be scaled to Meters";
|
||||
}
|
||||
aConverter.SetOutputLengthUnit(1.); // gltf units always Meters
|
||||
aConverter.SetOutputCoordinateSystem(aNode->InternalParameters.FileCS);
|
||||
|
||||
TColStd_IndexedDataMapOfStringString aFileInfo;
|
||||
|
@@ -110,10 +110,6 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
return false;
|
||||
}
|
||||
Handle(STEPCAFControl_ConfigurationNode) aNode = Handle(STEPCAFControl_ConfigurationNode)::DownCast(GetNode());
|
||||
|
||||
XCAFDoc_DocumentTool::SetLengthUnit(theDocument,
|
||||
UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit,
|
||||
UnitsMethods_LengthUnit_Millimeter), UnitsMethods_LengthUnit_Millimeter);
|
||||
personizeWS(theWS);
|
||||
STEPCAFControl_Writer aWriter;
|
||||
aWriter.Init(theWS);
|
||||
@@ -124,9 +120,22 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
aWriter.SetNameMode(aNode->InternalParameters.WriteName);
|
||||
aWriter.SetLayerMode(aNode->InternalParameters.WriteLayer);
|
||||
aWriter.SetPropsMode(aNode->InternalParameters.WriteProps);
|
||||
|
||||
TDF_Label aLabel;
|
||||
StepData_ConfParameters aParams;
|
||||
Standard_Real aScaleFactorMM = 1.;
|
||||
if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
|
||||
{
|
||||
aModel->SetLocalLengthUnit(aScaleFactorMM);
|
||||
}
|
||||
else
|
||||
{
|
||||
aModel->SetLocalLengthUnit(aNode->GlobalParameters.SystemUnit);
|
||||
Message::SendWarning() << "Warning in the STEPCAFControl_Provider during writing the file " <<
|
||||
thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
|
||||
}
|
||||
UnitsMethods_LengthUnit aTargetUnit = UnitsMethods::GetLengthUnitByFactorValue(aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
|
||||
aParams.WriteUnit = aTargetUnit;
|
||||
aModel->SetWriteLengthUnit(aNode->GlobalParameters.LengthUnit);
|
||||
TDF_Label aLabel;
|
||||
if (!aWriter.Transfer(theDocument, aParams, aMode, 0, theProgress))
|
||||
{
|
||||
Message::SendFail() << "Error in the STEPCAFControl_Provider during writing the file " <<
|
||||
@@ -242,9 +251,20 @@ bool STEPCAFControl_Provider::Write(const TCollection_AsciiString& thePath,
|
||||
STEPControl_Writer aWriter;
|
||||
aWriter.SetWS(theWS);
|
||||
IFSelect_ReturnStatus aWritestat = IFSelect_RetVoid;
|
||||
Handle(StepData_StepModel) aModel = aWriter.Model();
|
||||
aModel->SetWriteLengthUnit(UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit, UnitsMethods_LengthUnit_Millimeter));
|
||||
Handle(StepData_StepModel) aModel = aWriter.Model();;
|
||||
StepData_ConfParameters aParams;
|
||||
aModel->SetLocalLengthUnit(aNode->GlobalParameters.SystemUnit);
|
||||
UnitsMethods_LengthUnit aTargetUnit = UnitsMethods::GetLengthUnitByFactorValue(aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
|
||||
aParams.WriteUnit = aTargetUnit;
|
||||
if (aTargetUnit == UnitsMethods_LengthUnit_Undefined)
|
||||
{
|
||||
aModel->SetWriteLengthUnit(1.0);
|
||||
Message::SendWarning() << "Custom units are not supported by STEP format, but LengthUnit global parameter doesn't fit any predefined unit. Units will be scaled to Millimeters";
|
||||
}
|
||||
else
|
||||
{
|
||||
aModel->SetWriteLengthUnit(aNode->GlobalParameters.LengthUnit);
|
||||
}
|
||||
aWritestat = aWriter.Transfer(theShape, aNode->InternalParameters.WriteModelType, aParams, true, theProgress);
|
||||
if (aWritestat != IFSelect_RetDone)
|
||||
{
|
||||
|
@@ -142,11 +142,7 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
|
||||
res = ApplyModifier (shape, M, context, MD, aRange, aReShape);
|
||||
}
|
||||
|
||||
if ( !res.IsSame (shape) )
|
||||
{
|
||||
context.Bind (aShapeNoLoc, res.Located (TopLoc_Location()));
|
||||
locModified = Standard_True;
|
||||
}
|
||||
locModified |= !res.IsSame (shape);
|
||||
|
||||
B.Add (C, res);
|
||||
}
|
||||
@@ -162,10 +158,18 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
|
||||
return S;
|
||||
}
|
||||
|
||||
context.Bind ( SF, C );
|
||||
SF.Orientation (S.Orientation());
|
||||
C .Orientation (S.Orientation());
|
||||
|
||||
context.Bind (SF, C);
|
||||
|
||||
C.Location (S.Location(), Standard_False);
|
||||
|
||||
if (!aReShape.IsNull())
|
||||
{
|
||||
aReShape->Replace (S, C);
|
||||
}
|
||||
|
||||
C.Orientation (S.Orientation());
|
||||
C.Location (S.Location(), Standard_False);
|
||||
return C;
|
||||
}
|
||||
|
||||
@@ -175,12 +179,21 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
|
||||
MD.Perform(M, aPS.Next());
|
||||
|
||||
if ( !aPS.More() || !MD.IsDone() ) return S;
|
||||
|
||||
TopoDS_Shape aResult = MD.ModifiedShape (SF);
|
||||
aResult.Orientation (S.Orientation());
|
||||
|
||||
if (!SF.IsSame (aResult))
|
||||
{
|
||||
context.Bind (S.Located (TopLoc_Location()), aResult.Located (TopLoc_Location()));
|
||||
}
|
||||
|
||||
if ( !aReShape.IsNull() )
|
||||
{
|
||||
UpdateShapeBuild ( SF, MD, aReShape );
|
||||
}
|
||||
|
||||
return MD.ModifiedShape(SF).Oriented(S.Orientation());
|
||||
return aResult;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -60,9 +60,8 @@ constexpr Standard_ShortReal ShortRealEpsilon()
|
||||
//-------------------------------------------------------------------
|
||||
// ShortRealFirst : Returns the minimum negative value of a ShortReal
|
||||
//-------------------------------------------------------------------
|
||||
inline Standard_ShortReal ShortRealFirst()
|
||||
{ Standard_ShortReal MaxFloatTmp = -FLT_MAX;
|
||||
return MaxFloatTmp; }
|
||||
constexpr Standard_ShortReal ShortRealFirst()
|
||||
{ return -FLT_MAX; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// ShortRealFirst10Exp : Returns the minimum value of exponent(base 10) of
|
||||
|
@@ -562,40 +562,54 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getCylinderCircles
|
||||
//function : getCylinderHeight
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static NCollection_Array1<gp_Circ> getCylinderCircles (const TopoDS_Face& theHollowCylinder, Standard_Size& theNumCircles)
|
||||
static Standard_Real getCylinderHeight (const Handle(Poly_Triangulation)& theTriangulation,
|
||||
const TopLoc_Location& theLoc)
|
||||
{
|
||||
NCollection_Array1<gp_Circ> aCircles (1, 2);
|
||||
theNumCircles = 0;
|
||||
Standard_Integer aLinesNb = 0;
|
||||
Bnd_Box aBox;
|
||||
gp_Trsf aScaleTrsf;
|
||||
aScaleTrsf.SetScaleFactor (theLoc.Transformation().ScaleFactor());
|
||||
theTriangulation->MinMax (aBox, aScaleTrsf);
|
||||
return aBox.CornerMax().Z() - aBox.CornerMin().Z();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : isCylinderOrCone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean isCylinderOrCone (const TopoDS_Face& theHollowCylinder, const gp_Pnt& theLocation, gp_Dir& theDirection)
|
||||
{
|
||||
Standard_Integer aCirclesNb = 0;
|
||||
Standard_Boolean isCylinder = Standard_False;
|
||||
gp_Pnt aPos;
|
||||
|
||||
TopExp_Explorer anEdgeExp;
|
||||
for (anEdgeExp.Init (theHollowCylinder, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (anEdgeExp.Current());
|
||||
BRepAdaptor_Curve anAdaptor (anEdge);
|
||||
aLinesNb++;
|
||||
|
||||
if (anAdaptor.GetType() == GeomAbs_Circle
|
||||
&& BRep_Tool::IsClosed (anEdge))
|
||||
{
|
||||
theNumCircles++;
|
||||
aCircles[theNumCircles] = anAdaptor.Circle();
|
||||
}
|
||||
else if (anAdaptor.GetType() != GeomAbs_Line || aLinesNb > 4)
|
||||
{
|
||||
theNumCircles = 0;
|
||||
return NCollection_Array1<gp_Circ>();
|
||||
}
|
||||
if (theNumCircles == 2)
|
||||
{
|
||||
break;
|
||||
aCirclesNb++;
|
||||
isCylinder = Standard_True;
|
||||
if (aCirclesNb == 2)
|
||||
{
|
||||
// Reverse the direction of the cylinder, relevant if the cylinder was created as a prism
|
||||
if (aPos.IsEqual (theLocation, Precision::Confusion()))
|
||||
{
|
||||
theDirection.Reverse();
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
aPos = anAdaptor.Circle().Location().XYZ();
|
||||
}
|
||||
}
|
||||
|
||||
return aCircles;
|
||||
return isCylinder;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -644,33 +658,29 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_
|
||||
}
|
||||
else if (Handle(Geom_ConicalSurface) aGeomCone = Handle(Geom_ConicalSurface)::DownCast (aSurf))
|
||||
{
|
||||
Standard_Size aNumCircles;
|
||||
NCollection_Array1<gp_Circ> aCircles = getCylinderCircles (theFace, aNumCircles);
|
||||
if (aNumCircles > 0 && aNumCircles < 3)
|
||||
gp_Dir aDummyDir;
|
||||
if (isCylinderOrCone (theFace, gp_Pnt(), aDummyDir))
|
||||
{
|
||||
const gp_Cone aCone = BRepAdaptor_Surface (theFace).Cone();
|
||||
const Standard_Real aRad1 = aCone.RefRadius();
|
||||
const Standard_Real aHeight = getCylinderHeight (aTriangulation, aLoc);
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
Standard_Real aRad1;
|
||||
aTrsf.SetTransformation (aCone.Position(), gp::XOY());
|
||||
|
||||
Standard_Real aRad2;
|
||||
Standard_Real aHeight;
|
||||
if (aNumCircles == 1)
|
||||
if (aRad1 == 0.0)
|
||||
{
|
||||
aRad1 = 0.0;
|
||||
aRad2 = aCircles.First().Radius();
|
||||
aHeight = aRad2 * Tan (aCone.SemiAngle());
|
||||
aTrsf.SetTransformation (aCone.Position(), gp::XOY());
|
||||
aRad2 = Tan (aCone.SemiAngle()) * aHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
aRad1 = aCircles.First().Radius();
|
||||
aRad2 = aCircles.Last().Radius();
|
||||
aHeight = aCircles.First().Location().Distance (aCircles.Last().Location());
|
||||
|
||||
const gp_Pnt aPos = aCircles.First().Location();
|
||||
const gp_Dir aDirection (aCircles.Last().Location().XYZ() - aPos.XYZ());
|
||||
|
||||
aTrsf.SetTransformation (gp_Ax3(aPos, aDirection), gp::XOY());
|
||||
const Standard_Real aTriangleHeight = (aCone.SemiAngle() > 0.0)
|
||||
? aRad1 / Tan (aCone.SemiAngle())
|
||||
: aRad1 / Tan (Abs (aCone.SemiAngle())) - aHeight;
|
||||
aRad2 = (aCone.SemiAngle() > 0.0)
|
||||
? aRad1 * (aTriangleHeight + aHeight) / aTriangleHeight
|
||||
: aRad1 * aTriangleHeight / (aTriangleHeight + aHeight);
|
||||
}
|
||||
|
||||
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad1, aRad2, aHeight, aTrsf, true);
|
||||
@@ -680,19 +690,18 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_
|
||||
}
|
||||
else if (Handle(Geom_CylindricalSurface) aGeomCyl = Handle(Geom_CylindricalSurface)::DownCast (aSurf))
|
||||
{
|
||||
Standard_Size aNumCircles;
|
||||
NCollection_Array1<gp_Circ> aCircles = getCylinderCircles (theFace, aNumCircles);
|
||||
if (aNumCircles == 2)
|
||||
{
|
||||
const gp_Cylinder aCyl = BRepAdaptor_Surface (theFace).Cylinder();
|
||||
const gp_Cylinder aCyl = BRepAdaptor_Surface (theFace).Cylinder();
|
||||
gp_Ax3 aPos = aCyl.Position();
|
||||
gp_Dir aDirection = aPos.Direction();
|
||||
|
||||
if (isCylinderOrCone (theFace, aPos.Location(), aDirection))
|
||||
{
|
||||
const Standard_Real aRad = aCyl.Radius();
|
||||
const gp_Pnt aPos = aCircles.First().Location();
|
||||
const gp_Dir aDirection (aCircles.Last().Location().XYZ() - aPos.XYZ());
|
||||
const Standard_Real aHeight = aPos.Distance (aCircles.Last().Location());
|
||||
const Standard_Real aHeight = getCylinderHeight (aTriangulation, aLoc);
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetTransformation (gp_Ax3 (aPos, aDirection), gp::XOY());
|
||||
aPos.SetDirection (aDirection);
|
||||
aTrsf.SetTransformation (aPos, gp::XOY());
|
||||
|
||||
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad, aRad, aHeight, aTrsf, true);
|
||||
theSensitiveList.Append (aSensSCyl);
|
||||
|
@@ -312,7 +312,7 @@ void TopOpeBRep_FacesFiller::ProcessSectionEdges()
|
||||
|
||||
// ajout des aretes de section dans la DS de shape,connaissant leur rank
|
||||
for (itLES.Initialize(LES),itLOI.Initialize(LOI);
|
||||
itLES.More(),itLOI.More();
|
||||
itLES.More() && itLOI.More();
|
||||
itLES.Next(),itLOI.Next()) {
|
||||
const TopoDS_Shape& E1 = itLES.Value();
|
||||
Standard_Integer rE1 = itLOI.Value();
|
||||
|
@@ -566,7 +566,8 @@ Standard_Real TopOpeBRepTool_ShapeTool::EdgeData
|
||||
C = BL.Curvature();
|
||||
|
||||
// xpu150399 cto900R4
|
||||
Standard_Real tol1 = Epsilon(0.), tol2 = RealLast();
|
||||
const Standard_Real tol1 = Epsilon(0.);
|
||||
constexpr Standard_Real tol2 = RealLast();
|
||||
Standard_Real tolm = Max(tol,Max(tol1,tol2));
|
||||
|
||||
if ( Abs(C) > tolm ) BL.Normal(N);
|
||||
|
@@ -134,9 +134,6 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
if ( count < 2 ) isSeam = Standard_False;
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
|
||||
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
|
||||
|
||||
if (aEdge.Orientation() == TopAbs_INTERNAL ||
|
||||
aEdge.Orientation() == TopAbs_EXTERNAL ) {
|
||||
Handle(TransferBRep_ShapeMapper) errShape =
|
||||
@@ -184,7 +181,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
// ---------------------------------------
|
||||
// Translate 3D representation of the Edge
|
||||
// ---------------------------------------
|
||||
|
||||
BRepAdaptor_Curve CA = BRepAdaptor_Curve(aEdge);
|
||||
Handle(StepGeom_Curve) Gpms;
|
||||
Handle(Geom_Curve) C = CA.Curve().Curve();
|
||||
|
||||
@@ -262,6 +259,8 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "Warning: TopoDSToStep_MakeStepEdge: edge without 3d curve; creating..." << std::endl;
|
||||
#endif
|
||||
BRepAdaptor_Surface SA = BRepAdaptor_Surface(aTool.CurrentFace());
|
||||
|
||||
if ((SA.GetType() == GeomAbs_Plane) &&
|
||||
(CA.GetType() == GeomAbs_Line)) {
|
||||
U1 = CA.FirstParameter();
|
||||
|
@@ -12619,8 +12619,7 @@ static int VManipulator (Draw_Interpretor& theDi,
|
||||
{
|
||||
anAttachOptions.SetAdjustSize (Draw::ParseOnOffNoIterator (theArgsNb, theArgVec, anArgIter) ? 1 : 0);
|
||||
}
|
||||
else if (anArg == "-enablemodes"
|
||||
|| anArg == "-enablemodes")
|
||||
else if (anArg == "-enablemodes")
|
||||
{
|
||||
anAttachOptions.SetEnableModes (Draw::ParseOnOffNoIterator (theArgsNb, theArgVec, anArgIter) ? 1 : 0);
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F,
|
||||
return;
|
||||
}
|
||||
// Modified by Sergey KHROMOV - Wed Jan 22 12:06:45 2003 Begin
|
||||
Standard_Real aFTol = RealEpsilon();
|
||||
constexpr Standard_Real aFTol = RealEpsilon();
|
||||
|
||||
// if(fl * fh >= 0.0) {
|
||||
if(fl * fh > aFTol*aFTol) {
|
||||
|
@@ -15,6 +15,7 @@ global.priority.XCAF : OCC
|
||||
global.priority.IGES : OCC
|
||||
global.priority.PLY : OCC
|
||||
global.general.length.unit : 1
|
||||
global.general.system.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
|
@@ -15,6 +15,7 @@ global.priority.XCAF : OCC
|
||||
global.priority.IGES : OCC
|
||||
global.priority.PLY : OCC
|
||||
global.general.length.unit : 1
|
||||
global.general.system.unit : 1
|
||||
provider.STEP.OCC.read.iges.bspline.continuity : 1
|
||||
provider.STEP.OCC.read.precision.mode : 0
|
||||
provider.STEP.OCC.read.precision.val : 0.0001
|
||||
|
@@ -20,15 +20,7 @@ if [catch {ReadGltf D0 $filename} catch_result] {
|
||||
}
|
||||
XGetOneShape S0 D0
|
||||
|
||||
param xstep.cascade.unit M
|
||||
if [catch {ReadGltf D1 $filename} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
XGetOneShape S1 D1
|
||||
|
||||
if [catch {WriteFile D0 $write_path -conf "provider.GLTF.OCC.file.length.unit : 0.001 "} catch_result] {
|
||||
if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -50,29 +42,7 @@ if [catch {readfile S3 $write_path} catch_result] {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {WriteFile D1 $write_path -conf "provider.GLTF.OCC.file.length.unit : 1 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
}
|
||||
if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {writefile S1 $write_path} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
}
|
||||
if [catch {readfile S5 $write_path} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {WriteFile D0 $write_path -conf "provider.GLTF.OCC.file.length.unit : 0.001 "} catch_result] {
|
||||
if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -84,7 +54,37 @@ if [catch {ReadFile D6 $write_path -conf "global.general.length.unit : 1 "} catc
|
||||
}
|
||||
XGetOneShape S6 D6
|
||||
|
||||
if [catch {writefile S1 $write_path -conf "provider.GLTF.OCC.file.length.unit : 1 "} catch_result] {
|
||||
param xstep.cascade.unit M
|
||||
if [catch {ReadGltf D1 $filename} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
XGetOneShape S1 D1
|
||||
|
||||
if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
}
|
||||
if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {writefile S1 $write_path -conf "global.general.system.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
}
|
||||
if [catch {readfile S5 $write_path} catch_result] {
|
||||
puts "Error : Problem with reading file"
|
||||
} else {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {writefile S1 $write_path -conf "global.general.length.unit : 1000 \n global.general.system.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -96,7 +96,7 @@ if [catch {ReadFile D7 $write_path -conf "global.general.length.unit : 1000 "} c
|
||||
}
|
||||
XGetOneShape S7 D7
|
||||
|
||||
array set areas {0 3.18785e+06 1 3.18785 2 3.18785e+06 3 3.18785e+06 4 3.18785 5 3.18785 6 3.18785e+06 7 3.18785e-06}
|
||||
array set areas {0 3.18785e+06 1 3.18785 2 3.18785e+06 3 3.18785e+06 4 3.18785 5 3.18785e+06 6 3.18785e+06 7 3.18785}
|
||||
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
|
||||
for { set anind 0} { $anind < 8 } { incr anind } {
|
||||
checkprops $results($anind) -s $areas($anind) -eps 1e-2
|
||||
|
@@ -30,7 +30,7 @@ XGetOneShape S1 D1
|
||||
|
||||
param xstep.cascade.unit MM
|
||||
|
||||
if [catch {WriteFile D0 $write_path -conf "provider.STEP.write.step.unit : 1 "} catch_result] {
|
||||
if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -41,7 +41,7 @@ if [catch {readfile S2 $write_path } catch_result] {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {writefile S0 $write_path } catch_result] {
|
||||
if [catch {writefile S0 $write_path -conf "global.general.system.unit : 1 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -52,7 +52,7 @@ if [catch {readfile S3 $write_path} catch_result] {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {WriteFile D1 $write_path -conf "provider.STEP.write.step.unit : 6 "} catch_result] {
|
||||
if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -74,7 +74,7 @@ if [catch {readfile S5 $write_path} catch_result] {
|
||||
puts "OK : Reading is correct"
|
||||
}
|
||||
|
||||
if [catch {WriteFile D0 $write_path -conf "provider.STEP.write.step.unit : 2 "} catch_result] {
|
||||
if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -86,7 +86,7 @@ if [catch {ReadFile D6 $write_path -conf "global.general.length.unit : 1 "} catc
|
||||
}
|
||||
XGetOneShape S6 D6
|
||||
|
||||
if [catch {writefile S1 $write_path -conf "provider.STEP.write.step.unit : 1 "} catch_result] {
|
||||
if [catch {writefile S1 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
|
||||
puts "Error : Problem with writing file"
|
||||
} else {
|
||||
puts "OK : Writing is correct"
|
||||
@@ -98,7 +98,7 @@ if [catch {ReadFile D7 $write_path -conf "global.general.length.unit : 0.0254"}
|
||||
}
|
||||
XGetOneShape S7 D7
|
||||
|
||||
array set areas {0 2.52381e+06 1 2.52381 2 2.52381e+06 3 2.52381e+06 4 2.52381 5 2.52381 6 2.52381e+06 7 3911.92}
|
||||
array set areas {0 2.52381e+06 1 2.52381 2 2.52381e+06 3 2.52381e+06 4 2.52381e+06 5 2.52381 6 2.52381e+06 7 3911.92}
|
||||
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
|
||||
for { set anind 0} { $anind < 8 } { incr anind } {
|
||||
checkprops $results($anind) -s $areas($anind) -eps 1e-2
|
||||
|
@@ -1,21 +0,0 @@
|
||||
puts "============"
|
||||
puts "0033664: Visualization - Selection does not work for simple shape"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
restore [locate_data_file cylinder_surface.brep] b
|
||||
vdisplay -dispMode 1 b
|
||||
vfit
|
||||
vsensdis
|
||||
|
||||
vselect 200 200
|
||||
if {[vnbselected] != "1"} {
|
||||
puts "ERROR: wrong sensitive area"
|
||||
}
|
||||
|
||||
vselect 0 0
|
||||
vdump $::imagedir/${::casename}_cylinder.png
|
@@ -1,36 +0,0 @@
|
||||
puts "============"
|
||||
puts "0033664: Visualization - Selection does not work for simple shape"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
|
||||
pcone c1 50 100 100
|
||||
ttranslate c1 100 0 100
|
||||
explode c1
|
||||
explode c1_1
|
||||
|
||||
pcone c2 100 50 100
|
||||
ttranslate c2 -100 0 100
|
||||
explode c2
|
||||
explode c2_1
|
||||
|
||||
pcone c3 0 100 100
|
||||
ttranslate c3 100 0 -100
|
||||
explode c3
|
||||
explode c3_1
|
||||
|
||||
pcone c4 100 0 100
|
||||
ttranslate c4 -100 0 -100
|
||||
explode c4
|
||||
explode c4_1
|
||||
|
||||
vdisplay c1_1_1 c2_1_1 c3_1_1 c4_1_1 -dispmode 1
|
||||
vsensdis
|
||||
|
||||
vfront
|
||||
vfit
|
||||
|
||||
vdump $::imagedir/${::casename}_cone.png
|
Reference in New Issue
Block a user