Skip to content

Commit

Permalink
Adding fallback value to volume data elements
Browse files Browse the repository at this point in the history
  • Loading branch information
3dJan committed Jan 5, 2024
1 parent c7fa73e commit 1e7d22e
Show file tree
Hide file tree
Showing 36 changed files with 676 additions and 18 deletions.
18 changes: 18 additions & 0 deletions Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,24 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_F
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize);

/**
* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[in] dFallBackValue - fallback value
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue);

/**
* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[out] pFallBackValue - fallback value
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue);

/*************************************************************************************************************************
Class definition for VolumeDataBoundary
**************************************************************************************************************************/
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable)
pWrapperTable->m_FunctionReference_SetChannelName = NULL;
pWrapperTable->m_FunctionReference_SetMinFeatureSize = NULL;
pWrapperTable->m_FunctionReference_GetMinFeatureSize = NULL;
pWrapperTable->m_FunctionReference_SetFallBackValue = NULL;
pWrapperTable->m_FunctionReference_GetFallBackValue = NULL;
pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly = NULL;
pWrapperTable->m_VolumeDataBoundary_GetMeshBBoxOnly = NULL;
pWrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup = NULL;
Expand Down Expand Up @@ -1954,6 +1956,24 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_FunctionReference_GetMinFeatureSize == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_FunctionReference_SetFallBackValue = (PLib3MFFunctionReference_SetFallBackValuePtr) GetProcAddress(hLibrary, "lib3mf_functionreference_setfallbackvalue");
#else // _WIN32
pWrapperTable->m_FunctionReference_SetFallBackValue = (PLib3MFFunctionReference_SetFallBackValuePtr) dlsym(hLibrary, "lib3mf_functionreference_setfallbackvalue");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_FunctionReference_SetFallBackValue == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_FunctionReference_GetFallBackValue = (PLib3MFFunctionReference_GetFallBackValuePtr) GetProcAddress(hLibrary, "lib3mf_functionreference_getfallbackvalue");
#else // _WIN32
pWrapperTable->m_FunctionReference_GetFallBackValue = (PLib3MFFunctionReference_GetFallBackValuePtr) dlsym(hLibrary, "lib3mf_functionreference_getfallbackvalue");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_FunctionReference_GetFallBackValue == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly = (PLib3MFVolumeDataBoundary_SetMeshBBoxOnlyPtr) GetProcAddress(hLibrary, "lib3mf_volumedataboundary_setmeshbboxonly");
#else // _WIN32
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,24 @@ typedef Lib3MFResult (*PLib3MFFunctionReference_SetMinFeatureSizePtr) (Lib3MF_Fu
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_GetMinFeatureSizePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize);

/**
* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[in] dFallBackValue - fallback value
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_SetFallBackValuePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue);

/**
* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[out] pFallBackValue - fallback value
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_GetFallBackValuePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue);

/*************************************************************************************************************************
Class definition for VolumeDataBoundary
**************************************************************************************************************************/
Expand Down Expand Up @@ -6403,6 +6421,8 @@ typedef struct {
PLib3MFFunctionReference_SetChannelNamePtr m_FunctionReference_SetChannelName;
PLib3MFFunctionReference_SetMinFeatureSizePtr m_FunctionReference_SetMinFeatureSize;
PLib3MFFunctionReference_GetMinFeatureSizePtr m_FunctionReference_GetMinFeatureSize;
PLib3MFFunctionReference_SetFallBackValuePtr m_FunctionReference_SetFallBackValue;
PLib3MFFunctionReference_GetFallBackValuePtr m_FunctionReference_GetFallBackValue;
PLib3MFVolumeDataBoundary_SetMeshBBoxOnlyPtr m_VolumeDataBoundary_SetMeshBBoxOnly;
PLib3MFVolumeDataBoundary_GetMeshBBoxOnlyPtr m_VolumeDataBoundary_GetMeshBBoxOnly;
PLib3MFVolumeDataComposite_GetBaseMaterialGroupPtr m_VolumeDataComposite_GetBaseMaterialGroup;
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/CSharp/Lib3MF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,12 @@ public class Lib3MFWrapper
[DllImport("lib3mf.dll", EntryPoint = "lib3mf_functionreference_getminfeaturesize", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 FunctionReference_GetMinFeatureSize (IntPtr Handle, out Double AMinFeatureSize);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_functionreference_setfallbackvalue", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 FunctionReference_SetFallBackValue (IntPtr Handle, Double AFallBackValue);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_functionreference_getfallbackvalue", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 FunctionReference_GetFallBackValue (IntPtr Handle, out Double AFallBackValue);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_volumedataboundary_setmeshbboxonly", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 VolumeDataBoundary_SetMeshBBoxOnly (IntPtr Handle, Byte AMeshBBoxOnly);

Expand Down Expand Up @@ -4102,6 +4108,20 @@ public Double GetMinFeatureSize ()
return resultMinFeatureSize;
}

public void SetFallBackValue (Double AFallBackValue)
{

CheckError(Internal.Lib3MFWrapper.FunctionReference_SetFallBackValue (Handle, AFallBackValue));
}

public Double GetFallBackValue ()
{
Double resultFallBackValue = 0;

CheckError(Internal.Lib3MFWrapper.FunctionReference_GetFallBackValue (Handle, out resultFallBackValue));
return resultFallBackValue;
}

}

public class CVolumeDataBoundary : CFunctionReference
Expand Down
18 changes: 18 additions & 0 deletions Autogenerated/Bindings/Cpp/lib3mf_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,24 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setminfeaturesize(Lib3MF_F
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getminfeaturesize(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize);

/**
* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[in] dFallBackValue - fallback value
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_setfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue);

/**
* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[out] pFallBackValue - fallback value
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_functionreference_getfallbackvalue(Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue);

/*************************************************************************************************************************
Class definition for VolumeDataBoundary
**************************************************************************************************************************/
Expand Down
23 changes: 23 additions & 0 deletions Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,8 @@ class CFunctionReference : public CBase {
inline void SetChannelName(const std::string & sChannelName);
inline void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize);
inline Lib3MF_double GetMinFeatureSize();
inline void SetFallBackValue(const Lib3MF_double dFallBackValue);
inline Lib3MF_double GetFallBackValue();
};

/*************************************************************************************************************************
Expand Down Expand Up @@ -5542,6 +5544,27 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
return resultMinFeatureSize;
}

/**
* CFunctionReference::SetFallBackValue - Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
* @param[in] dFallBackValue - fallback value
*/
void CFunctionReference::SetFallBackValue(const Lib3MF_double dFallBackValue)
{
CheckError(lib3mf_functionreference_setfallbackvalue(m_pHandle, dFallBackValue));
}

/**
* CFunctionReference::GetFallBackValue - Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
* @return fallback value
*/
Lib3MF_double CFunctionReference::GetFallBackValue()
{
Lib3MF_double resultFallBackValue = 0;
CheckError(lib3mf_functionreference_getfallbackvalue(m_pHandle, &resultFallBackValue));

return resultFallBackValue;
}

/**
* Method definitions for class CVolumeDataBoundary
*/
Expand Down
20 changes: 20 additions & 0 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,24 @@ typedef Lib3MFResult (*PLib3MFFunctionReference_SetMinFeatureSizePtr) (Lib3MF_Fu
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_GetMinFeatureSizePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pMinFeatureSize);

/**
* Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[in] dFallBackValue - fallback value
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_SetFallBackValuePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double dFallBackValue);

/**
* Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
*
* @param[in] pFunctionReference - FunctionReference instance.
* @param[out] pFallBackValue - fallback value
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFFunctionReference_GetFallBackValuePtr) (Lib3MF_FunctionReference pFunctionReference, Lib3MF_double * pFallBackValue);

/*************************************************************************************************************************
Class definition for VolumeDataBoundary
**************************************************************************************************************************/
Expand Down Expand Up @@ -6403,6 +6421,8 @@ typedef struct {
PLib3MFFunctionReference_SetChannelNamePtr m_FunctionReference_SetChannelName;
PLib3MFFunctionReference_SetMinFeatureSizePtr m_FunctionReference_SetMinFeatureSize;
PLib3MFFunctionReference_GetMinFeatureSizePtr m_FunctionReference_GetMinFeatureSize;
PLib3MFFunctionReference_SetFallBackValuePtr m_FunctionReference_SetFallBackValue;
PLib3MFFunctionReference_GetFallBackValuePtr m_FunctionReference_GetFallBackValue;
PLib3MFVolumeDataBoundary_SetMeshBBoxOnlyPtr m_VolumeDataBoundary_SetMeshBBoxOnly;
PLib3MFVolumeDataBoundary_GetMeshBBoxOnlyPtr m_VolumeDataBoundary_GetMeshBBoxOnly;
PLib3MFVolumeDataComposite_GetBaseMaterialGroupPtr m_VolumeDataComposite_GetBaseMaterialGroup;
Expand Down
51 changes: 51 additions & 0 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,8 @@ class CFunctionReference : public CBase {
inline void SetChannelName(const std::string & sChannelName);
inline void SetMinFeatureSize(const Lib3MF_double dMinFeatureSize);
inline Lib3MF_double GetMinFeatureSize();
inline void SetFallBackValue(const Lib3MF_double dFallBackValue);
inline Lib3MF_double GetFallBackValue();
};

/*************************************************************************************************************************
Expand Down Expand Up @@ -3922,6 +3924,8 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
pWrapperTable->m_FunctionReference_SetChannelName = nullptr;
pWrapperTable->m_FunctionReference_SetMinFeatureSize = nullptr;
pWrapperTable->m_FunctionReference_GetMinFeatureSize = nullptr;
pWrapperTable->m_FunctionReference_SetFallBackValue = nullptr;
pWrapperTable->m_FunctionReference_GetFallBackValue = nullptr;
pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly = nullptr;
pWrapperTable->m_VolumeDataBoundary_GetMeshBBoxOnly = nullptr;
pWrapperTable->m_VolumeDataComposite_GetBaseMaterialGroup = nullptr;
Expand Down Expand Up @@ -5683,6 +5687,24 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
if (pWrapperTable->m_FunctionReference_GetMinFeatureSize == nullptr)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_FunctionReference_SetFallBackValue = (PLib3MFFunctionReference_SetFallBackValuePtr) GetProcAddress(hLibrary, "lib3mf_functionreference_setfallbackvalue");
#else // _WIN32
pWrapperTable->m_FunctionReference_SetFallBackValue = (PLib3MFFunctionReference_SetFallBackValuePtr) dlsym(hLibrary, "lib3mf_functionreference_setfallbackvalue");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_FunctionReference_SetFallBackValue == nullptr)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_FunctionReference_GetFallBackValue = (PLib3MFFunctionReference_GetFallBackValuePtr) GetProcAddress(hLibrary, "lib3mf_functionreference_getfallbackvalue");
#else // _WIN32
pWrapperTable->m_FunctionReference_GetFallBackValue = (PLib3MFFunctionReference_GetFallBackValuePtr) dlsym(hLibrary, "lib3mf_functionreference_getfallbackvalue");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_FunctionReference_GetFallBackValue == nullptr)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly = (PLib3MFVolumeDataBoundary_SetMeshBBoxOnlyPtr) GetProcAddress(hLibrary, "lib3mf_volumedataboundary_setmeshbboxonly");
#else // _WIN32
Expand Down Expand Up @@ -10241,6 +10263,14 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
if ( (eLookupError != 0) || (pWrapperTable->m_FunctionReference_GetMinFeatureSize == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("lib3mf_functionreference_setfallbackvalue", (void**)&(pWrapperTable->m_FunctionReference_SetFallBackValue));
if ( (eLookupError != 0) || (pWrapperTable->m_FunctionReference_SetFallBackValue == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("lib3mf_functionreference_getfallbackvalue", (void**)&(pWrapperTable->m_FunctionReference_GetFallBackValue));
if ( (eLookupError != 0) || (pWrapperTable->m_FunctionReference_GetFallBackValue == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("lib3mf_volumedataboundary_setmeshbboxonly", (void**)&(pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly));
if ( (eLookupError != 0) || (pWrapperTable->m_VolumeDataBoundary_SetMeshBBoxOnly == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;
Expand Down Expand Up @@ -13804,6 +13834,27 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
return resultMinFeatureSize;
}

/**
* CFunctionReference::SetFallBackValue - Sets the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
* @param[in] dFallBackValue - fallback value
*/
void CFunctionReference::SetFallBackValue(const Lib3MF_double dFallBackValue)
{
CheckError(m_pWrapper->m_WrapperTable.m_FunctionReference_SetFallBackValue(m_pHandle, dFallBackValue));
}

/**
* CFunctionReference::GetFallBackValue - Returns the fallback value to use if the function evaluation fails (e.g. evaluates to NaN or Inf).
* @return fallback value
*/
Lib3MF_double CFunctionReference::GetFallBackValue()
{
Lib3MF_double resultFallBackValue = 0;
CheckError(m_pWrapper->m_WrapperTable.m_FunctionReference_GetFallBackValue(m_pHandle, &resultFallBackValue));

return resultFallBackValue;
}

/**
* Method definitions for class CVolumeDataBoundary
*/
Expand Down
37 changes: 37 additions & 0 deletions Autogenerated/Bindings/Go/lib3mf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1e7d22e

Please sign in to comment.