Skip to content

Commit

Permalink
Updated Read out of Override Factors
Browse files Browse the repository at this point in the history
  • Loading branch information
netfabb committed Oct 28, 2024
1 parent 051c8b7 commit 83ba867
Show file tree
Hide file tree
Showing 32 changed files with 1,559 additions and 29 deletions.
41 changes: 39 additions & 2 deletions Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3654,11 +3654,22 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdefaultprofile
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getprofileuuidbylocalprofileid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalProfileID, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer);

/**
* Returns if the segment has a uniform profile. If it is uniform, then the default profile applies to the whole segment. If it is not uniform, the type specific retrieval functions have to be used (or the file has to be rejected). Returns false for delay and sync segments.
* Retrieves if the segment has specific override factors attached.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[out] pHasOverrides - Returns true, if the segment has attached any override factors of the given type, false otherwise.
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_segmenthasoverridefactors(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, bool * pHasOverrides);

/**
* Returns if the segment has a uniform profile. If it is uniform, then the default profile applies to the whole segment. If it is not uniform, the type specific retrieval functions have to be used (or the file has to be rejected). Returns false for delay and sync segments. The call is equivalent to SegmentHasOverrideFactors returning false with any possible type (F, G, H).
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and Count - 1.
* @param[out] pHasUniformProfile - If true, the segment has a uniform profile ID.
* @param[out] pHasUniformProfile - If true, the segment has a uniform profile ID.
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_segmenthasuniformprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, bool * pHasUniformProfile);
Expand Down Expand Up @@ -3687,6 +3698,19 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdatainmod
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdatadiscrete(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFDiscretePosition2D * pPointDataBuffer);

/**
* Retrieves the assigned segment override factors. Fails if segment type is not loop or polyline. The values are per point, meaning that gradients are given through linear ramping on the polyline vectors.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[in] nFactorValuesBufferSize - Number of elements in buffer
* @param[out] pFactorValuesNeededCount - will be filled with the count of the written elements, or needed buffer size.
* @param[out] pFactorValuesBuffer - double buffer of An target override factor for each point of the segment. In case of Polyline, the first array value describes the override for the initial jump. In case of Loop, the first array value describes the override for the inital jump and the last closing mark movement of the polyline.
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointoverridefactors(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, const Lib3MF_uint64 nFactorValuesBufferSize, Lib3MF_uint64* pFactorValuesNeededCount, Lib3MF_double * pFactorValuesBuffer);

/**
* Retrieves the assigned segment hatch list. Converts any polyline or loop into hatches. Returns an empty array for delay and sync elements.
*
Expand All @@ -3711,6 +3735,19 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmenthatchdatainmod
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmenthatchdatadiscrete(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, const Lib3MF_uint64 nHatchDataBufferSize, Lib3MF_uint64* pHatchDataNeededCount, sLib3MFDiscreteHatch2D * pHatchDataBuffer);

/**
* Retrieves the assigned segment override factors. Fails if segment type is not hatch. The call will return two values per hatch, one per hatch point.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[in] nFactorValuesBufferSize - Number of elements in buffer
* @param[out] pFactorValuesNeededCount - will be filled with the count of the written elements, or needed buffer size.
* @param[out] pFactorValuesBuffer - Hatch2DOverrides buffer of An target override factor for each point of the segment. In case of Polyline, the first array value describes the override for the initial jump. In case of Loop, the first array value describes the override for the inital jump and the last closing mark movement of the polyline.
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmenthatchoverridefactors(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, const Lib3MF_uint64 nFactorValuesBufferSize, Lib3MF_uint64* pFactorValuesNeededCount, sLib3MFHatch2DOverrides * pFactorValuesBuffer);

/*************************************************************************************************************************
Class definition for ToolpathLayerData
**************************************************************************************************************************/
Expand Down
5 changes: 5 additions & 0 deletions Autogenerated/Bindings/C/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@ typedef struct sLib3MFHatch2D {
Lib3MF_int32 m_Tag;
} sLib3MFHatch2D;

typedef struct sLib3MFHatch2DOverrides {
Lib3MF_double m_Point1Override;
Lib3MF_double m_Point2Override;
} sLib3MFHatch2DOverrides;

typedef struct sLib3MFDiscreteHatch2D {
Lib3MF_int32 m_Point1Coordinates[2];
Lib3MF_int32 m_Point2Coordinates[2];
Expand Down
30 changes: 30 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,14 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable)
pWrapperTable->m_ToolpathLayerReader_GetSegmentDefaultProfileUUID = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentDefaultProfileID = NULL;
pWrapperTable->m_ToolpathLayerReader_GetProfileUUIDByLocalProfileID = NULL;
pWrapperTable->m_ToolpathLayerReader_SegmentHasOverrideFactors = NULL;
pWrapperTable->m_ToolpathLayerReader_SegmentHasUniformProfile = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentPointDataInModelUnits = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentPointDataDiscrete = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentPointOverrideFactors = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchDataInModelUnits = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchDataDiscrete = NULL;
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchOverrideFactors = NULL;
pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = NULL;
pWrapperTable->m_ToolpathLayerData_RegisterProfile = NULL;
pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = NULL;
Expand Down Expand Up @@ -3733,6 +3736,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_ToolpathLayerReader_GetProfileUUIDByLocalProfileID == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerReader_SegmentHasOverrideFactors = (PLib3MFToolpathLayerReader_SegmentHasOverrideFactorsPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_segmenthasoverridefactors");
#else // _WIN32
pWrapperTable->m_ToolpathLayerReader_SegmentHasOverrideFactors = (PLib3MFToolpathLayerReader_SegmentHasOverrideFactorsPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_segmenthasoverridefactors");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_ToolpathLayerReader_SegmentHasOverrideFactors == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerReader_SegmentHasUniformProfile = (PLib3MFToolpathLayerReader_SegmentHasUniformProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_segmenthasuniformprofile");
#else // _WIN32
Expand Down Expand Up @@ -3760,6 +3772,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointDataDiscrete == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerReader_GetSegmentPointOverrideFactors = (PLib3MFToolpathLayerReader_GetSegmentPointOverrideFactorsPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointoverridefactors");
#else // _WIN32
pWrapperTable->m_ToolpathLayerReader_GetSegmentPointOverrideFactors = (PLib3MFToolpathLayerReader_GetSegmentPointOverrideFactorsPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointoverridefactors");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointOverrideFactors == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchDataInModelUnits = (PLib3MFToolpathLayerReader_GetSegmentHatchDataInModelUnitsPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmenthatchdatainmodelunits");
#else // _WIN32
Expand All @@ -3778,6 +3799,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchDataDiscrete == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchOverrideFactors = (PLib3MFToolpathLayerReader_GetSegmentHatchOverrideFactorsPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmenthatchoverridefactors");
#else // _WIN32
pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchOverrideFactors = (PLib3MFToolpathLayerReader_GetSegmentHatchOverrideFactorsPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmenthatchoverridefactors");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_ToolpathLayerReader_GetSegmentHatchOverrideFactors == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid");
#else // _WIN32
Expand Down
44 changes: 42 additions & 2 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3641,11 +3641,22 @@ typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDefaultProfileIDPtr)
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetProfileUUIDByLocalProfileIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalProfileID, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer);

/**
* Returns if the segment has a uniform profile. If it is uniform, then the default profile applies to the whole segment. If it is not uniform, the type specific retrieval functions have to be used (or the file has to be rejected). Returns false for delay and sync segments.
* Retrieves if the segment has specific override factors attached.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[out] pHasOverrides - Returns true, if the segment has attached any override factors of the given type, false otherwise.
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_SegmentHasOverrideFactorsPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, bool * pHasOverrides);

/**
* Returns if the segment has a uniform profile. If it is uniform, then the default profile applies to the whole segment. If it is not uniform, the type specific retrieval functions have to be used (or the file has to be rejected). Returns false for delay and sync segments. The call is equivalent to SegmentHasOverrideFactors returning false with any possible type (F, G, H).
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and Count - 1.
* @param[out] pHasUniformProfile - If true, the segment has a uniform profile ID.
* @param[out] pHasUniformProfile - If true, the segment has a uniform profile ID.
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_SegmentHasUniformProfilePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, bool * pHasUniformProfile);
Expand Down Expand Up @@ -3674,6 +3685,19 @@ typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataInModelUnit
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataDiscretePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFDiscretePosition2D * pPointDataBuffer);

/**
* Retrieves the assigned segment override factors. Fails if segment type is not loop or polyline. The values are per point, meaning that gradients are given through linear ramping on the polyline vectors.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[in] nFactorValuesBufferSize - Number of elements in buffer
* @param[out] pFactorValuesNeededCount - will be filled with the count of the written elements, or needed buffer size.
* @param[out] pFactorValuesBuffer - double buffer of An target override factor for each point of the segment. In case of Polyline, the first array value describes the override for the initial jump. In case of Loop, the first array value describes the override for the inital jump and the last closing mark movement of the polyline.
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointOverrideFactorsPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, const Lib3MF_uint64 nFactorValuesBufferSize, Lib3MF_uint64* pFactorValuesNeededCount, Lib3MF_double * pFactorValuesBuffer);

/**
* Retrieves the assigned segment hatch list. Converts any polyline or loop into hatches. Returns an empty array for delay and sync elements.
*
Expand All @@ -3698,6 +3722,19 @@ typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentHatchDataInModelUnit
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentHatchDataDiscretePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, const Lib3MF_uint64 nHatchDataBufferSize, Lib3MF_uint64* pHatchDataNeededCount, sLib3MFDiscreteHatch2D * pHatchDataBuffer);

/**
* Retrieves the assigned segment override factors. Fails if segment type is not hatch. The call will return two values per hatch, one per hatch point.
*
* @param[in] pToolpathLayerReader - ToolpathLayerReader instance.
* @param[in] nSegmentIndex - Segment Index. Must be between 0 and SegmentCount - 1.
* @param[in] eOverrideFactor - Which override factor value to retrieve (F, G or H). Returns an array of 0.0, if override factor type is unknown or not given.
* @param[in] nFactorValuesBufferSize - Number of elements in buffer
* @param[out] pFactorValuesNeededCount - will be filled with the count of the written elements, or needed buffer size.
* @param[out] pFactorValuesBuffer - Hatch2DOverrides buffer of An target override factor for each point of the segment. In case of Polyline, the first array value describes the override for the initial jump. In case of Loop, the first array value describes the override for the inital jump and the last closing mark movement of the polyline.
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentHatchOverrideFactorsPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nSegmentIndex, eLib3MFToolpathProfileOverrideFactor eOverrideFactor, const Lib3MF_uint64 nFactorValuesBufferSize, Lib3MF_uint64* pFactorValuesNeededCount, sLib3MFHatch2DOverrides * pFactorValuesBuffer);

/*************************************************************************************************************************
Class definition for ToolpathLayerData
**************************************************************************************************************************/
Expand Down Expand Up @@ -6138,11 +6175,14 @@ typedef struct {
PLib3MFToolpathLayerReader_GetSegmentDefaultProfileUUIDPtr m_ToolpathLayerReader_GetSegmentDefaultProfileUUID;
PLib3MFToolpathLayerReader_GetSegmentDefaultProfileIDPtr m_ToolpathLayerReader_GetSegmentDefaultProfileID;
PLib3MFToolpathLayerReader_GetProfileUUIDByLocalProfileIDPtr m_ToolpathLayerReader_GetProfileUUIDByLocalProfileID;
PLib3MFToolpathLayerReader_SegmentHasOverrideFactorsPtr m_ToolpathLayerReader_SegmentHasOverrideFactors;
PLib3MFToolpathLayerReader_SegmentHasUniformProfilePtr m_ToolpathLayerReader_SegmentHasUniformProfile;
PLib3MFToolpathLayerReader_GetSegmentPointDataInModelUnitsPtr m_ToolpathLayerReader_GetSegmentPointDataInModelUnits;
PLib3MFToolpathLayerReader_GetSegmentPointDataDiscretePtr m_ToolpathLayerReader_GetSegmentPointDataDiscrete;
PLib3MFToolpathLayerReader_GetSegmentPointOverrideFactorsPtr m_ToolpathLayerReader_GetSegmentPointOverrideFactors;
PLib3MFToolpathLayerReader_GetSegmentHatchDataInModelUnitsPtr m_ToolpathLayerReader_GetSegmentHatchDataInModelUnits;
PLib3MFToolpathLayerReader_GetSegmentHatchDataDiscretePtr m_ToolpathLayerReader_GetSegmentHatchDataDiscrete;
PLib3MFToolpathLayerReader_GetSegmentHatchOverrideFactorsPtr m_ToolpathLayerReader_GetSegmentHatchOverrideFactors;
PLib3MFToolpathLayerData_GetLayerDataUUIDPtr m_ToolpathLayerData_GetLayerDataUUID;
PLib3MFToolpathLayerData_RegisterProfilePtr m_ToolpathLayerData_RegisterProfile;
PLib3MFToolpathLayerData_RegisterBuildItemPtr m_ToolpathLayerData_RegisterBuildItem;
Expand Down
5 changes: 5 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,11 @@ typedef struct sLib3MFHatch2D {
Lib3MF_int32 m_Tag;
} sLib3MFHatch2D;

typedef struct sLib3MFHatch2DOverrides {
Lib3MF_double m_Point1Override;
Lib3MF_double m_Point2Override;
} sLib3MFHatch2DOverrides;

typedef struct sLib3MFDiscreteHatch2D {
Lib3MF_int32 m_Point1Coordinates[2];
Lib3MF_int32 m_Point2Coordinates[2];
Expand Down
Loading

0 comments on commit 83ba867

Please sign in to comment.