packages feed

opencascade-hs 0.6.1.0 → 0.6.2.0

raw patch · 11 files changed

+131/−3 lines, 11 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ OpenCascade.BRepGProp: linearProperties :: Ptr Shape -> Ptr GProps -> Bool -> Bool -> IO ()
+ OpenCascade.BRepGProp: surfaceProperties :: Ptr Shape -> Ptr GProps -> Bool -> Bool -> IO ()
+ OpenCascade.GCPnts.AbscissaPoint: data AbscissaPoint
+ OpenCascade.GCPnts.AbscissaPoint: fromCurveAbscissaAndParam :: Ptr Curve -> Double -> Double -> Acquire (Ptr AbscissaPoint)
+ OpenCascade.GCPnts.AbscissaPoint: isDone :: Ptr AbscissaPoint -> IO Bool
+ OpenCascade.GCPnts.AbscissaPoint: parameter :: Ptr AbscissaPoint -> IO Double
+ OpenCascade.GCPnts.Internal.Destructors: deleteAbscissaPoint :: Ptr AbscissaPoint -> IO ()
+ OpenCascade.GCPnts.Types: data AbscissaPoint

Files

CHANGELOG.md view
@@ -8,6 +8,11 @@  ## Unreleased +## 0.6.2.0++- Add `surfaceProperties` and `linearProperties` to `OpenCascade.BRepGProp`+- Add `OpenCascade.GCPnts.AbscissaPoint`+ ## 0.6.1.0  - Add `OpenCascade.BRepPrimAPI_MakeTorus`
cpp/hs_BRepGProp.cpp view
@@ -4,3 +4,11 @@ void hs_BRepGProp_VolumeProperties(TopoDS_Shape *shape, GProp_GProps *props, bool onlyClosed, bool skipShared, bool useTriangulation ){     BRepGProp::VolumeProperties(*shape, *props, onlyClosed, skipShared, useTriangulation); }++void hs_BRepGProp_SurfaceProperties(TopoDS_Shape *shape, GProp_GProps *props, bool skipShared, bool useTriangulation ){+    BRepGProp::SurfaceProperties(*shape, *props, skipShared, useTriangulation);+}++void hs_BRepGProp_LinearProperties(TopoDS_Shape *shape, GProp_GProps *props, bool skipShared, bool useTriangulation ){+    BRepGProp::LinearProperties(*shape, *props, skipShared, useTriangulation);+}
cpp/hs_BRepGProp.h view
@@ -7,7 +7,11 @@ extern "C" { #endif -void hs_BRepGProp_VolumeProperties(TopoDS_Shape * shape, GProp_GProps * props, bool onlyClosed, bool skipShared, bool useTriangulation );+void hs_BRepGProp_VolumeProperties(TopoDS_Shape * shape, GProp_GProps * props, bool onlyClosed, bool skipShared, bool useTriangulation);++void hs_BRepGProp_SurfaceProperties(TopoDS_Shape *shape, GProp_GProps *props, bool skipShared, bool useTriangulation);++void hs_BRepGProp_LinearProperties(TopoDS_Shape *shape, GProp_GProps *props, bool skipShared, bool useTriangulation);  #ifdef __cplusplus }
+ cpp/hs_GCPnts_AbscissaPoint.cpp view
@@ -0,0 +1,19 @@+#include <GCPnts_AbscissaPoint.hxx>+#include <BRepAdaptor_Curve.hxx>+#include "hs_GCPnts_AbscissaPoint.h"++GCPnts_AbscissaPoint * hs_new_GCPnts_AbscissaPoint(BRepAdaptor_Curve * curve, double abscissa, double u0){+    return new GCPnts_AbscissaPoint(*curve, abscissa, u0);+}++void hs_delete_GCPnts_AbscissaPoint(GCPnts_AbscissaPoint * abscissaPoint){+    delete abscissaPoint;+}++double hs_GCPnts_AbscissaPoint_parameter(GCPnts_AbscissaPoint * abscissaPoint){+    return abscissaPoint->Parameter();+}++bool hs_GCPnts_AbscissaPoint_isDone(GCPnts_AbscissaPoint * abscissaPoint){+    return abscissaPoint->IsDone();+}
+ cpp/hs_GCPnts_AbscissaPoint.h view
@@ -0,0 +1,22 @@+#ifndef HS_GCPNTS_ABSCISSAPOINT_H+#define HS_GCPNTS_ABSCISSAPOINT_H++#include "hs_types.h"++#ifdef __cplusplus+extern "C" {+#endif++GCPnts_AbscissaPoint * hs_new_GCPnts_AbscissaPoint(BRepAdaptor_Curve * curve, double abscissa, double u0);++void hs_delete_GCPnts_AbscissaPoint(GCPnts_AbscissaPoint * abscissaPoint);++double hs_GCPnts_AbscissaPoint_parameter(GCPnts_AbscissaPoint * abscissaPoint);++bool hs_GCPnts_AbscissaPoint_isDone(GCPnts_AbscissaPoint * abscissaPoint);++#ifdef __cplusplus+}+#endif++#endif // HS_GCPNTS_ABSCISSAPOINT_H
cpp/hs_types.h view
@@ -105,6 +105,7 @@ typedef void BOPAlgo_Builder; typedef void BOPAlgo_BOP; typedef int BOPAlgo_Operation;+typedef void GCPnts_AbscissaPoint;  #define Handle(X) void #define ARRAY_1(X) void
opencascade-hs.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           opencascade-hs-version:        0.6.1.0+version:        0.6.2.0 synopsis:       Thin Wrapper for the OpenCASCADE CAD Kernel description:    Please see the README on GitHub at <https://github.com/joe-warren/opencascade-hs#readme> category:       Graphics,FFI@@ -62,6 +62,7 @@     cpp/hs_Font_BRepTextBuilder.h     cpp/hs_GC_MakeArcOfCircle.h     cpp/hs_GC_MakeSegment.h+    cpp/hs_GCPnts_AbscissaPoint.h     cpp/hs_Geom_BezierCurve.h     cpp/hs_Geom_BSplineCurve.h     cpp/hs_Geom_Curve.h@@ -204,6 +205,9 @@       OpenCascade.Font.Types       OpenCascade.GC.MakeArcOfCircle       OpenCascade.GC.MakeSegment+      OpenCascade.GCPnts.AbscissaPoint+      OpenCascade.GCPnts.Internal.Destructors+      OpenCascade.GCPnts.Types       OpenCascade.Geom       OpenCascade.Geom.BezierCurve       OpenCascade.Geom.BSplineCurve@@ -392,6 +396,7 @@       cpp/hs_Font_BRepTextBuilder.cpp       cpp/hs_GC_MakeArcOfCircle.cpp       cpp/hs_GC_MakeSegment.cpp+      cpp/hs_GCPnts_AbscissaPoint.cpp       cpp/hs_Geom_BezierCurve.cpp       cpp/hs_Geom_BSplineCurve.cpp       cpp/hs_Geom_Curve.cpp
src/OpenCascade/BRepGProp.hs view
@@ -1,5 +1,9 @@ {-# LANGUAGE CApiFFI #-}-module OpenCascade.BRepGProp (volumeProperties) where+module OpenCascade.BRepGProp +( volumeProperties+, surfaceProperties+, linearProperties+) where  import OpenCascade.TopoDS.Types (Shape) import OpenCascade.GProp.Types (GProps)@@ -12,4 +16,18 @@ volumeProperties :: Ptr Shape -> Ptr GProps -> Bool -> Bool -> Bool -> IO () volumeProperties shape props onlyClosed skipShared useTriangulation =     rawVolumeProperties shape props (boolToCBool onlyClosed) (boolToCBool skipShared) (boolToCBool useTriangulation)++foreign import capi unsafe "hs_BRepGProp.h hs_BRepGProp_SurfaceProperties" rawSurfaceProperties :: Ptr Shape -> Ptr GProps -> CBool -> CBool -> IO ()++surfaceProperties :: Ptr Shape -> Ptr GProps -> Bool -> Bool -> IO ()+surfaceProperties shape props skipShared useTriangulation =+    rawSurfaceProperties shape props (boolToCBool skipShared) (boolToCBool useTriangulation)++    +foreign import capi unsafe "hs_BRepGProp.h hs_BRepGProp_LinearProperties" rawLinearProperties :: Ptr Shape -> Ptr GProps -> CBool -> CBool -> IO ()++linearProperties :: Ptr Shape -> Ptr GProps -> Bool -> Bool -> IO ()+linearProperties shape props skipShared useTriangulation =+    rawLinearProperties shape props (boolToCBool skipShared) (boolToCBool useTriangulation)+   
+ src/OpenCascade/GCPnts/AbscissaPoint.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE CApiFFI #-}+module OpenCascade.GCPnts.AbscissaPoint+( AbscissaPoint+, fromCurveAbscissaAndParam+, parameter+, isDone+) where++import OpenCascade.GCPnts.Types (AbscissaPoint)+import OpenCascade.GCPnts.Internal.Destructors (deleteAbscissaPoint)+import qualified OpenCascade.BRepAdaptor.Types as BRepAdaptor+import OpenCascade.Internal.Bool (cBoolToBool)+import Foreign.Ptr+import Foreign.C+import Data.Acquire (Acquire, mkAcquire)+import Data.Coerce (coerce)++foreign import capi unsafe "hs_GCPnts_AbscissaPoint.h hs_new_GCPnts_AbscissaPoint" rawNew :: Ptr BRepAdaptor.Curve -> CDouble -> CDouble -> IO (Ptr AbscissaPoint)++fromCurveAbscissaAndParam :: Ptr BRepAdaptor.Curve -> Double -> Double -> Acquire (Ptr AbscissaPoint)+fromCurveAbscissaAndParam curve abscissa u0 = mkAcquire (rawNew curve (CDouble abscissa) (CDouble u0)) deleteAbscissaPoint++foreign import capi unsafe "hs_GCPnts_AbscissaPoint.h hs_GCPnts_AbscissaPoint_parameter" rawParameter :: Ptr AbscissaPoint -> IO CDouble++parameter :: Ptr AbscissaPoint -> IO Double+parameter = coerce rawParameter++foreign import capi unsafe "hs_GCPnts_AbscissaPoint.h hs_GCPnts_AbscissaPoint_isDone" rawIsDone :: Ptr AbscissaPoint -> IO CBool++isDone :: Ptr AbscissaPoint -> IO Bool+isDone = fmap cBoolToBool . rawIsDone
+ src/OpenCascade/GCPnts/Internal/Destructors.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE CApiFFI #-}+module OpenCascade.GCPnts.Internal.Destructors+( deleteAbscissaPoint+) where++import OpenCascade.GCPnts.Types (AbscissaPoint)+import Foreign.Ptr++foreign import capi unsafe "hs_GCPnts_AbscissaPoint.h hs_delete_GCPnts_AbscissaPoint" deleteAbscissaPoint :: Ptr AbscissaPoint -> IO ()
+ src/OpenCascade/GCPnts/Types.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE EmptyDataDecls #-}+module OpenCascade.GCPnts.Types+( AbscissaPoint+) where++data AbscissaPoint