From 7097a4eaa0a32e0d02207521941157bda8968b05 Mon Sep 17 00:00:00 2001 From: Ruben Undheim Date: Mon, 13 Aug 2018 09:26:34 +0200 Subject: New upstream version 0.0.35+ds.1 --- CSXCAD/CMakeLists.txt | 6 +++--- CSXCAD/src/CMakeLists.txt | 1 + CSXCAD/src/CSPrimBox.cpp | 6 +++--- CSXCAD/src/CSPrimitives.cpp | 12 ++++++++++-- CSXCAD/src/CSPrimitives.h | 3 ++- CSXCAD/src/CSTransform.cpp | 5 +++++ CSXCAD/src/CSTransform.h | 3 +++ 7 files changed, 27 insertions(+), 9 deletions(-) (limited to 'CSXCAD') diff --git a/CSXCAD/CMakeLists.txt b/CSXCAD/CMakeLists.txt index a349287..9d516d5 100644 --- a/CSXCAD/CMakeLists.txt +++ b/CSXCAD/CMakeLists.txt @@ -6,14 +6,14 @@ ELSE() SET( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" ) ENDIF() -PROJECT(CSXCAD CXX) +PROJECT(CSXCAD CXX C) cmake_minimum_required(VERSION 2.8) # default set(LIB_VERSION_MAJOR 0) set(LIB_VERSION_MINOR 6) -set(LIB_VERSION_PATCH 1) +set(LIB_VERSION_PATCH 2) set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH}) set(VERSION "v${LIB_VERSION_STRING}") @@ -91,7 +91,7 @@ find_package(TinyXML REQUIRED) ADD_DEFINITIONS( -DTIXML_USE_STL ) find_package(HDF5 1.8 COMPONENTS C HL REQUIRED) -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) +INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRS}) link_directories(${HDF5_LIBRARY_DIRS}) # hdf5 compat ADD_DEFINITIONS( -DH5_USE_16_API ) diff --git a/CSXCAD/src/CMakeLists.txt b/CSXCAD/src/CMakeLists.txt index 676546a..8903a60 100644 --- a/CSXCAD/src/CMakeLists.txt +++ b/CSXCAD/src/CMakeLists.txt @@ -89,6 +89,7 @@ TARGET_LINK_LIBRARIES( CSXCAD ${fparser_LIBRARIES} ${TinyXML_LIBRARIES} ${HDF5_LIBRARIES} + ${HDF5_HL_LIBRARIES} CGAL ${Boost_LIBRARIES} ${vtk_LIBS} diff --git a/CSXCAD/src/CSPrimBox.cpp b/CSXCAD/src/CSPrimBox.cpp index de31b31..e4acf77 100644 --- a/CSXCAD/src/CSPrimBox.cpp +++ b/CSXCAD/src/CSPrimBox.cpp @@ -56,9 +56,6 @@ CSPrimBox::~CSPrimBox() bool CSPrimBox::GetBoundBox(double dBoundBox[6], bool PreserveOrientation) { -// if ( (m_MeshType!=m_PrimCoordSystem) && (m_PrimCoordSystem!=UNDEFINED_CS)) -// std::cerr << "GetBoundBox::GetBoundBox: Warning: The bounding box for this object is not calculated properly... " << std::endl; - const double* start = m_Coords[0].GetCoords(m_MeshType); const double* stop = m_Coords[1].GetCoords(m_MeshType); @@ -81,6 +78,9 @@ bool CSPrimBox::GetBoundBox(double dBoundBox[6], bool PreserveOrientation) dBoundBox[2*i]=dBoundBox[2*i+1]; dBoundBox[2*i+1]=help; } + if ( (m_MeshType!=m_PrimCoordSystem) && (m_PrimCoordSystem!=UNDEFINED_CS)) + // if the box is defined in a coordinate system other than the expected one, this BB is invalid + return false; return true; } diff --git a/CSXCAD/src/CSPrimitives.cpp b/CSXCAD/src/CSPrimitives.cpp index e15d2cb..f852328 100644 --- a/CSXCAD/src/CSPrimitives.cpp +++ b/CSXCAD/src/CSPrimitives.cpp @@ -123,6 +123,13 @@ void CSPrimitives::Init() m_BoundBoxValid = false; } +CSTransform* CSPrimitives::GetTransform() +{ + if (m_Transform==NULL) + m_Transform = new CSTransform(clParaSet); + return m_Transform; +} + void CSPrimitives::SetProperty(CSProperties *prop) { if ((clProperty!=NULL) && (clProperty!=prop)) @@ -146,8 +153,9 @@ int CSPrimitives::IsInsideBox(const double *boundbox) return 0; // unable to decide with an invalid bounding box if ((this->GetBoundBoxCoordSystem()!=UNDEFINED_CS) && (this->GetBoundBoxCoordSystem()!=this->GetCoordInputType())) return 0; // unable to decide if coordinate system do not match - if (this->GetTransform()!=NULL) - return 0; // unable to decide if a transformation is used + if (m_Transform!=NULL) + if (m_Transform->HasTransform()) + return 0; // unable to decide if a transformation is used for (int i=0;i<3;++i) { diff --git a/CSXCAD/src/CSPrimitives.h b/CSXCAD/src/CSPrimitives.h index 4f68a96..545c152 100644 --- a/CSXCAD/src/CSPrimitives.h +++ b/CSXCAD/src/CSPrimitives.h @@ -177,7 +177,8 @@ public: //! Read the coordinate system for this primitive (may be different to the input mesh type) \sa GetCoordInputType CoordinateSystem GetCoordinateSystem() const {return m_PrimCoordSystem;} - CSTransform* GetTransform() const {return m_Transform;} + //! Get the CSTransform if it exists already or create a new one + CSTransform* GetTransform(); //! Show status of this primitve virtual void ShowPrimitiveStatus(std::ostream& stream); diff --git a/CSXCAD/src/CSTransform.cpp b/CSXCAD/src/CSTransform.cpp index 2e32481..d71cb4e 100644 --- a/CSXCAD/src/CSTransform.cpp +++ b/CSXCAD/src/CSTransform.cpp @@ -73,6 +73,11 @@ void CSTransform::Reset() MakeUnitMatrix(m_Inv_TMatrix); } +bool CSTransform::HasTransform() +{ + return (m_TransformList.size()>0); +} + void CSTransform::Invert() { //make sure the inverse matrix is up to date... diff --git a/CSXCAD/src/CSTransform.h b/CSXCAD/src/CSTransform.h index 8293219..8fcad90 100644 --- a/CSXCAD/src/CSTransform.h +++ b/CSXCAD/src/CSTransform.h @@ -85,6 +85,9 @@ public: void Reset(); + //! Check if this CSTransform has any transformations + bool HasTransform(); + //! All subsequent operations will be occur before the previous operations (not the default). void SetPreMultiply() {m_PostMultiply=false;} //! All subsequent operations will be after the previous operations (default). -- cgit v1.2.3