From e65e15b41902e427d50b851f3afbef9feb4c9485 Mon Sep 17 00:00:00 2001 From: kjetijo Date: Wed, 21 Sep 2011 14:29:37 +0000 Subject: [PATCH] Fix: ASMu2D can now read LRSplineSurface objects as well as tensor product SplineSurface objects and convert git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1170 e10b68d5-8a6e-419e-a041-bce267b0401d --- src/ASM/LR/ASMu2D.C | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ASM/LR/ASMu2D.C b/src/ASM/LR/ASMu2D.C index 0e76850b..9c814d01 100644 --- a/src/ASM/LR/ASMu2D.C +++ b/src/ASM/LR/ASMu2D.C @@ -62,11 +62,17 @@ bool ASMu2D::read (std::istream& is) { if (lrspline) delete lrspline; - Go::ObjectHeader head; - Go::SplineSurface *surf = new Go::SplineSurface(); - is >> head >> *surf; - - lrspline = new LR::LRSplineSurface(surf); + // read inputfile as either an LRSpline file directly or a tensor product B-spline and convert + char firstline[256]; + is.getline(firstline, 256); + if(strncmp(firstline, "# LRSPLINE", 10) == 0) { + lrspline = new LR::LRSplineSurface(); + is >> *lrspline; + } else { // probably a SplineSurface, so we'll read that and convert + Go::SplineSurface *surf = new Go::SplineSurface(); + is >> *surf; + lrspline = new LR::LRSplineSurface(surf); + } // Eat white-space characters to see if there is more data to read char c;