From d5a49116a692e4b563d35a1ddd0934b112264fb4 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 6 May 2021 11:17:15 +0200 Subject: [PATCH] =?UTF-8?q?EgtExchange=20:=20-=20in=20import=20BTLx=20corr?= =?UTF-8?q?ezione=20lettura=20shape=20-=20in=20import=20BTLx=20per=20FreeC?= =?UTF-8?q?ontour=20aggiunto=20controllo=20sulla=20validit=C3=A0=20di=20Us?= =?UTF-8?q?erReferencePlane.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ImportBtlx.cpp | 6 +++++- ImportBtlxProc.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ImportBtlx.cpp b/ImportBtlx.cpp index b531d7a..1fc31fc 100644 --- a/ImportBtlx.cpp +++ b/ImportBtlx.cpp @@ -1127,7 +1127,7 @@ ImportBtlx::ReadUserReferencePlane( pugi::xml_node node) VectY.z = node.child( "Position").child( "YVector").attribute( "Z").as_double() ; Frame3d FrRef ; - FrRef.Set( Origin, VectX, VectY, VectX ^ VectY) ; + FrRef.Set( Origin, VectX, VectY, VectX ^ VectY) ; MapURefPlanes.emplace( id, FrRef) ; @@ -1580,6 +1580,8 @@ ImportBtlx::ReadShape( pugi::xml_node node) // Vertici delle facce INTVECTOR vAux ; // vettore per salvare i vertici di una faccia + if ( sFacesVertices.back() != ' ') + sFacesVertices += " " ; while( ( str_end = sFacesVertices.find( " ", str_start)) != string::npos ) { int val = std::stoi( sFacesVertices.substr( str_start, str_end - str_start)) ; str_start = str_end + 1 ; @@ -1595,6 +1597,8 @@ ImportBtlx::ReadShape( pugi::xml_node node) // Coordinate dei vertici str_start = 0 ; DBLVECTOR vAux2 ; // vettore per salvare le coordinate di un punto + if ( sCoordPoints.back() != ' ') + sCoordPoints += " " ; while( ( str_end = sCoordPoints.find( " ", str_start)) != string::npos ){ double val = std::stod( sCoordPoints.substr( str_start, str_end - str_start)) ; str_start = str_end + 1 ; diff --git a/ImportBtlxProc.cpp b/ImportBtlxProc.cpp index 941af64..8438698 100644 --- a/ImportBtlxProc.cpp +++ b/ImportBtlxProc.cpp @@ -2757,7 +2757,11 @@ ImportBtlx::ReadSContourParams( pugi::xml_node process, int nType, int nOtherId, LOG_ERROR( GetEExLogger(), " Error reading Part Process: FreeContour Contour Reference Plane unknown") ; return false ; } - frRef = MapURefPlanes[nSide] ; + frRef = MapURefPlanes[nSide] ; + if ( ! frRef.IsValid()) { + LOG_ERROR( GetEExLogger(), (" Error reading Part Process: FreeContour User Reference Plane " + to_string( nSide) + " is not valid").c_str()) ; + return false ; + } } string sDes ;