summaryrefslogtreecommitdiff
path: root/CSXCAD
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-08-13 09:26:34 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2018-08-13 09:26:34 +0200
commit7097a4eaa0a32e0d02207521941157bda8968b05 (patch)
treed4b1258d2601508182f8ff8b992d7e9431a7d20a /CSXCAD
parentaa7abb5c97c20b34f159886dfc523dd8198fef98 (diff)
New upstream version 0.0.35+ds.1
Diffstat (limited to 'CSXCAD')
-rw-r--r--CSXCAD/CMakeLists.txt6
-rw-r--r--CSXCAD/src/CMakeLists.txt1
-rw-r--r--CSXCAD/src/CSPrimBox.cpp6
-rw-r--r--CSXCAD/src/CSPrimitives.cpp12
-rw-r--r--CSXCAD/src/CSPrimitives.h3
-rw-r--r--CSXCAD/src/CSTransform.cpp5
-rw-r--r--CSXCAD/src/CSTransform.h3
7 files changed, 27 insertions, 9 deletions
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).